slomo gst-plugins-ugly: gst-plugins-ugly/ gst-plugins-ugly/gst/mpegstream/

[email protected] Thu, 8 Jan 2009 00:19:41 -0800 (PST)
Newsgroups gmane.comp.video.gstreamer.cvs
Message-ID <[email protected]>
--===============0189034349446916684==

CVS Root:       /cvs/gstreamer
Module:         gst-plugins-ugly
Changes by:     slomo
Date:           Thu Jan 08 2009  08:19:41 UTC

Log message:
Patch by: Yves Lefebvre <ivanohe at abacom dot com>
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_get_video_stream),
(gst_dvd_demux_get_audio_stream),
(gst_dvd_demux_get_subpicture_stream), (gst_dvd_demux_reset):
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_init_stream),
(gst_mpeg_demux_get_video_stream),
(gst_mpeg_demux_get_audio_stream), (gst_mpeg_demux_reset):
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_chain):
Fix some caps leaks. Fixes bug #564885.

Modified files:
    .               : ChangeLog
    gst/mpegstream  : gstdvddemux.c gstmpegdemux.c gstmpegparse.c

Links:
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-ugly/ChangeLog.diff?r1=1.2446&r2=1.2447
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-ugly/gst/mpegstream/gstdvddemux.c.diff?r1=1.44&r2=1.45
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-ugly/gst/mpegstream/gstmpegdemux.c.diff?r1=1.100&r2=1.101
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-ugly/gst/mpegstream/gstmpegparse.c.diff?r1=1.102&r2=1.103

====Begin Diffs====
Index: ChangeLog
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-ugly/ChangeLog,v
retrieving revision 1.2446
retrieving revision 1.2447
diff -u -d -r1.2446 -r1.2447
--- ChangeLog	2 Jan 2009 00:43:52 -0000	1.2446
+++ ChangeLog	8 Jan 2009 08:19:16 -0000	1.2447
@@ -1,3 +1,16 @@
+2009-01-08  Sebastian Dröge  <[email protected]>
+
+	Patch by: Yves Lefebvre <ivanohe at abacom dot com>
+	* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_get_video_stream),
+	(gst_dvd_demux_get_audio_stream),
+	(gst_dvd_demux_get_subpicture_stream), (gst_dvd_demux_reset):
+	* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_init_stream),
+	(gst_mpeg_demux_get_video_stream),
+	(gst_mpeg_demux_get_audio_stream), (gst_mpeg_demux_reset):
+	* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_chain):
+	Fix some caps leaks. Fixes bug #564885.
 2009-01-02  Alessandro Decina  <[email protected]>
 
 	* ext/cdio/gstcdio.c:
Index: gstdvddemux.c
RCS file: /cvs/gstreamer/gst-plugins-ugly/gst/mpegstream/gstdvddemux.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- gstdvddemux.c	3 Nov 2008 11:31:49 -0000	1.44
+++ gstdvddemux.c	8 Jan 2009 08:19:22 -0000	1.45
@@ -474,6 +474,8 @@
   gint mpeg_version = *((gint *) info);
   if (dvd_demux->mpeg_version != mpeg_version) {
+    if (str->caps)
+      gst_caps_unref (str->caps);
     str->caps = gst_caps_new_simple ("video/mpeg",
         "mpegversion", G_TYPE_INT, mpeg_version,
         "systemstream", G_TYPE_BOOLEAN, FALSE, NULL);
@@ -593,6 +595,8 @@
         /* Determine the number of channels. */
         channels = ((sample_info >> 8) & 0x7) + 1;
+        if (str->caps)
+          gst_caps_unref (str->caps);
         str->caps = gst_caps_new_simple ("audio/x-lpcm",
             "width", G_TYPE_INT, width,
             "rate", G_TYPE_INT, rate,
@@ -612,11 +616,15 @@
         break;
       case GST_DVD_DEMUX_AUDIO_AC3:
         str->caps = gst_caps_new_simple ("audio/x-ac3", NULL);
         codec = "AC-3 audio";
       case GST_DVD_DEMUX_AUDIO_DTS:
         str->caps = gst_caps_new_simple ("audio/x-dts", NULL);
         codec = "DTS audio";
@@ -650,8 +658,8 @@
         t = g_strdup_printf ("audio-%d-language", stream_nr);
         lang_code =
-            gst_structure_get_string (gst_event_get_structure (dvd_demux->
-                langcodes), t);
+            gst_structure_get_string (gst_event_get_structure
+            (dvd_demux->langcodes), t);
         g_free (t);
       }
@@ -720,6 +728,8 @@
   if (str->type != GST_DVD_DEMUX_SUBP_DVD) {
     /* We need to set new caps for this pad. */
     str->caps = gst_caps_new_simple ("video/x-dvd-subpicture", NULL);
     if (!gst_pad_set_caps (str->pad, str->caps)) {
@@ -746,8 +756,8 @@
         t = g_strdup_printf ("subtitle-%d-language", stream_nr);
@@ -1164,6 +1174,8 @@
       gst_element_remove_pad (GST_ELEMENT (dvd_demux),
           dvd_demux->subpicture_stream[i]->pad);
+      if (dvd_demux->subpicture_stream[i]->caps)
+        gst_caps_unref (dvd_demux->subpicture_stream[i]->caps);
       if (dvd_demux->subpicture_stream[i]->tags)
         gst_tag_list_free (dvd_demux->subpicture_stream[i]->tags);
       g_free (dvd_demux->subpicture_stream[i]);
Index: gstmpegdemux.c
RCS file: /cvs/gstreamer/gst-plugins-ugly/gst/mpegstream/gstmpegdemux.c,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -d -r1.100 -r1.101
--- gstmpegdemux.c	3 Nov 2008 11:31:49 -0000	1.100
+++ gstmpegdemux.c	8 Jan 2009 08:19:23 -0000	1.101
@@ -331,6 +331,7 @@
   str->last_flow = GST_FLOW_OK;
   str->buffers_sent = 0;
   str->tags = NULL;
+  str->caps = NULL;
 }
 static GstMPEGStream *
@@ -373,6 +374,8 @@
     GstTagList *list;
@@ -445,6 +448,8 @@
     str->caps = gst_caps_new_simple ("audio/mpeg",
         "mpegversion", G_TYPE_INT, 1, NULL);
@@ -1334,6 +1339,8 @@
           gst_event_new_eos ());
       gst_element_remove_pad (GST_ELEMENT (mpeg_demux),
           mpeg_demux->video_stream[i]->pad);
+      if (mpeg_demux->video_stream[i]->caps)
+        gst_caps_unref (mpeg_demux->video_stream[i]->caps);
       g_free (mpeg_demux->video_stream[i]);
       mpeg_demux->video_stream[i] = NULL;
     }
@@ -1345,6 +1352,8 @@
           mpeg_demux->audio_stream[i]->pad);
       if (mpeg_demux->audio_stream[i]->tags)
         gst_tag_list_free (mpeg_demux->audio_stream[i]->tags);
+      if (mpeg_demux->audio_stream[i]->caps)
+        gst_caps_unref (mpeg_demux->audio_stream[i]->caps);
       g_free (mpeg_demux->audio_stream[i]);
       mpeg_demux->audio_stream[i] = NULL;
@@ -1354,6 +1363,8 @@
           mpeg_demux->private_stream[i]->pad);
+      if (mpeg_demux->private_stream[i]->caps)
+        gst_caps_unref (mpeg_demux->private_stream[i]->caps);
       g_free (mpeg_demux->private_stream[i]);
       mpeg_demux->private_stream[i] = NULL;
Index: gstmpegparse.c
RCS file: /cvs/gstreamer/gst-plugins-ugly/gst/mpegstream/gstmpegparse.c,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -d -r1.102 -r1.103
--- gstmpegparse.c	27 Jun 2008 12:58:35 -0000	1.102
+++ gstmpegparse.c	8 Jan 2009 08:19:25 -0000	1.103
@@ -782,17 +782,18 @@
     /* Make sure the output pad has proper capabilities. */
     if (!GST_PAD_CAPS (mpeg_parse->sinkpad)) {
       gboolean mpeg2 = GST_MPEG_PACKETIZE_IS_MPEG2 (mpeg_parse->packetize);
-
-      if (!gst_pad_set_caps (mpeg_parse->sinkpad,
-              gst_caps_new_simple ("video/mpeg",
-                  "mpegversion", G_TYPE_INT, (mpeg2 ? 2 : 1),
-                  "systemstream", G_TYPE_BOOLEAN, TRUE,
-                  "parsed", G_TYPE_BOOLEAN, TRUE, NULL)) < 0) {
+      GstCaps *caps = gst_caps_new_simple ("video/mpeg",
+          "mpegversion", G_TYPE_INT, (mpeg2 ? 2 : 1),
+          "systemstream", G_TYPE_BOOLEAN, TRUE,
+          "parsed", G_TYPE_BOOLEAN, TRUE, NULL);
+      if (!gst_pad_set_caps (mpeg_parse->sinkpad, caps) < 0) {
         GST_ELEMENT_ERROR (mpeg_parse, CORE, NEGOTIATION, (NULL), (NULL));
         gst_buffer_unref (buffer);
         result = GST_FLOW_ERROR;
+        gst_caps_unref (caps);
+      gst_caps_unref (caps);
     /* Send the buffer. */


--===============0189034349446916684==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
--===============0189034349446916684==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
gstreamer-cvs-verbose mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gstreamer-cvs-verbose

--===============0189034349446916684==--