Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavformat/riffenc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/riffenc.c b/libavformat/riffenc.c
index 250cf41ae7..ceb27f272c 100644
--- a/libavformat/riffenc.c
+++ b/libavformat/riffenc.c
@@ -242,7 +242,12 @@ void ff_parse_specific_params(AVStream *st, int *au_rate,
int gcd;
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);
+ if (!audio_frame_size)
+ audio_frame_size = codec->frame_size;
*au_ssize = codec->block_align;
if (audio_frame_size && codec->sample_rate) {