[FFmpeg-devel] [PATCH] avformat/electronicarts: fix demuxing of certain .eam files

Peter Ross pross at xvid.org
Thu Oct 22 04:38:03 CEST 2015


On Mon, Oct 19, 2015 at 11:35:15AM +0200, Paul B Mahol wrote:
> Such files have empty gaps between chunks.
> 
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---
>  libavformat/electronicarts.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c
> index 5d21d49..c0b6d6e 100644
> --- a/libavformat/electronicarts.c
> +++ b/libavformat/electronicarts.c
> @@ -652,7 +652,14 @@ static int ea_read_packet(AVFormatContext *s, AVPacket *pkt)
>          case SCEl_TAG:
>          case SEND_TAG:
>          case SEEN_TAG:
> -            ret         = AVERROR(EIO);
> +            while (!avio_feof(pb)) {
> +                if (avio_rl32(pb)) {
> +                    avio_skip(pb, -4);
> +                    break;
> +                }
> +            }
> +            if (avio_feof(pb))
> +                ret = AVERROR_EOF;
>              packet_read = 1;
>              break;
>  

LGTM. Tested with samples from NFS8U2.

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20151022/f1e44dac/attachment.sig>


More information about the ffmpeg-devel mailing list