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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1296>
This commit is contained in:
Jan Schmidt 2020-05-25 01:49:00 +10:00
parent 918ed75944
commit 3fdf25cc37

View file

@ -1197,8 +1197,12 @@ create_pad_for_stream (MpegTSBase * base, MpegTSBaseStream * bstream,
caps = gst_caps_new_empty_simple ("audio/x-eac3"); caps = gst_caps_new_empty_simple ("audio/x-eac3");
break; break;
case ST_BD_AUDIO_AC4: case ST_BD_AUDIO_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; is_audio = TRUE;
caps = gst_caps_new_empty_simple ("audio/x-ac4"); caps = gst_caps_new_empty_simple ("audio/x-ac4");
}
break; break;
case ST_BD_AUDIO_AC3_TRUE_HD: case ST_BD_AUDIO_AC3_TRUE_HD:
is_audio = TRUE; is_audio = TRUE;