[FFmpeg-devel] [PATCH 2/4] ffmpeg: do not reset the map when adding an input.
Stefano Sabatini
stefasab at gmail.com
Sat Mar 24 12:44:25 CET 2012
On date Thursday 2012-03-22 16:50:39 +0100, Clément Bœsch encoded:
> From: Clément Bœsch <clement.boesch at smartjog.com>
>
> The map array contains a reference to the input file and stream, so it
> won't mix up with any following specified input; there is no reason to
> drop them.
>
> Also, keeping the maps allows to create new streams on the fly and not
> break the map definitions.
Please be more specific in the commit subject/log, there are at least
4 different maps.
> ---
> ffmpeg.c | 7 ++++++-
> 1 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/ffmpeg.c b/ffmpeg.c
> index 5606f17..32286e2 100644
> --- a/ffmpeg.c
> +++ b/ffmpeg.c
> @@ -456,11 +456,16 @@ static void reset_options(OptionsContext *o, int is_input)
> po++;
> }
>
> - av_freep(&o->stream_maps);
> + if (!is_input)
> + av_freep(&o->stream_maps);
> av_freep(&o->audio_channel_maps);
> av_freep(&o->streamid_map);
>
> memset(o, 0, sizeof(*o));
> + if (is_input) {
> + o->stream_maps = bak.stream_maps;
> + o->nb_stream_maps = bak.nb_stream_maps;
> + }
>
> if(is_input) o->recording_time = bak.recording_time;
You can merge these.
BTW, by following the same logic, why this is only applied to
o->stream_maps and not to the other maps (audio_channel, meta_data,
streamid)?
(Note: the mapping code is new to me and pretty convoluted, so I may
be missing something obvious.)
--
FFmpeg = Fiendish and Funny Meaningful Problematic Eccentric Gnome
More information about the ffmpeg-devel
mailing list