[FFmpeg-devel] [PATCH] mxfdec: do not fail on error parsing footer.

Alex Zhukov zhukov.alex at gmail.com
Thu Jan 5 23:33:29 CET 2012


Tell me what I am doing wrong

git pull
git diff #no differences
patch -p1 <reimar.patch #attached

patching file libavformat/mxfdec.c
Hunk #1 FAILED at 1634.
Hunk #2 FAILED at 1688.
Hunk #3 FAILED at 1703.
3 out of 3 hunks FAILED -- saving rejects to file libavformat/mxfdec.c.rej

On Thu, Jan 5, 2012 at 1:06 PM, Reimar Döffinger
<Reimar.Doeffinger at gmx.de> wrote:
> Failing it play a file just because some metadata was not parseable
> is overkill.
> This should fix trac issue #879.
>
> Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
> ---
>  libavformat/mxfdec.c |    7 ++++---
>  1 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
> index 10512ef..66af2e4 100644
> --- a/libavformat/mxfdec.c
> +++ b/libavformat/mxfdec.c
> @@ -1634,7 +1634,7 @@ static int mxf_read_header(AVFormatContext *s, AVFormatParameters *ap)
>
>             if (!mxf->current_partition) {
>                 av_log(mxf->fc, AV_LOG_ERROR, "found essence prior to first PartitionPack\n");
> -                return AVERROR_INVALIDDATA;
> +                goto handle_essence;
>             }
>
>             if (!mxf->current_partition->essence_offset) {
> @@ -1688,14 +1688,14 @@ static int mxf_read_header(AVFormatContext *s, AVFormatParameters *ap)
>                     if (avio_tell(s->pb) > next) {
>                         av_log(s, AV_LOG_ERROR, "read past end of KLV @ %#"PRIx64"\n",
>                                klv.offset);
> -                        return AVERROR_INVALIDDATA;
> +                        goto handle_essence;
>                     }
>
>                     avio_seek(s->pb, next, SEEK_SET);
>                 }
>                 if (res < 0) {
>                     av_log(s, AV_LOG_ERROR, "error reading header metadata\n");
> -                    return -1;
> +                    goto handle_essence;
>                 }
>                 break;
>             }
> @@ -1703,6 +1703,7 @@ static int mxf_read_header(AVFormatContext *s, AVFormatParameters *ap)
>         if (!metadata->read)
>             avio_skip(s->pb, klv.length);
>     }
> +handle_essence:
>     /* FIXME avoid seek */
>     if (!essence_offset)  {
>         av_log(s, AV_LOG_ERROR, "no essence\n");
> --
> 1.7.8.2
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: reimar.patch
Type: application/octet-stream
Size: 1697 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120105/9272f0ec/attachment.obj>


More information about the ffmpeg-devel mailing list