[Libav-user] does setting AVCodecContext.frame_size will always give constant size?

mrf mrfantastic at firemail.cc
Mon Aug 29 00:06:58 EEST 2022


while learning to implement audio playback I noticed some formats and
files will have different number of samples (frame_size or buffer_size)
than my audio subsystem (jack) current setting and after decoding
packets it will be annoying to keep track of remaining bits or if my
frame_size bigger than the audio file while sample_rate is not an issue.

the documentation of AVCodecContext.frame_size says:

> decoding: may be set by some decoders to indicate constant frame size

I don't get the statement, is it set automatically by Libav when opening
file and we should not change it manually?

or does it mean we can change it manually to our audio subsystem
frame_size for convenience & it will always give us the wanted constant

what happen to packet with frame < frame_size? does the rest of data

More information about the Libav-user mailing list