diff --git a/gst/mpegtsdemux/tsdemux.c b/gst/mpegtsdemux/tsdemux.c index 0c1542fb3b..ed78fd1e4a 100644 --- a/gst/mpegtsdemux/tsdemux.c +++ b/gst/mpegtsdemux/tsdemux.c @@ -157,6 +157,9 @@ struct _TSDemuxStream /* List of pending buffers */ GList *pending; + + /* if != 0, output only PES from that substream */ + guint8 target_pes_substream; }; #define VIDEO_CAPS \ @@ -814,6 +817,7 @@ create_pad_for_stream (MpegTSBase * base, MpegTSBaseStream * bstream, break; } case ST_BD_AUDIO_EAC3: + case ST_BD_AUDIO_AC3_PLUS: template = gst_static_pad_template_get (&audio_template); name = g_strdup_printf ("audio_%04x", bstream->pid); caps = gst_caps_new_empty_simple ("audio/x-eac3"); @@ -822,6 +826,7 @@ create_pad_for_stream (MpegTSBase * base, MpegTSBaseStream * bstream, template = gst_static_pad_template_get (&audio_template); name = g_strdup_printf ("audio_%04x", bstream->pid); caps = gst_caps_new_empty_simple ("audio/x-true-hd"); + stream->target_pes_substream = 0x72; break; case ST_BD_AUDIO_LPCM: template = gst_static_pad_template_get (&audio_template); @@ -833,6 +838,13 @@ create_pad_for_stream (MpegTSBase * base, MpegTSBaseStream * bstream, name = g_strdup_printf ("subpicture_%04x", bstream->pid); caps = gst_caps_new_empty_simple ("subpicture/x-pgs"); break; + case ST_BD_AUDIO_DTS_HD: + case ST_BD_AUDIO_DTS_HD_MASTER_AUDIO: + template = gst_static_pad_template_get (&audio_template); + name = g_strdup_printf ("audio_%04x", bstream->pid); + caps = gst_caps_new_empty_simple ("audio/x-dts"); + stream->target_pes_substream = 0x71; + break; } } if (template && name && caps) @@ -1488,6 +1500,12 @@ gst_ts_demux_parse_pes_header (GstTSDemux * demux, TSDemuxStream * stream, goto discont; } + if (stream->target_pes_substream != 0 + && header.stream_id_extension != stream->target_pes_substream) { + GST_DEBUG ("Skipping unwanted substream"); + goto discont; + } + gst_ts_demux_record_dts (demux, stream, header.DTS, bufferoffset); gst_ts_demux_record_pts (demux, stream, header.PTS, bufferoffset); if (G_UNLIKELY (stream->pending_ts &&