mpegdemux: handle new style dvd event

This commit is contained in:
Mark Nauwelaerts 2012-10-12 14:50:34 +02:00
parent 61849aad61
commit acc0530f33

View file

@ -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)) if (!gst_structure_get_int (structure, cur_stream_name, &stream_format))
continue; 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) { switch (stream_format) {
case 0x0: case 0x0:
/* AC3 */ /* AC3 */
stream_id = 0x80 + i; stream_id += 0x80;
temp = gst_flups_demux_get_stream (demux, stream_id, ST_PS_AUDIO_AC3); temp = gst_flups_demux_get_stream (demux, stream_id, ST_PS_AUDIO_AC3);
break; break;
case 0x2: case 0x2:
case 0x3: case 0x3:
/* MPEG audio without and with extension stream are /* MPEG audio without and with extension stream are
* treated the same */ * treated the same */
stream_id = 0xC0 + i; stream_id += 0xC0;
temp = gst_flups_demux_get_stream (demux, stream_id, ST_AUDIO_MPEG1); temp = gst_flups_demux_get_stream (demux, stream_id, ST_AUDIO_MPEG1);
break; break;
case 0x4: case 0x4:
/* LPCM */ /* LPCM */
stream_id = 0xA0 + i; stream_id += 0xA0;
temp = temp =
gst_flups_demux_get_stream (demux, stream_id, ST_PS_AUDIO_LPCM); gst_flups_demux_get_stream (demux, stream_id, ST_PS_AUDIO_LPCM);
break; break;
case 0x6: case 0x6:
/* DTS */ /* DTS */
stream_id = 0x88 + i; stream_id += 0x88;
temp = gst_flups_demux_get_stream (demux, stream_id, ST_PS_AUDIO_DTS); temp = gst_flups_demux_get_stream (demux, stream_id, ST_PS_AUDIO_DTS);
break; break;
case 0x7: case 0x7:
@ -750,13 +756,24 @@ gst_flups_demux_handle_dvd_event (GstFluPSDemux * demux, GstEvent * event)
/* And subtitle streams */ /* And subtitle streams */
for (i = 0; i < MAX_DVD_SUBPICTURE_STREAMS; i++) { for (i = 0; i < MAX_DVD_SUBPICTURE_STREAMS; i++) {
g_snprintf (cur_stream_name, 32, "subpicture-%d-format", i); gint stream_id;
if (gst_structure_get_string (structure, cur_stream_name) == NULL) g_snprintf (cur_stream_name, 32, "subpicture-%d-format", i);
break; if (!gst_structure_get_int (structure, cur_stream_name, &stream_id))
continue;
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 */ /* 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, " GST_DEBUG_OBJECT (demux, "Created all pads from Language Codes event, "