summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-04-11 10:38:56 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-04-11 10:38:56 +0000
commitf772b7fa7d57cba2e81727c7af29110f9556f06f (patch)
tree9fed5fa03e8a382f7fe29f2a38a8f61493b037c8
parentfacf521daac38b434adb7a1115cf654b0ae7e7e3 (diff)
Make electronicarts demuxer return partial frames, this is the default
behaviour of av_get_packet and should not be override without good reason. As a side effect this fixes the memleak described in issue 956. Also return the exact error code from av_get_packet instead of AVERROR(EIO). Originally committed as revision 18428 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/electronicarts.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c
index fe19e70f73..eb18c5a93d 100644
--- a/libavformat/electronicarts.c
+++ b/libavformat/electronicarts.c
@@ -470,9 +470,8 @@ static int ea_read_packet(AVFormatContext *s,
chunk_size -= 12;
}
ret = av_get_packet(pb, pkt, chunk_size);
- if (ret != chunk_size)
- ret = AVERROR(EIO);
- else {
+ if (ret < 0)
+ return ret;
pkt->stream_index = ea->audio_stream_index;
pkt->pts = 90000;
pkt->pts *= ea->audio_frame_counter;
@@ -493,7 +492,6 @@ static int ea_read_packet(AVFormatContext *s,
ea->audio_frame_counter += chunk_size /
(ea->bytes * ea->num_channels);
}
- }
packet_read = 1;
break;
@@ -531,12 +529,10 @@ static int ea_read_packet(AVFormatContext *s,
case MV0F_TAG:
get_video_packet:
ret = av_get_packet(pb, pkt, chunk_size);
- if (ret != chunk_size)
- ret = AVERROR_IO;
- else {
+ if (ret < 0)
+ return ret;
pkt->stream_index = ea->video_stream_index;
pkt->flags |= key;
- }
packet_read = 1;
break;