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

2015-10-21 Thread Peter Ross
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 
> ---
>  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)


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


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

2015-10-19 Thread Peter Ross
On Mon, Oct 19, 2015 at 11:35:15AM +0200, Paul B Mahol wrote:
> Such files have empty gaps between chunks.

Paul, where might I find a sample to test?

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


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

2015-10-19 Thread Paul B Mahol
Such files have empty gaps between chunks.

Signed-off-by: Paul B Mahol 
---
 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;
 
-- 
1.9.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel