mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
ext/dvdread/dvdreadsrc.c: Don't announce audio or subtitle streams that aren't really present, it makes dvddemux crea...
Original commit message from CVS: * ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_goto_title): Don't announce audio or subtitle streams that aren't really present, it makes dvddemux create pads that will never carry any data, which is not good.
This commit is contained in:
parent
71735842de
commit
4e9ae61a9e
2 changed files with 26 additions and 2 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2006-10-13 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
|
* ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_goto_title):
|
||||||
|
Don't announce audio or subtitle streams that aren't really present,
|
||||||
|
it makes dvddemux create pads that will never carry any data, which
|
||||||
|
is not good.
|
||||||
|
|
||||||
2006-10-13 Tim-Philipp Müller <tim at centricular dot net>
|
2006-10-13 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
* ext/lame/gstlame.c: (gst_lame_set_property):
|
* ext/lame/gstlame.c: (gst_lame_set_property):
|
||||||
|
|
|
@ -432,8 +432,10 @@ gst_dvd_read_src_goto_title (GstDvdReadSrc * src, gint title, gint angle)
|
||||||
{
|
{
|
||||||
GstStructure *s;
|
GstStructure *s;
|
||||||
gchar lang_code[3] = { '\0', '\0', '\0' }, *t;
|
gchar lang_code[3] = { '\0', '\0', '\0' }, *t;
|
||||||
|
pgc_t *pgc0;
|
||||||
gint title_set_nr;
|
gint title_set_nr;
|
||||||
gint num_titles;
|
gint num_titles;
|
||||||
|
gint pgn0, pgc0_id;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
/* make sure our title number is valid */
|
/* make sure our title number is valid */
|
||||||
|
@ -489,9 +491,18 @@ gst_dvd_read_src_goto_title (GstDvdReadSrc * src, gint title, gint angle)
|
||||||
s = gst_structure_new ("application/x-gst-dvd",
|
s = gst_structure_new ("application/x-gst-dvd",
|
||||||
"event", G_TYPE_STRING, "dvd-lang-codes", NULL);
|
"event", G_TYPE_STRING, "dvd-lang-codes", NULL);
|
||||||
|
|
||||||
|
/* so we can filter out invalid/unused streams (same for all chapters) */
|
||||||
|
cur_title_get_chapter_pgc (src, 0, &pgn0, &pgc0_id, &pgc0);
|
||||||
|
|
||||||
/* audio */
|
/* audio */
|
||||||
for (i = 0; i < src->vts_file->vtsi_mat->nr_of_vts_audio_streams; i++) {
|
for (i = 0; i < src->vts_file->vtsi_mat->nr_of_vts_audio_streams; i++) {
|
||||||
const audio_attr_t *a = &src->vts_file->vtsi_mat->vts_audio_attr[i];
|
const audio_attr_t *a;
|
||||||
|
|
||||||
|
/* audio stream present? */
|
||||||
|
if (pgc0 != NULL && (pgc0->audio_control[i] & 0x8000) == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
a = &src->vts_file->vtsi_mat->vts_audio_attr[i];
|
||||||
|
|
||||||
t = g_strdup_printf ("audio-%d-format", i);
|
t = g_strdup_printf ("audio-%d-format", i);
|
||||||
gst_structure_set (s, t, G_TYPE_INT, (int) a->audio_format, NULL);
|
gst_structure_set (s, t, G_TYPE_INT, (int) a->audio_format, NULL);
|
||||||
|
@ -513,7 +524,13 @@ gst_dvd_read_src_goto_title (GstDvdReadSrc * src, gint title, gint angle)
|
||||||
|
|
||||||
/* subtitle */
|
/* subtitle */
|
||||||
for (i = 0; i < src->vts_file->vtsi_mat->nr_of_vts_subp_streams; i++) {
|
for (i = 0; i < src->vts_file->vtsi_mat->nr_of_vts_subp_streams; i++) {
|
||||||
const subp_attr_t *u = &src->vts_file->vtsi_mat->vts_subp_attr[i];
|
const subp_attr_t *u;
|
||||||
|
|
||||||
|
/* subpicture stream present? */
|
||||||
|
if (pgc0 != NULL && (pgc0->subp_control[i] & 0x80000000) == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
u = &src->vts_file->vtsi_mat->vts_subp_attr[i];
|
||||||
|
|
||||||
if (u->type) {
|
if (u->type) {
|
||||||
t = g_strdup_printf ("subtitle-%d-language", i);
|
t = g_strdup_printf ("subtitle-%d-language", i);
|
||||||
|
|
Loading…
Reference in a new issue