From d678d7136c3d3d8ae0a8ed9d55648ff78c932f6d Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Thu, 14 Apr 2022 08:23:51 +0200 Subject: [PATCH] tsdemux: Fix AC-4 detection This regression was introduced by https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1102 and has been present since 1.18 * Stream Type 0x06 is defined in the base mpeg-ts specification as Private PES Packets. Determining the content should be solely based on descriptors found within the PMT. * This was abused in that commit by defining a "bluray-only" stream type for AC4 : `ST_BD_AUDIO_AC4` * This should be entirely handled in the regular private pes handling further down in the code Fixes #1154 Part-of: --- subprojects/gst-plugins-bad/gst/mpegtsdemux/gstmpegdefs.h | 1 - subprojects/gst-plugins-bad/gst/mpegtsdemux/tsdemux.c | 8 -------- 2 files changed, 9 deletions(-) diff --git a/subprojects/gst-plugins-bad/gst/mpegtsdemux/gstmpegdefs.h b/subprojects/gst-plugins-bad/gst/mpegtsdemux/gstmpegdefs.h index c0debcd7de..f88f586223 100644 --- a/subprojects/gst-plugins-bad/gst/mpegtsdemux/gstmpegdefs.h +++ b/subprojects/gst-plugins-bad/gst/mpegtsdemux/gstmpegdefs.h @@ -56,7 +56,6 @@ #define ST_PS_DVD_SUBPICTURE 0xff /* Blu-ray related (registration: 'HDMV'*/ -#define ST_BD_AUDIO_AC4 0x06 #define ST_BD_AUDIO_LPCM 0x80 #define ST_BD_AUDIO_AC3 0x81 #define ST_BD_AUDIO_DTS 0x82 diff --git a/subprojects/gst-plugins-bad/gst/mpegtsdemux/tsdemux.c b/subprojects/gst-plugins-bad/gst/mpegtsdemux/tsdemux.c index 5381518abb..6408c9becc 100644 --- a/subprojects/gst-plugins-bad/gst/mpegtsdemux/tsdemux.c +++ b/subprojects/gst-plugins-bad/gst/mpegtsdemux/tsdemux.c @@ -1382,14 +1382,6 @@ create_pad_for_stream (MpegTSBase * base, MpegTSBaseStream * bstream, is_audio = TRUE; caps = gst_caps_new_empty_simple ("audio/x-eac3"); break; - 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; - caps = gst_caps_new_empty_simple ("audio/x-ac4"); - } - break; case ST_BD_AUDIO_AC3_TRUE_HD: is_audio = TRUE; caps = gst_caps_new_empty_simple ("audio/x-true-hd");