[FFmpeg-devel] [PATCH]Do not show an unreadable error code if mov header parsing fails

Carl Eugen Hoyos cehoyos at ag.or.at
Sun Aug 24 01:16:16 CEST 2014


On Sunday 24 August 2014 12:50:14 am Michael Niedermayer wrote:
> On Sat, Aug 23, 2014 at 02:02:49PM +0200, Carl Eugen Hoyos wrote:
> > Hi!
> >
> > I don't think showing "-1094995529" or similar makes much sense.
> > The calling application can still decide to show the error
> > string (as ffmpeg does).
> >
> > Please comment, Carl Eugen
> >
> >  mov.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 22cbe9fcb08e20f3520d8391f4a03dac1cb464df  patchmovheader.diff
> > diff --git a/libavformat/mov.c b/libavformat/mov.c
> > index b3eb287..ae48c02 100644
> > --- a/libavformat/mov.c
> > +++ b/libavformat/mov.c
> > @@ -3562,7 +3562,7 @@ static int mov_read_header(AVFormatContext *s)
> >      if (mov->moov_retry)
> >          avio_seek(pb, 0, SEEK_SET);
> >      if ((err = mov_read_default(mov, pb, atom)) < 0) {
> > -        av_log(s, AV_LOG_ERROR, "error reading header: %d\n", err);
> > +        av_log(s, AV_LOG_ERROR, "error reading header\n");
>
> i think av_err2str() might provide a nicer string

I prefer the original patch because ffmpeg -i deadf.mov prints 
the same error twice with attached patch and no (or nearly no) 
other demuxer behaves like this.

Carl Eugen
-------------- next part --------------
diff --git a/libavformat/mov.c b/libavformat/mov.c
index b3eb287..ced721c 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -3562,7 +3562,7 @@ static int mov_read_header(AVFormatContext *s)
     if (mov->moov_retry)
         avio_seek(pb, 0, SEEK_SET);
     if ((err = mov_read_default(mov, pb, atom)) < 0) {
-        av_log(s, AV_LOG_ERROR, "error reading header: %d\n", err);
+        av_log(s, AV_LOG_ERROR, "error reading header: %s\n", av_err2str(err));
         mov_read_close(s);
         return err;
     }


More information about the ffmpeg-devel mailing list