summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWonchul Lee <wonchul.lee@collabora.com>2016-09-13 13:07:05 (GMT)
committerOlivier CrĂȘte <olivier.crete@collabora.com>2016-10-03 19:14:54 (GMT)
commit69b866326ea69afe348c274b3b84e135468a567f (patch)
tree0f74d45e2abeacb8f4d80a99eda5d9b5a222b040
parent5771e6a0666c06a0d527c4e8b9584b044cd291b9 (diff)
downloadgst-plugins-bad-69b866326ea69afe348c274b3b84e135468a567f.tar.gz
gst-plugins-bad-69b866326ea69afe348c274b3b84e135468a567f.tar.xz
tsdemux: Add conditions to identify ATSC EAC3
https://bugzilla.gnome.org/show_bug.cgi?id=770528
-rw-r--r--gst-libs/gst/mpegts/gstmpegtsdescriptor.h1
-rw-r--r--gst/mpegtsdemux/gstmpegdesc.h1
-rw-r--r--gst/mpegtsdemux/tsdemux.c14
3 files changed, 16 insertions, 0 deletions
diff --git a/gst-libs/gst/mpegts/gstmpegtsdescriptor.h b/gst-libs/gst/mpegts/gstmpegtsdescriptor.h
index 33d46f5..87c7343 100644
--- a/gst-libs/gst/mpegts/gstmpegtsdescriptor.h
+++ b/gst-libs/gst/mpegts/gstmpegtsdescriptor.h
@@ -174,6 +174,7 @@ typedef enum {
GST_MTS_DESC_ATSC_REDISTRIBUTION_CONTROL = 0xAA,
GST_MTS_DESC_ATSC_GENRE = 0xAB,
GST_MTS_DESC_ATSC_PRIVATE_INFORMATION = 0xAD,
+ GST_MTS_DESC_ATSC_EAC3 = 0xCC,
/* ATSC A/53:3 2009 */
GST_MTS_DESC_ATSC_ENHANCED_SIGNALING = 0xB2,
diff --git a/gst/mpegtsdemux/gstmpegdesc.h b/gst/mpegtsdemux/gstmpegdesc.h
index bd9235f..e4e6743 100644
--- a/gst/mpegtsdemux/gstmpegdesc.h
+++ b/gst/mpegtsdemux/gstmpegdesc.h
@@ -233,5 +233,6 @@
#define DRF_ID_HEVC 0x48455643
#define DRF_ID_KLVA 0x4b4c5641 /* defined in RP217 */
#define DRF_ID_OPUS 0x4f707573
+#define DRF_ID_EAC3 0x45414333 /* defined in A/52 Annex G */
#endif /* __GST_MPEG_DESC_H__ */
diff --git a/gst/mpegtsdemux/tsdemux.c b/gst/mpegtsdemux/tsdemux.c
index 0ac95bd..029a033 100644
--- a/gst/mpegtsdemux/tsdemux.c
+++ b/gst/mpegtsdemux/tsdemux.c
@@ -1507,10 +1507,24 @@ create_pad_for_stream (MpegTSBase * base, MpegTSBaseStream * bstream,
caps = gst_caps_new_empty_simple ("audio/x-ac3");
break;
case ST_PS_AUDIO_EAC3:
+ {
/* ATSC_ENHANCED_AC3 */
+ if (bstream->registration_id == DRF_ID_EAC3 ||
+ mpegts_get_descriptor_from_stream (bstream, GST_MTS_DESC_ATSC_EAC3)) {
+ is_audio = TRUE;
+ caps = gst_caps_new_empty_simple ("audio/x-eac3");
+ break;
+ }
+
+ GST_ELEMENT_WARNING (demux, STREAM, DEMUX,
+ ("Assuming ATSC E-AC3 audio stream."),
+ ("ATSC E-AC3 stream type found but no guarantee way found to "
+ "differentiate among other standards (DVB, ISDB and etc..)"));
+
is_audio = TRUE;
caps = gst_caps_new_empty_simple ("audio/x-eac3");
break;
+ }
case ST_PS_AUDIO_LPCM2:
is_audio = TRUE;
caps = gst_caps_new_empty_simple ("audio/x-private2-lpcm");