Subject: | Flv files of ustrem have 0 length audio body. |
I got flv files from ustream and tried to get information of these files.
(How to get flv files from ustream desccribed here:
http://use.perl.org/~miyagawa/journal/34603)
But I got an error like this:
Failed to read FLV file: Tag size is too small (0) at byte 193 (0xc1) at
/usr/local/lib/perl5/site_perl/5.8.7/FLV/Tag.pm line 81.
Because of ustream flv files have 0 length audio body.
So I wrote a patch to fix it.
It is not a bug, but I with that it will be fixed.
Thanks.
=== lib/FLV/AudioTag.pm
==================================================================
--- lib/FLV/AudioTag.pm (revision 2255)
+++ lib/FLV/AudioTag.pm (local)
@@ -44,6 +44,8 @@
my $file = shift;
my $datasize = shift;
+ return unless $datasize;
+
my $flags = unpack 'C', $file->get_bytes(1);
my $format = (($flags >> 4) & 0x0f);
=== lib/FLV/Tag.pm
==================================================================
--- lib/FLV/Tag.pm (revision 2255)
+++ lib/FLV/Tag.pm (local)
@@ -76,10 +76,10 @@
warn "Funny timestamp: @timestamp -> $timestamp\n";
}
- if ($datasize < 11)
- {
- die "Tag size is too small ($datasize) at byte " .
$file->get_pos(-10);
- }
+ #if ($datasize < 11)
+ #{
+ # die "Tag size is too small ($datasize) at byte " .
$file->get_pos(-10);
+ #}
my $payload_class = $TAG_CLASSES{$type};
if (!$payload_class)