[FFmpeg-cvslog] avformat/mpegts: add missing sample_rate value to Opus extradata

James Almer git at videolan.org
Mon May 3 02:56:57 EEST 2021


ffmpeg | branch: release/4.4 | James Almer <jamrial at gmail.com> | Thu Apr 15 10:03:05 2021 -0300| [75c39692923a203b04efe7ee46d767f0057eac3b] | committer: James Almer

avformat/mpegts: add missing sample_rate value to Opus extradata

Finishes fixing ticket #9190.

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=75c39692923a203b04efe7ee46d767f0057eac3b
---

 libavformat/mpegts.c         | 1 +
 tests/ref/fate/ts-opus-demux | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 6e0d9d7496..2c3b9be434 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -2026,6 +2026,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
                     return AVERROR_INVALIDDATA;
                 if (channel_config_code <= 0x8) {
                     st->codecpar->extradata[9]  = channels = channel_config_code ? channel_config_code : 2;
+                    AV_WL32(&st->codecpar->extradata[12], 48000);
                     st->codecpar->extradata[18] = channel_config_code ? (channels > 2) : /* Dual Mono */ 255;
                     st->codecpar->extradata[19] = opus_stream_cnt[channel_config_code];
                     st->codecpar->extradata[20] = opus_coupled_stream_cnt[channel_config_code];
diff --git a/tests/ref/fate/ts-opus-demux b/tests/ref/fate/ts-opus-demux
index 3c5edffb2c..37534350a1 100644
--- a/tests/ref/fate/ts-opus-demux
+++ b/tests/ref/fate/ts-opus-demux
@@ -1,4 +1,4 @@
-#extradata 0:       30, 0x53be0347
+#extradata 0:       30, 0x69290482
 #tb 0: 1/90000
 #media_type 0: audio
 #codec_id 0: opus



More information about the ffmpeg-cvslog mailing list