From 3fdf25cc37797c52112c11b6f618523e3187b3c7 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Mon, 25 May 2020 01:49:00 +1000 Subject: [PATCH] tsdemux: Handle old streams claiming to be HDMV with Opus GStreamer 1.16 and earlier produced streams with HDMV registration id but with Opus audio streams on the stream ID that AC-4 now uses. Make sure those still play back by special casing the check for AC-4 in HDMV Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1295 Part-of: --- gst/mpegtsdemux/tsdemux.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gst/mpegtsdemux/tsdemux.c b/gst/mpegtsdemux/tsdemux.c index 7193367c16..74846d962d 100644 --- a/gst/mpegtsdemux/tsdemux.c +++ b/gst/mpegtsdemux/tsdemux.c @@ -1197,8 +1197,12 @@ create_pad_for_stream (MpegTSBase * base, MpegTSBaseStream * bstream, caps = gst_caps_new_empty_simple ("audio/x-eac3"); break; case ST_BD_AUDIO_AC4: - is_audio = TRUE; - caps = gst_caps_new_empty_simple ("audio/x-ac4"); + /* Opus also uses 0x06, and there are bad streams that have HDMV registration ID, + * but contain an Opus registration id, so check for it */ + if (bstream->registration_id != DRF_ID_OPUS) { + is_audio = TRUE; + caps = gst_caps_new_empty_simple ("audio/x-ac4"); + } break; case ST_BD_AUDIO_AC3_TRUE_HD: is_audio = TRUE;