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

drwho drwho at infidigm.net
Fri Dec 14 16:57:33 EET 2018


Hello,

(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)

in loop after calling avcodec_decode_audio4()
qDebug() << frame->nb_samples << codecContext->frame_size;
output......
4608 0
4608 0
4608 0
4608 0

Is this behavior normal or am I doing something wrong?
The flac file was made with ffmpeg....
ffmpeg -i test.mp3 test.flac

(why I want to know the frame_size.....I'd like to setup my alsa period 
size = some multiple of frame_size.)

Jon


More information about the Libav-user mailing list