resindvd: Create all the audio streams of all formats

Enable creation of the demuxer pads for all audio streams, even types we
don't yet support. This means that unsupported types (LPCM, DTS) are output,
but not linked to anything yet. If only unsupported streams are available,
the user hears silence instead of having the pipeline not pre-roll correctly.

This is a prerequisite for hooking up the automatic decoder switching.
This commit is contained in:
Jan Schmidt 2009-05-27 22:54:51 +01:00
parent af89b6de1c
commit 4d5a48db97
4 changed files with 20 additions and 10 deletions

View file

@ -356,7 +356,7 @@ gst_flups_demux_get_stream (GstFluPSDemux * demux, gint id, gint type)
{
GstFluPSStream *stream = demux->streams[id];
if (stream == NULL) {
if (stream == NULL && !demux->disable_stream_creation) {
if (!(stream = gst_flups_demux_create_stream (demux, id, type)))
goto unknown_stream;
@ -612,6 +612,8 @@ gst_flups_demux_handle_dvd_event (GstFluPSDemux * demux, GstEvent * event)
GST_DEBUG_OBJECT (demux, "Handling language codes event");
demux->disable_stream_creation = FALSE;
/* Create a video pad to ensure it exists before emitting no more pads */
temp = gst_flups_demux_get_stream (demux, 0xe0, ST_VIDEO_MPEG2);
/* Send a video format event downstream */
@ -719,6 +721,8 @@ gst_flups_demux_handle_dvd_event (GstFluPSDemux * demux, GstEvent * event)
ST_PS_DVD_SUBPICTURE);
}
demux->disable_stream_creation = TRUE;
GST_DEBUG_OBJECT (demux, "Created all pads from Language Codes event, "
"signalling no-more-pads");
@ -767,32 +771,33 @@ gst_flups_demux_handle_dvd_event (GstFluPSDemux * demux, GstEvent * event)
stream_id += 0x80;
temp = demux->streams[stream_id];
break;
#if 0 /* FIXME: Ignore non AC-3 requests until the decoder bin can handle them */
case 0x2:
case 0x3:
/* MPEG audio without and with extension stream are
* treated the same */
stream_id = 0xC0 + i;
stream_id += 0xC0;
temp = demux->streams[stream_id];
break;
case 0x4:
/* LPCM */
stream_id = 0xA0 + i;
stream_id += 0xA0;
temp = demux->streams[stream_id];
break;
case 0x6:
/* DTS */
stream_id = 0x88 + i;
stream_id += 0x88;
temp = demux->streams[stream_id];
break;
case 0x7:
/* FIXME: What range is SDDS? */
temp = NULL;
break;
#endif
default:
temp = NULL;
break;
}
GST_INFO_OBJECT (demux, "Have DVD audio stream select event: "
"stream 0x%02x", stream_id);
if (temp != NULL && temp->pad != NULL) {
/* Send event to the selector to activate the desired pad */
GstStructure *s = gst_structure_new ("application/x-gst-dvd",

View file

@ -106,6 +106,7 @@ struct _GstFluPSDemux {
/* Indicates an MPEG-2 stream */
gboolean is_mpeg2_pack;
gboolean disable_stream_creation;
/* Language codes event is stored when a dvd-lang-codes
* custom event arrives from upstream */

View file

@ -1882,7 +1882,7 @@ rsn_dvdsrc_prepare_streamsinfo_event (resinDvdSrc * src)
GST_DEBUG_OBJECT (src, "mapped logical audio %d to MPEG substream %d",
i, phys_id);
#if 1
#if 0
/* FIXME: Only output A52 streams for now, until the decoder switching
* is ready */
if (a->audio_format != 0) {
@ -1891,7 +1891,8 @@ rsn_dvdsrc_prepare_streamsinfo_event (resinDvdSrc * src)
continue;
}
#endif
have_audio = TRUE;
if (a->audio_format == 0)
have_audio = TRUE;
GST_DEBUG_OBJECT (src, "Audio stream %d is format %d, substream %d", i,
(int) a->audio_format, phys_id);
@ -1917,7 +1918,7 @@ rsn_dvdsrc_prepare_streamsinfo_event (resinDvdSrc * src)
}
if (have_audio == FALSE) {
/* Always create at least one audio stream */
/* Always create at least one audio stream of the required type */
gst_structure_set (s, "audio-0-format", G_TYPE_INT, (int) 0,
"audio-0-stream", G_TYPE_INT, (int) 0, NULL);
}

View file

@ -200,10 +200,13 @@ rsn_audiomunge_make_audio (RsnAudioMunge * munge,
guint buf_size;
/* Just generate a 48khz stereo buffer for now */
/* FIXME: Adapt to the allowed formats, according to the currently
* plugged decoder, or at least add a source pad that accepts the
* caps we're outputting if the upstream decoder does not */
#if 0
caps =
gst_caps_from_string
("audio/x-raw-int,rate=48000,channels=2,width=16,depth=16,signed=(boolean)true,endianness=1234");
("audio/x-raw-int,rate=48000,channels=2,width=16,depth=16,signed=(boolean)true,endianness=4321");
buf_size = 4 * (48000 * fill_time / GST_SECOND);
#else
caps = gst_caps_from_string ("audio/x-raw-float, endianness=(int)1234,"