[FFmpeg-devel] [PATCH] ffmpeg: Fix setting flags for codec copy.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat Feb 18 10:45:11 CET 2012


On Sat, Feb 18, 2012 at 07:54:13AM +0100, Michael Niedermayer wrote:
> Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> ---
>  ffmpeg.c |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)
> 
> diff --git a/ffmpeg.c b/ffmpeg.c
> index dfe7394..e6c27f6 100644
> --- a/ffmpeg.c
> +++ b/ffmpeg.c
> @@ -4402,6 +4402,15 @@ static void opt_output_file(void *optctx, const char *filename)
>          }
>      }
>  
> +    for (i = nb_output_streams - oc->nb_streams; i < nb_output_streams; i++) {

That same loop construct is used in the ffm case, but I don't
really know what it loops over.
Is it "set defaults for all following output streams"?
A small comment would be good IMO.

> +        AVDictionaryEntry *e;
> +        ost = &output_streams[i];
> +
> +        if (ost->stream_copy && (e = av_dict_get(codec_opts, "flags", NULL, 0)))

Why only stream copy btw? A "for non-stream-copy will it will be
overwritten by the input codec flags anyway" comment maybe if I
am guessing right?
And I assume you did it this way to easily be able to extend it for
other options, because otherwise having these outside the loop would
make more sense.
But otherwise it fixes the issue, so thanks and please commit.


More information about the ffmpeg-devel mailing list