aboutsummaryrefslogtreecommitdiffhomepage
path: root/libmpdemux
diff options
context:
space:
mode:
authorGravatar michael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-08-10 21:48:41 +0000
committerGravatar michael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-08-10 21:48:41 +0000
commitb85ad74dc94a27a6f0181a0c7a75d08798ec8e1d (patch)
treef9c52fccb5d3ecc50d667d3229183b69db6ae7c5 /libmpdemux
parent0fb68cc0725695193565774843855906872f49c2 (diff)
pass average bitrate from encoder to (lavf) muxer
this fixes some problems with muxing mp4 files for the psp git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19366 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/muxer.h1
-rw-r--r--libmpdemux/muxer_lavf.c3
2 files changed, 3 insertions, 1 deletions
diff --git a/libmpdemux/muxer.h b/libmpdemux/muxer.h
index 7f3779d6d1..1dae84ec8e 100644
--- a/libmpdemux/muxer.h
+++ b/libmpdemux/muxer.h
@@ -48,6 +48,7 @@ typedef struct {
int vbv_size;
int max_rate;
+ int avg_rate;
} muxer_stream_t;
typedef struct {
diff --git a/libmpdemux/muxer_lavf.c b/libmpdemux/muxer_lavf.c
index c8601738e3..09794c7573 100644
--- a/libmpdemux/muxer_lavf.c
+++ b/libmpdemux/muxer_lavf.c
@@ -185,7 +185,8 @@ static void fix_parameters(muxer_stream_t *stream)
ctx = spriv->avstream->codec;
- if(stream->wf && stream->wf->nAvgBytesPerSec)
+ 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;