[FFmpeg-devel] [PATCH] lavf: Add support for WebM Live Muxing
Vignesh Venkatasubramanian
vigneshv at google.com
Mon Mar 30 23:48:57 CEST 2015
On Mon, Mar 30, 2015 at 1:00 PM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:
> Vignesh Venkatasubramanian <vigneshv <at> google.com> writes:
>
>> + if (!wc->oformat) { return AVERROR_MUXER_NOT_FOUND; }
>
> It is your file but most people here seem to agree
> that the following is more (and not less) readable:
> if (!wc->oformat)
> return AVERROR_MUXER_NOT_FOUND;
>
Done.
>> + if ((ret = chunk_mux_init(s)) < 0) { return ret; }
>
> It is your decision but not merging assignment and
> comparison is common practice here: I suspect both
> for readability and because it saves a lot of time
> debugging...
>
Have separated out assignment and comparison where ever it made sense to do so.
>> + oc->streams = NULL;
>> + oc->nb_streams = 0;
>> + avformat_free_context(oc);
>
>> + oc->streams = NULL;
>> + oc->nb_streams = 0;
>> + avformat_free_context(oc);
>
> The first two seem unnecessary if you call
> avformat_free_context().
The first two lines are intentional. If you look at line 83 of this
file, you can see that i'm merely assigning the streams to oc. So i
don't want them to be free'd in this call to avformat_free_context as
they will be free'd by ffmpeg's call to avformat_free_context.
>
> Carl Eugen
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
--
Vignesh
More information about the ffmpeg-devel
mailing list