diff options
author | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-12-06 21:50:35 +0000 |
---|---|---|
committer | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-12-06 21:50:35 +0000 |
commit | a875c26d75034eb10cb20a533d77af6f269a8538 (patch) | |
tree | a4c5e5fe96d5dddd82c8c2399ccc7e1b8de6164f /mencoder.c | |
parent | 2b8246c93688416beb77d334ad64a0d2ae708dd8 (diff) |
Using CBR stream format for CBR mp3 audio
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3355 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mencoder.c')
-rw-r--r-- | mencoder.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/mencoder.c b/mencoder.c index ee0b27b7eb..b3294cd806 100644 --- a/mencoder.c +++ b/mencoder.c @@ -705,7 +705,7 @@ if(sh_audio){ if(len<=0) break; // EOF? aviwrite_write_chunk(muxer,mux_a,muxer_f,len,0); if(!mux_a->h.dwSampleSize && mux_a->timer>0) - mux_a->wf->nAvgBytesPerSec=mux_a->size/mux_a->timer; // avg bps (VBR) + mux_a->wf->nAvgBytesPerSec=0.5f+(double)mux_a->size/mux_a->timer; // avg bps (VBR) if(mux_a->buffer_len>=len){ mux_a->buffer_len-=len; memcpy(mux_a->buffer,mux_a->buffer+len,mux_a->buffer_len); @@ -856,6 +856,15 @@ if(sh_audio){ } // while(!eof) +// fixup CBR audio header: +if(sh_audio && mux_a->codec==ACODEC_VBRMP3 && !lame_param_vbr){ + mux_a->h.dwSampleSize=1; + mux_a->h.dwRate=mux_a->wf->nAvgBytesPerSec; + mux_a->h.dwScale=1; + printf("\n\nCBR audio effective bitrate: %8.3f kbit/s (%d bytes/sec)\n", + mux_a->h.dwRate*8.0f/1000.0f,mux_a->h.dwRate); +} + printf("\nWriting AVI index...\n"); aviwrite_write_index(muxer,muxer_f); printf("Fixup AVI header...\n"); |