From: Wim T. <wt...@us...> - 2003-02-02 20:06:52
|
CVS Root: /cvsroot/gstreamer Module: gst-plugins Changes by: wtay Date: Sun Feb 02 2003 12:06:51 PST Log message: Fix refcounting on streaminfo caps. Modified files: gst/mpegstream : gstmpegparse.c Links: http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/mpegstream/gstmpegparse.c.diff?r1=1.34&r2=1.35 ====Begin Diffs==== Index: gstmpegparse.c =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/gst/mpegstream/gstmpegparse.c,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- gstmpegparse.c 2 Feb 2003 05:26:28 -0000 1.34 +++ gstmpegparse.c 2 Feb 2003 20:06:39 -0000 1.35 @@ -229,6 +229,7 @@ GstProps *props; GstPropsEntry *entry; gboolean mpeg2 = GST_MPEG_PACKETIZE_IS_MPEG2 (mpeg_parse->packetize); + GstCaps *caps; props = gst_props_empty_new (); @@ -238,13 +239,11 @@ entry = gst_props_entry_new ("bitrate", GST_PROPS_INT (mpeg_parse->mux_rate * 400)); gst_props_add_entry (props, (GstPropsEntry *) entry); - if (mpeg_parse->streaminfo) - gst_caps_unref (mpeg_parse->streaminfo); - - mpeg_parse->streaminfo = gst_caps_new ("mpeg_streaminfo", - "application/x-gst-streaminfo", - props); + caps = gst_caps_new ("mpeg_streaminfo", + "application/x-gst-streaminfo", + props); + gst_caps_replace_sink (&mpeg_parse->streaminfo, caps); g_object_notify (G_OBJECT (mpeg_parse), "streaminfo"); } @@ -413,6 +412,8 @@ GstClockTime time; data = gst_mpeg_packetize_read (mpeg_parse->packetize); + if (!data) + return; id = GST_MPEG_PACKETIZE_ID (mpeg_parse->packetize); mpeg2 = GST_MPEG_PACKETIZE_IS_MPEG2 (mpeg_parse->packetize); @@ -802,6 +803,7 @@ gst_mpeg_packetize_destroy (mpeg_parse->packetize); mpeg_parse->packetize = NULL; } + gst_caps_replace (&mpeg_parse->streaminfo, NULL); break; default: break; |