[0.11] gst-plugins-ugly: dvddemux: tweak subtitle stream setup based on dvd language codes event

Sebastian Dröge slomo at kemper.freedesktop.org
Tue Jan 10 06:17:27 PST 2012


Module: gst-plugins-ugly
Branch: 0.11
Commit: cacc663b359b824bbceccd93599b6aa9364e10dd
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-ugly/commit/?id=cacc663b359b824bbceccd93599b6aa9364e10dd

Author: Mark Nauwelaerts <mark.nauwelaerts at collabora.co.uk>
Date:   Sun Jan 25 22:49:11 2009 +0100

dvddemux: tweak subtitle stream setup based on dvd language codes event

... to allow for non-continuous subtitle stream numbers.
The missing stream numbers tend to come up as subtitle streams anyway
(albeit not with an identified language tag).

---

 gst/mpegstream/gstdvddemux.c |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/gst/mpegstream/gstdvddemux.c b/gst/mpegstream/gstdvddemux.c
index 2c9d91d..bfed3e7 100644
--- a/gst/mpegstream/gstdvddemux.c
+++ b/gst/mpegstream/gstdvddemux.c
@@ -422,16 +422,22 @@ gst_dvd_demux_handle_dvd_event (GstDVDDemux * dvd_demux, GstEvent * event)
     }
 
     /* subtitle */
-    for (;;) {
-      t = g_strdup_printf ("subtitle-%d-language", num_substreams);
+    for (n = 0; n < GST_DVD_DEMUX_NUM_SUBPICTURE_STREAMS; n++) {
+      t = g_strdup_printf ("subtitle-%d-language", n);
       if (!gst_structure_get_value (structure, t)) {
         g_free (t);
-        break;
+        continue;
       }
       g_free (t);
-      CLASS (dvd_demux)->get_subpicture_stream (mpeg_demux,
-          num_substreams++, GST_DVD_DEMUX_SUBP_DVD, NULL);
+      num_substreams = n + 1;
     }
+
+    /* now we have a maximum,
+     * and can also fill empty slots in case of cranky DVD */
+    for (n = 0; n < num_substreams; n++)
+      CLASS (dvd_demux)->get_subpicture_stream (mpeg_demux,
+          n, GST_DVD_DEMUX_SUBP_DVD, NULL);
+
     GST_DEBUG_OBJECT (dvd_demux,
         "Created 1 video stream, %d audio streams and %d subpicture streams "
         "based on DVD lang codes event; now signalling no-more-pads",



More information about the gstreamer-commits mailing list