Commit c3c22bee authored by Carl Eugen Hoyos's avatar Carl Eugen Hoyos

lavf/matroskaenc: Assume 48kHz sample rate for Opus initial padding.

Analyzed by Timothy B. Terriberry in Mozilla bug 1227153.
Fixes ticket #5121.
parent 5b4da8a3
...@@ -924,7 +924,7 @@ static int mkv_write_track(AVFormatContext *s, MatroskaMuxContext *mkv, ...@@ -924,7 +924,7 @@ static int mkv_write_track(AVFormatContext *s, MatroskaMuxContext *mkv,
if (codec->codec_type == AVMEDIA_TYPE_AUDIO && codec->initial_padding && codec->codec_id == AV_CODEC_ID_OPUS) { if (codec->codec_type == AVMEDIA_TYPE_AUDIO && codec->initial_padding && codec->codec_id == AV_CODEC_ID_OPUS) {
int64_t codecdelay = av_rescale_q(codec->initial_padding, int64_t codecdelay = av_rescale_q(codec->initial_padding,
(AVRational){ 1, codec->sample_rate }, (AVRational){ 1, 48000 },
(AVRational){ 1, 1000000000 }); (AVRational){ 1, 1000000000 });
if (codecdelay < 0) { if (codecdelay < 0) {
av_log(s, AV_LOG_ERROR, "Initial padding is invalid\n"); av_log(s, AV_LOG_ERROR, "Initial padding is invalid\n");
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#define LIBAVFORMAT_VERSION_MAJOR 57 #define LIBAVFORMAT_VERSION_MAJOR 57
#define LIBAVFORMAT_VERSION_MINOR 21 #define LIBAVFORMAT_VERSION_MINOR 21
#define LIBAVFORMAT_VERSION_MICRO 100 #define LIBAVFORMAT_VERSION_MICRO 101
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \ LIBAVFORMAT_VERSION_MINOR, \
......
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