]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
wc3movie: return partial packets if not all data can be read.
authorreimar <reimar@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sat, 11 Apr 2009 20:48:56 +0000 (20:48 +0000)
committerreimar <reimar@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sat, 11 Apr 2009 20:48:56 +0000 (20:48 +0000)
This is consistent with other demuxer's behaviour and avoids a memleak.
It also returns the error from av_get_packet instead of always AVERROR(EIO).

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18446 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavformat/wc3movie.c

index 8e5dd38c0d972c111ba1ec6391e6b7bf4d3146db..42f50d493e3cf9e3e79190edef5bab8596e468c8 100644 (file)
@@ -320,8 +320,6 @@ static int wc3_read_packet(AVFormatContext *s,
             ret= av_get_packet(pb, pkt, size);
             pkt->stream_index = wc3->video_stream_index;
             pkt->pts = wc3->pts;
-            if (ret != size)
-                ret = AVERROR(EIO);
             packet_read = 1;
             break;
 
@@ -349,8 +347,6 @@ static int wc3_read_packet(AVFormatContext *s,
             ret= av_get_packet(pb, pkt, size);
             pkt->stream_index = wc3->audio_stream_index;
             pkt->pts = wc3->pts;
-            if (ret != size)
-                ret = AVERROR(EIO);
 
             /* time to advance pts */
             wc3->pts++;