summaryrefslogtreecommitdiff
path: root/gst/mpegdemux
diff options
context:
space:
mode:
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2012-10-12 14:50:34 +0200
committerMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2012-10-12 17:03:38 +0200
commitacc0530f33e67327593e557a74a7725a363158c0 (patch)
tree19827496a51e59ab779969c49da8fcf363f65659 /gst/mpegdemux
parent61849aad61d0377afe3081534520d140544f7e46 (diff)
downloadgstreamer-plugins-bad-acc0530f33e67327593e557a74a7725a363158c0.tar.gz
mpegdemux: handle new style dvd event
Diffstat (limited to 'gst/mpegdemux')
-rw-r--r--gst/mpegdemux/gstmpegdemux.c31
1 files changed, 24 insertions, 7 deletions
diff --git a/gst/mpegdemux/gstmpegdemux.c b/gst/mpegdemux/gstmpegdemux.c
index 78bbe05f9..0a4e841c4 100644
--- a/gst/mpegdemux/gstmpegdemux.c
+++ b/gst/mpegdemux/gstmpegdemux.c
@@ -713,28 +713,34 @@ gst_flups_demux_handle_dvd_event (GstFluPSDemux * demux, GstEvent * event)
if (!gst_structure_get_int (structure, cur_stream_name, &stream_format))
continue;
+ g_snprintf (cur_stream_name, 32, "audio-%d-stream", i);
+ if (!gst_structure_get_int (structure, cur_stream_name, &stream_id))
+ continue;
+ if (stream_id < 0 || stream_id >= MAX_DVD_AUDIO_STREAMS)
+ continue;
+
switch (stream_format) {
case 0x0:
/* AC3 */
- stream_id = 0x80 + i;
+ stream_id += 0x80;
temp = gst_flups_demux_get_stream (demux, stream_id, ST_PS_AUDIO_AC3);
break;
case 0x2:
case 0x3:
/* MPEG audio without and with extension stream are
* treated the same */
- stream_id = 0xC0 + i;
+ stream_id += 0xC0;
temp = gst_flups_demux_get_stream (demux, stream_id, ST_AUDIO_MPEG1);
break;
case 0x4:
/* LPCM */
- stream_id = 0xA0 + i;
+ stream_id += 0xA0;
temp =
gst_flups_demux_get_stream (demux, stream_id, ST_PS_AUDIO_LPCM);
break;
case 0x6:
/* DTS */
- stream_id = 0x88 + i;
+ stream_id += 0x88;
temp = gst_flups_demux_get_stream (demux, stream_id, ST_PS_AUDIO_DTS);
break;
case 0x7:
@@ -750,13 +756,24 @@ gst_flups_demux_handle_dvd_event (GstFluPSDemux * demux, GstEvent * event)
/* And subtitle streams */
for (i = 0; i < MAX_DVD_SUBPICTURE_STREAMS; i++) {
+ gint stream_id;
+
g_snprintf (cur_stream_name, 32, "subpicture-%d-format", i);
+ if (!gst_structure_get_int (structure, cur_stream_name, &stream_id))
+ continue;
- if (gst_structure_get_string (structure, cur_stream_name) == NULL)
- break;
+ g_snprintf (cur_stream_name, 32, "subpicture-%d-stream", i);
+ if (!gst_structure_get_int (structure, cur_stream_name, &stream_id))
+ continue;
+ if (stream_id < 0 || stream_id >= MAX_DVD_SUBPICTURE_STREAMS)
+ continue;
+
+ GST_DEBUG_OBJECT (demux, "Subpicture stream %d ID 0x%02x", i,
+ 0x20 + stream_id);
/* Retrieve the subpicture stream to force pad creation */
- temp = gst_flups_demux_get_stream (demux, 0x20 + i, ST_PS_DVD_SUBPICTURE);
+ temp = gst_flups_demux_get_stream (demux, 0x20 + stream_id,
+ ST_PS_DVD_SUBPICTURE);
}
GST_DEBUG_OBJECT (demux, "Created all pads from Language Codes event, "