Fallback to sample rate if bit rate is 0. This avoids 0 timebases in nut.
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 2 Mar 2008 23:47:30 +0000 (23:47 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 2 Mar 2008 23:47:30 +0000 (23:47 +0000)
Originally committed as revision 12294 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/riff.c

index 64891db..b977f0d 100644 (file)
@@ -441,7 +441,7 @@ void ff_parse_specific_params(AVCodecContext *stream, int *au_rate, int *au_ssiz
         *au_rate = stream->time_base.den;
     }else{
         *au_scale= stream->block_align ? stream->block_align*8 : 8;
-        *au_rate = stream->bit_rate;
+        *au_rate = stream->bit_rate ? stream->bit_rate : 8*stream->sample_rate;
     }
     gcd= ff_gcd(*au_scale, *au_rate);
     *au_scale /= gcd;