Changeset 431 for lang/perl/plagger/lib/Plagger/Plugin/Filter/FLVInfo.pm
- Timestamp:
- 10/08/07 14:57:46 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/plagger/lib/Plagger/Plugin/Filter/FLVInfo.pm
r416 r431 22 22 my $enclosure = $entry->enclosure; 23 23 if (!defined $enclosure) { 24 $context->log(error => q{Can't find an enc osure.});24 $context->log(error => q{Can't find an enclosure.}); 25 25 return; 26 26 } … … 33 33 34 34 my $local_path = $enclosure->local_path; 35 if ($ enclosure->local_path !~ m/\.flv$/xmsg) {35 if ($local_path !~ m/\.flv$/xmsg) { 36 36 $context->log(warn => qq{Can't get info from $local_path.}); 37 37 return; … … 42 42 $reader->parse($enclosure->local_path); 43 43 44 my %info = $reader->get_info; 44 my %info = $reader->get_info; 45 my %flvinfo; 45 46 46 47 my $height = $info{video_height} || $info{meta_height}; 47 48 my $width = $info{video_width} || $info{meta_width}; 48 49 49 my $aspect; 50 if ($width/$height > 1.5) { 51 $aspect = '16:9'; 52 } 53 else { 54 $aspect = '4:3'; 55 } 56 57 $entry->meta->{flvinfo} = { 50 %flvinfo = ( 58 51 height => $height, 59 52 width => $width, 60 aspect => $aspect, 61 }; 53 aspect => ($width/$height > 1.5) ? '16:9' : '4:3' , 54 ); 55 56 my $metadata_keys = $self->conf->{metadata}; 57 $metadata_keys = [ $metadata_keys ] unless ref $metadata_keys; 58 map { $flvinfo{$_} = $info{$_} } @{$metadata_keys}; 59 60 $entry->meta->{flvinfo} = \%flvinfo; 61 62 62 } 63 63 … … 91 91 =head1 CONFIG 92 92 93 - module: Filter::FLVInfo 94 config: 95 metadata: 96 - duration 97 - video_codec 98 - audio_rate 99 93 100 =head1 AUTHOR 94 101 95 Yohei Fushii 102 Yohei Fushii, Masafumi Otsune 96 103 97 104 =head1 SEE ALSO
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)