[FFmpeg-devel] [PATCH] Improve error-messaging with ffmpeg presets
Stefano Sabatini
stefano.sabatini-lala
Sun Oct 12 11:48:29 CEST 2008
On date Sunday 2008-10-05 12:50:47 +0200, Stefano Sabatini encoded:
> On date Saturday 2008-10-04 11:22:03 +0200, Stefano Sabatini encoded:
> > On date Sunday 2008-09-28 20:59:52 +0200, Stefano Sabatini encoded:
> > > Hi,
> > > as in subject.
> > >
> > > Two hunks will correspond to two separate commits.
> > [...]
> > > Index: ffmpeg.c
> > > ===================================================================
> > > --- ffmpeg.c (revision 15445)
> > > +++ ffmpeg.c (working copy)
> > > @@ -3733,7 +3733,7 @@
> > > }
> > >
> > > if(!f){
> > > - fprintf(stderr, "Preset file not found\n");
> > > + fprintf(stderr, "Preset file '%s' not found\n", arg);
> > > av_exit(1);
> > > }
> > >
> > > @@ -3752,8 +3752,10 @@
> > > opt_video_codec(tmp2);
> > > }else if(!strcmp(tmp, "scodec")){
> > > opt_subtitle_codec(tmp2);
> > > - }else
> > > - opt_default(tmp, tmp2);
> > > + }else if(opt_default(tmp, tmp2) < 0){
> > > + fprintf(stderr, "Invalid option or argument: %s=%s\n", tmp, tmp2);
> > > + av_exit(1);
> > > + }
> > > }
> > >
> > > fclose(f);
> >
> > Ping?
>
> I'll apply both in two days if no one has objections.
Then I realized I wasn't satisfied with the patch, please check the
attached one.
I introduced a filename string which is used to print the name of the
file where the error is eventually encountered, and I changed:
fprintf(stderr, "Preset file '%s' not found\n", arg);
to
fprintf(stderr, "File for preset '%s' not found\n", arg);
since the argument doesn't necessarily specify a filename.
Regards.
--
FFmpeg = Fast and Furious Merciless Portable Elastic Gorilla
-------------- next part --------------
A non-text attachment was scrubbed...
Name: more-useful-preset-errmsg-02.patch
Type: text/x-diff
Size: 2085 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081012/27a7fbe2/attachment.patch>
More information about the ffmpeg-devel
mailing list