On Thu, 11 Apr 2013 18:42:06 +0000, PaweÅ‚ Hajdan, Jr <[email protected]> wrote:
> commit 23fc4dd6e7e150ea163a867dfaee2062ade90b74
> Author: Stefano Sabatini <[email protected]>
> Date:   Mon Jul 30 15:24:30 2012 +0200
> 
>     lavc: add channels field to AVFrame
> 
>     This is required otherwise it is not always possible to guess the number
>     of channels from the layout, for example if the channel layout is
>     unknown.
> 
> commit 5085b46496f0df5f4f7259d03f21d3f814aa28e2
> Author: Stefano Sabatini <[email protected]>
> Date:   Wed Feb 6 01:40:38 2013 +0100
> 
>     lavc: change type of AVFrame.channels field from int64_t to int
> 
>     "channels" is an int in all the other places in the libraries, and the
>     av_frame_*_channels() accessors return and set an int, so this should not
>     implicate ABI breaks.
> 
> This makes it possible to compile Chromium against libav, fixing
> the following compile error:
> 
> media/filters/audio_file_reader.cc: In member function 'int
> media::AudioFileReader::Read(media::AudioBus*)':
> media/filters/audio_file_reader.cc:183:21: error: 'struct AVFrame' has
> no member named 'channels'
> media/filters/audio_file_reader.cc:188:52: error: 'struct AVFrame' has
> no member named 'channels'
> media/filters/ffmpeg_audio_decoder.cc: In member function 'void
> media::FFmpegAudioDecoder::RunDecodeLoop(const
> scoped_refptr<media::DecoderBuffer>&, bool)':
> media/filters/ffmpeg_audio_decoder.cc:401:22: error: 'struct AVFrame'
> has no member named 'channels'
> media/filters/ffmpeg_audio_decoder.cc:406:53: error: 'struct AVFrame'
> has no member named 'channels'
> 

Sorry, but this is a hack that only solves a small part of the larger problem.
As Justin already said, you do not need this field. You can either check
AVCodecContext.channels or
av_get_channel_layout_nb_samples(frame->channel_layout). Both should be equal to
the same number.

-- 
Anton Khirnov
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to