[MPlayer-cvslog] r19366 - in trunk: libmpcodecs/ae_lavc.c libmpcodecs/ve_lavc.c libmpdemux/muxer.h libmpdemux/muxer_lavf.c
michael
subversion at mplayerhq.hu
Thu Aug 10 23:48:41 CEST 2006
Author: michael
Date: Thu Aug 10 23:48:41 2006
New Revision: 19366
Modified:
trunk/libmpcodecs/ae_lavc.c
trunk/libmpcodecs/ve_lavc.c
trunk/libmpdemux/muxer.h
trunk/libmpdemux/muxer_lavf.c
Log:
pass average bitrate from encoder to (lavf) muxer
Modified: trunk/libmpcodecs/ae_lavc.c
==============================================================================
--- trunk/libmpcodecs/ae_lavc.c (original)
+++ trunk/libmpcodecs/ae_lavc.c Thu Aug 10 23:48:41 2006
@@ -38,6 +38,7 @@
mux_a->wf->nChannels = lavc_actx->channels;
mux_a->wf->nSamplesPerSec = lavc_actx->sample_rate;
mux_a->wf->nAvgBytesPerSec = (lavc_actx->bit_rate / 8);
+ mux_a->avg_rate= lavc_actx->bit_rate;
mux_a->h.dwRate = mux_a->wf->nAvgBytesPerSec;
if(lavc_actx->block_align)
mux_a->h.dwSampleSize = mux_a->h.dwScale = lavc_actx->block_align;
Modified: trunk/libmpcodecs/ve_lavc.c
==============================================================================
--- trunk/libmpcodecs/ve_lavc.c (original)
+++ trunk/libmpcodecs/ve_lavc.c Thu Aug 10 23:48:41 2006
@@ -331,7 +331,7 @@
else
lavc_venc_context->bit_rate = 800000; /* default */
- //mux_v->wf->nAvgBytesPerSec= lavc_venc_context->bit_rate/8;
+ mux_v->avg_rate= lavc_venc_context->bit_rate;
lavc_venc_context->bit_rate_tolerance= lavc_param_vrate_tolerance*1000;
lavc_venc_context->time_base= (AVRational){mux_v->h.dwScale, mux_v->h.dwRate};
Modified: trunk/libmpdemux/muxer.h
==============================================================================
--- trunk/libmpdemux/muxer.h (original)
+++ trunk/libmpdemux/muxer.h Thu Aug 10 23:48:41 2006
@@ -48,6 +48,7 @@
int vbv_size;
int max_rate;
+ int avg_rate;
} muxer_stream_t;
typedef struct {
Modified: trunk/libmpdemux/muxer_lavf.c
==============================================================================
--- trunk/libmpdemux/muxer_lavf.c (original)
+++ trunk/libmpdemux/muxer_lavf.c Thu Aug 10 23:48:41 2006
@@ -185,7 +185,8 @@
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;
More information about the MPlayer-cvslog
mailing list