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

Analyzed by Timothy B. Terriberry in Mozilla bug 1227153.
Fixes ticket #5121.
This commit is contained in:
Carl Eugen Hoyos 2016-01-05 21:34:35 +01:00
parent 5b4da8a38a
commit c3c22bee63
2 changed files with 2 additions and 2 deletions

View File

@ -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) {
int64_t codecdelay = av_rescale_q(codec->initial_padding,
(AVRational){ 1, codec->sample_rate },
(AVRational){ 1, 48000 },
(AVRational){ 1, 1000000000 });
if (codecdelay < 0) {
av_log(s, AV_LOG_ERROR, "Initial padding is invalid\n");

View File

@ -31,7 +31,7 @@
#define LIBAVFORMAT_VERSION_MAJOR 57
#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, \
LIBAVFORMAT_VERSION_MINOR, \