changeset 35312:3e6a575bd47b

Simplify code.
author reimar
date Sat, 10 Nov 2012 14:27:09 +0000
parents 18eebabbc172
children 2b211b058ee2
files libmpdemux/muxer_lavf.c
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/muxer_lavf.c	Sat Nov 10 14:21:16 2012 +0000
+++ b/libmpdemux/muxer_lavf.c	Sat Nov 10 14:27:09 2012 +0000
@@ -177,19 +177,17 @@
 
 static void fix_parameters(muxer_stream_t *stream)
 {
-	muxer_stream_priv_t *spriv = (muxer_stream_priv_t *) stream->priv;
-	AVCodecContext *ctx;
-
-	ctx = spriv->avstream->codec;
+	muxer_stream_priv_t *spriv = stream->priv;
+	AVCodecContext *ctx = spriv->avstream->codec;
 
         ctx->bit_rate= stream->avg_rate;
-        if(stream->wf && stream->wf->nAvgBytesPerSec && !ctx->bit_rate)
-            ctx->bit_rate = stream->wf->nAvgBytesPerSec * 8;
         ctx->rc_buffer_size= stream->vbv_size;
         ctx->rc_max_rate= stream->max_rate;
 
 	if(stream->type == MUXER_TYPE_AUDIO)
 	{
+		if (!ctx->bit_rate)
+		    ctx->bit_rate = stream->wf->nAvgBytesPerSec * 8;
 		ctx->codec_id = mp_tag2codec_id(stream->wf->wFormatTag, 1);
 #if 0 //breaks aac in mov at least
 		ctx->codec_tag = codec_get_wav_tag(ctx->codec_id);