[Libav-user] frame_size in AVCodecContext is zero when decoding flac

drwho drwho at infidigm.net
Fri Dec 14 18:31:09 EET 2018

On 2018-12-14 10:47 a.m., Carl Eugen Hoyos wrote:
> 2018-12-14 15:57 GMT+01:00, drwho <drwho at infidigm.net>:
>> (using libavcodec.so.57.64.101)
>> It appears that the frame_size element in AVCodecContext is not
>> guaranteed to be none zero either before or after decoding of the first
>> frame.  (it is set before decoding the first frame for mp3)
> The frame size for mp3 is known, for flac it has to be determined.
> Are you using the flac parser in your code?
I'm not sure if I am using the flac parser.  I am using av_read_frame() 
and avcoder_decode_audio4() in a similar fashion to this example 
As a work around, if frame_size is still zero after a few frames are 
decoded, I look at nb_samples in the frame.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20181214/2c42ce63/attachment.html>

More information about the Libav-user mailing list