# HG changeset patch # User reimar # Date 1332616936 0 # Node ID 6cfaa555bec1873406b2fc8eff57d7bc9e9cc606 # Parent 0eb4c719ca0cf3d9c57955e8884ae72e51893569 libmad: set i_bps only if it is not already set. Since that value is only based on the very first MP3 frame, it is very likely to be much less accurate than any existing value from a demuxer. Patch by Benot Thbaudeau. Signed-off-by: "Benot Thbaudeau" diff -r 0eb4c719ca0c -r 6cfaa555bec1 libmpcodecs/ad_libmad.c --- a/libmpcodecs/ad_libmad.c Sat Mar 24 19:19:48 2012 +0000 +++ b/libmpcodecs/ad_libmad.c Sat Mar 24 19:22:16 2012 +0000 @@ -100,7 +100,8 @@ sh->channels=(this->frame.header.mode == MAD_MODE_SINGLE_CHANNEL) ? 1 : 2; sh->samplerate=this->frame.header.samplerate; - sh->i_bps=this->frame.header.bitrate/8; + if (sh->i_bps < 1) + sh->i_bps=this->frame.header.bitrate/8; sh->samplesize=2; return 1;