Commit f772b7fa authored by Reimar Döffinger's avatar Reimar Döffinger

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
parent facf521d
...@@ -470,9 +470,8 @@ static int ea_read_packet(AVFormatContext *s, ...@@ -470,9 +470,8 @@ static int ea_read_packet(AVFormatContext *s,
chunk_size -= 12; chunk_size -= 12;
} }
ret = av_get_packet(pb, pkt, chunk_size); ret = av_get_packet(pb, pkt, chunk_size);
if (ret != chunk_size) if (ret < 0)
ret = AVERROR(EIO); return ret;
else {
pkt->stream_index = ea->audio_stream_index; pkt->stream_index = ea->audio_stream_index;
pkt->pts = 90000; pkt->pts = 90000;
pkt->pts *= ea->audio_frame_counter; pkt->pts *= ea->audio_frame_counter;
...@@ -493,7 +492,6 @@ static int ea_read_packet(AVFormatContext *s, ...@@ -493,7 +492,6 @@ static int ea_read_packet(AVFormatContext *s,
ea->audio_frame_counter += chunk_size / ea->audio_frame_counter += chunk_size /
(ea->bytes * ea->num_channels); (ea->bytes * ea->num_channels);
} }
}
packet_read = 1; packet_read = 1;
break; break;
...@@ -531,12 +529,10 @@ static int ea_read_packet(AVFormatContext *s, ...@@ -531,12 +529,10 @@ static int ea_read_packet(AVFormatContext *s,
case MV0F_TAG: case MV0F_TAG:
get_video_packet: get_video_packet:
ret = av_get_packet(pb, pkt, chunk_size); ret = av_get_packet(pb, pkt, chunk_size);
if (ret != chunk_size) if (ret < 0)
ret = AVERROR_IO; return ret;
else {
pkt->stream_index = ea->video_stream_index; pkt->stream_index = ea->video_stream_index;
pkt->flags |= key; pkt->flags |= key;
}
packet_read = 1; packet_read = 1;
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment