Commit 9f1eccb9 authored by Anton Khirnov's avatar Anton Khirnov

ff_parse_specific_params: do not use AVCodecContext.frame_size

It will not be set unless the muxing codec context is also the encoding
context, which is discouraged. When the frame size is not known from
av_get_audio_frame_duration(), the fallback should still be good enough.
parent 1f008f34
...@@ -212,12 +212,7 @@ void ff_parse_specific_params(AVStream *st, int *au_rate, ...@@ -212,12 +212,7 @@ void ff_parse_specific_params(AVStream *st, int *au_rate,
int gcd; int gcd;
int audio_frame_size; int audio_frame_size;
/* We use the known constant frame size for the codec if known, otherwise
* fall back on using AVCodecContext.frame_size, which is not as reliable
* for indicating packet duration. */
audio_frame_size = av_get_audio_frame_duration(codec, 0); audio_frame_size = av_get_audio_frame_duration(codec, 0);
if (!audio_frame_size)
audio_frame_size = codec->frame_size;
*au_ssize = codec->block_align; *au_ssize = codec->block_align;
if (audio_frame_size && codec->sample_rate) { if (audio_frame_size && codec->sample_rate) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment