On Sat, 29 Sep 2012 23:07:43 +0200, Luca Barbato <[email protected]> wrote:
> Split away option settings, sanity checks and general setup.
> ---
> libavformat/mux.c | 53 ++++++++++++++++++++++++++++++++++++++---------------
> 1 file changed, 38 insertions(+), 15 deletions(-)
>
> diff --git a/libavformat/mux.c b/libavformat/mux.c
> index ecd2988..aa8d228 100644
> --- a/libavformat/mux.c
> +++ b/libavformat/mux.c
> @@ -135,7 +135,8 @@ static int validate_codec_tag(AVFormatContext *s,
> AVStream *st)
> return 1;
> }
>
> -int avformat_write_header(AVFormatContext *s, AVDictionary **options)
> +
> +static int write_setup(AVFormatContext *s, AVDictionary **options)
This name is a bit vague. I'd use init_write_header or something like
that.
> {
> int ret = 0, i;
> AVStream *st;
> @@ -248,12 +249,23 @@ int avformat_write_header(AVFormatContext *s,
> AVDictionary **options)
> av_dict_set(&s->metadata, "encoder", LIBAVFORMAT_IDENT, 0);
> }
>
> - if (s->oformat->write_header) {
> - ret = s->oformat->write_header(s);
> - if (ret < 0)
> - goto fail;
> + if (options) {
> + av_dict_free(options);
> + *options = tmp;
> }
>
> + return 0;
> +
> + fail:
Indentation
Otherwise looks ok.
--
Anton Khirnov
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel