[FFmpeg-devel] [PATCH] ffprobe: report audio bit rate in stream description

Stefano Sabatini stefasab at gmail.com
Sat Feb 18 01:04:48 CET 2012


On date Wednesday 2012-02-15 05:05:50 +0100, Michael Niedermayer encoded:
> On Thu, Feb 09, 2012 at 07:06:42PM +0100, Stefano Sabatini wrote:
[...]
> >  #if FF_API_AVCODEC_OPEN
> >  int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec)
> >  {
> > @@ -865,6 +888,8 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, AVCodec *codec, AVD
> >              avctx->channels = av_get_channel_layout_nb_channels(avctx->channel_layout);
> >          }
> >      }
> > +    if (!avctx->bit_rate)
> > +        avctx->bit_rate = get_bit_rate(avctx);
> >  
> >      avctx->pts_correction_num_faulty_pts =
> >      avctx->pts_correction_num_faulty_dts = 0;
> 

> iam not sure if this is safe or may interfere with an encoder because
> i think this is run also for encoders

Right, added constraint on the codec type, also moved the check
*after* the init stage since it seems more correct that way (even if
it should make no difference).

> otherwise i think its ok if it passes fate

FATE seems to work here.
-- 
FFmpeg = Fostering Freak Meaningless Pitiless Elaborated Gospel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lavc-set-bit_rate-in-the-decoder-context-just-after-.patch
Type: text/x-diff
Size: 2526 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120218/1b2042a1/attachment.bin>


More information about the ffmpeg-devel mailing list