# HG changeset patch # User reimar # Date 1327755478 0 # Node ID 88bd2174f6165c10f1b21e9f76d3bf97f4ec87f0 # Parent 4b2275e890ac3142c2cb195519460b46638ebe3a Set muxrate and preload via AVDictionary. diff -r 4b2275e890ac -r 88bd2174f616 libmpdemux/muxer_lavf.c --- a/libmpdemux/muxer_lavf.c Sat Jan 28 12:52:23 2012 +0000 +++ b/libmpdemux/muxer_lavf.c Sat Jan 28 12:57:58 2012 +0000 @@ -281,9 +281,20 @@ static void write_header(muxer_t *muxer) { muxer_priv_t *priv = muxer->priv; + AVDictionary *opts = NULL; + char tmpstr[50]; mp_msg(MSGT_MUXER, MSGL_INFO, MSGTR_WritingHeader); - avformat_write_header(priv->oc, NULL); + if (mux_rate) { + snprintf(tmpstr, sizeof(tmpstr), "%i", mux_rate); + av_dict_set(&opts, "muxrate", tmpstr, 0); + } + if (mux_preload) { + snprintf(tmpstr, sizeof(tmpstr), "%i", (int)(mux_preload * AV_TIME_BASE)); + av_dict_set(&opts, "preload", tmpstr, 0); + } + avformat_write_header(priv->oc, &opts); + av_dict_free(&opts); muxer->cont_write_header = NULL; } @@ -355,8 +366,6 @@ priv->oc->packet_size= mux_packet_size; - priv->oc->mux_rate= mux_rate; - priv->oc->preload= (int)(mux_preload*AV_TIME_BASE); priv->oc->max_delay= (int)(mux_max_delay*AV_TIME_BASE); if (info_name) av_dict_set(&priv->oc->metadata, "title", info_name, 0);