[FFmpeg-devel] [PATCH] ffmpeg: add verbose consistency checks in case of filtering inconsistent options

Michael Niedermayer michaelni at gmx.at
Sun Nov 3 17:41:07 CET 2013


On Sun, Nov 03, 2013 at 05:11:11PM +0100, Stefano Sabatini wrote:
> On date Sunday 2013-11-03 16:31:02 +0100, Michael Niedermayer encoded:
> > On Sun, Nov 03, 2013 at 10:50:16AM +0100, Stefano Sabatini wrote:
> > > In particular, warn in case -filter and streamcopy is used at the same
> > > time, fix trac ticket #678.
> > > ---
> > >  ffmpeg_opt.c | 37 +++++++++++++++++++++++++++++++++++++
> > >  1 file changed, 37 insertions(+)
> > > 
> > > diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
> > > index c9283d6..12bfb34 100644
> > > --- a/ffmpeg_opt.c
> > > +++ b/ffmpeg_opt.c
> > > @@ -1171,6 +1171,26 @@ static char *get_ost_filters(OptionsContext *o, AVFormatContext *oc,
> > >                       "null" : "anull");
> > >  }
> > >  
> > > +#define CHECK_STREAMCOPY_FILTERS(ost, type) do {                        \
> > > +    if (ost->stream_copy) {                                             \
> > > +        char *filter_script = NULL, *filter = NULL;                     \
> > > +        MATCH_PER_STREAM_OPT(filter_scripts, str, filter_script, oc, st); \
> > > +        MATCH_PER_STREAM_OPT(filters,        str, filter,        oc, st); \
> > > +                                                                        \
> > > +        if (filter_script || filter) {                                  \
> > > +            av_log(NULL, AV_LOG_ERROR,                                  \
> > > +                   "Filter '%s' or filter_script '%s' was defined for %s output stream " \
> > > +                   "%d:%d but codec copy was selected.\n"               \
> > > +                   "Filtering and streamcopy cannot be used together.", \
> > > +                   (char *)av_x_if_null(filter, "(none)"),              \
> > > +                   (char *)av_x_if_null(filter_script, "(none)"),       \
> > > +                   av_get_media_type_string(AVMEDIA_TYPE_##type),       \
> > > +                   ost->file_index, ost->index);                        \
> > > +            exit_program(1);                                            \
> > > +        }                                                               \
> > > +    }                                                                   \
> > > +} while (0)
> > 
> > i would prefer this as function instead of macro due to better
> > readability
> 
> Up.

thanks, LGTM

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

There will always be a question for which you do not know the correct answer.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20131103/61d2106a/attachment.asc>


More information about the ffmpeg-devel mailing list