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

Stefano Sabatini stefasab at gmail.com
Sun Nov 3 17:11:11 CET 2013


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.
-- 
FFmpeg = Fundamental & Frenzy Mean Purposeless Emblematic Governor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-ffmpeg-add-verbose-consistency-checks-in-case-of-fil.patch
Type: text/x-diff
Size: 3474 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20131103/dcb323f8/attachment.bin>


More information about the ffmpeg-devel mailing list