bilboed gst-plugins-good: gst-plugins-good/ gst-plugins-good/ext/flac/ gst-plugins-good/gst/law/ gst-plugins-good/gst/udp/ gst-plugins-good/gst/wavparse/

[email protected] Sat, 13 Dec 2008 07:34:15 -0800 (PST)
Newsgroups gmane.comp.video.gstreamer.cvs
Message-ID <[email protected]>
CVS Root:       /cvs/gstreamer
Module:         gst-plugins-good
Changes by:     bilboed
Date:           Sat Dec 13 2008  15:34:15 UTC

Log message:
* ext/flac/gstflacdec.c: (gst_flac_dec_base_init),
(gst_flac_dec_init):
* gst/law/alaw-decode.c: (gst_alaw_dec_base_init),
(gst_alaw_dec_init):
* gst/law/alaw-encode.c: (gst_alaw_enc_base_init),
(gst_alaw_enc_init):
* gst/law/alaw.c: (plugin_init):
* gst/law/mulaw-decode.c: (gst_mulawdec_base_init),
(gst_mulawdec_init):
* gst/law/mulaw-encode.c: (gst_mulawenc_base_init),
(gst_mulawenc_init):
* gst/law/mulaw.c: (plugin_init):
Switch to using GstStaticPadTemplate.
* gst/udp/gstudpnetutils.c: (gst_udp_get_addr):
Don't forget to free the addrinfo structure.
* gst/wavparse/gstwavparse.c: (gst_wavparse_reset),
(gst_wavparse_sink_activate):
Don't forget to unref the GstAdapter.

Modified files:
    .               : ChangeLog
    ext/flac        : gstflacdec.c
    gst/law         : alaw-decode.c alaw-encode.c alaw.c
                      mulaw-decode.c mulaw-encode.c mulaw.c
    gst/udp         : gstudpnetutils.c
    gst/wavparse    : gstwavparse.c

Links:
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/ChangeLog.diff?r1=1.3861&r2=1.3862
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/ext/flac/gstflacdec.c.diff?r1=1.98&r2=1.99
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/law/alaw-decode.c.diff?r1=1.31&r2=1.32
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/law/alaw-encode.c.diff?r1=1.34&r2=1.35
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/law/alaw.c.diff?r1=1.20&r2=1.21
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/law/mulaw-decode.c.diff?r1=1.33&r2=1.34
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/law/mulaw-encode.c.diff?r1=1.30&r2=1.31
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/law/mulaw.c.diff?r1=1.21&r2=1.22
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/udp/gstudpnetutils.c.diff?r1=1.8&r2=1.9
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/wavparse/gstwavparse.c.diff?r1=1.166&r2=1.167

====Begin Diffs====
Index: ChangeLog
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-good/ChangeLog,v
retrieving revision 1.3861
retrieving revision 1.3862
diff -u -d -r1.3861 -r1.3862
--- ChangeLog	13 Dec 2008 12:58:22 -0000	1.3861
+++ ChangeLog	13 Dec 2008 15:33:58 -0000	1.3862
@@ -1,5 +1,26 @@
 2008-12-13  Edward Hervey  <[email protected]>
 
+	* ext/flac/gstflacdec.c: (gst_flac_dec_base_init),
+	(gst_flac_dec_init):
+	* gst/law/alaw-decode.c: (gst_alaw_dec_base_init),
+	(gst_alaw_dec_init):
+	* gst/law/alaw-encode.c: (gst_alaw_enc_base_init),
+	(gst_alaw_enc_init):
+	* gst/law/alaw.c: (plugin_init):
+	* gst/law/mulaw-decode.c: (gst_mulawdec_base_init),
+	(gst_mulawdec_init):
+	* gst/law/mulaw-encode.c: (gst_mulawenc_base_init),
+	(gst_mulawenc_init):
+	* gst/law/mulaw.c: (plugin_init):
+	Switch to using GstStaticPadTemplate.
+	* gst/udp/gstudpnetutils.c: (gst_udp_get_addr):
+	Don't forget to free the addrinfo structure.
+	* gst/wavparse/gstwavparse.c: (gst_wavparse_reset),
+	(gst_wavparse_sink_activate):
+	Don't forget to unref the GstAdapter.
+
+2008-12-13  Edward Hervey  <[email protected]>
 	* m4/Makefile.am:
 	inttypes.m4 hasn't been available since gettext-0.15, and since we now
 	require gettext >= 0.17 ... we can remove it from the list of files to
Index: gstflacdec.c
RCS file: /cvs/gstreamer/gst-plugins-good/ext/flac/gstflacdec.c,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -d -r1.98 -r1.99
--- gstflacdec.c	10 Oct 2008 12:28:33 -0000	1.98
+++ gstflacdec.c	13 Dec 2008 15:33:59 -0000	1.99
@@ -103,8 +103,6 @@
 GST_DEBUG_CATEGORY_STATIC (flacdec_debug);
 #define GST_CAT_DEFAULT flacdec_debug
-static GstPadTemplate *src_template, *sink_template;
-
 static void gst_flac_dec_finalize (GObject * object);
 static void gst_flac_dec_loop (GstPad * pad);
@@ -209,6 +207,12 @@
 /* FIXME 0.11: Use width=32 for all depths and let audioconvert
  * handle the conversions instead of doing it ourself.
  */
+static const GstElementDetails vorbis_dec_details =
+GST_ELEMENT_DETAILS ("Vorbis audio decoder",
+    "Codec/Decoder/Audio",
+    "decode raw vorbis streams to float audio",
+    "Benjamin Otte <[email protected]>");
 #define GST_FLAC_DEC_SRC_CAPS                             \
     "audio/x-raw-int, "                                   \
     "endianness = (int) BYTE_ORDER, "                     \
@@ -217,22 +221,28 @@
     "depth = (int) [ 4, 32 ], "                           \
     "rate = (int) [ 1, 655350 ], "                        \
     "channels = (int) [ 1, 8 ]"
+static GstStaticPadTemplate flac_dec_src_factory =
+GST_STATIC_PAD_TEMPLATE ("src",
+    GST_PAD_SRC,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS (GST_FLAC_DEC_SRC_CAPS));
+static GstStaticPadTemplate flac_dec_sink_factory =
+GST_STATIC_PAD_TEMPLATE ("sink",
+    GST_PAD_SINK,
+    GST_STATIC_CAPS ("audio/x-flac")
+    );
 static void
 gst_flac_dec_base_init (gpointer g_class)
 {
   GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
-  GstCaps *raw_caps, *flac_caps;
-  raw_caps = gst_caps_from_string (GST_FLAC_DEC_SRC_CAPS);
-  flac_caps = gst_caps_new_simple ("audio/x-flac", NULL);
-  sink_template = gst_pad_template_new ("sink", GST_PAD_SINK,
-      GST_PAD_ALWAYS, flac_caps);
-  src_template = gst_pad_template_new ("src", GST_PAD_SRC,
-      GST_PAD_ALWAYS, raw_caps);
-  gst_element_class_add_pad_template (element_class, sink_template);
-  gst_element_class_add_pad_template (element_class, src_template);
+  gst_element_class_add_pad_template (element_class,
+      gst_static_pad_template_get (&flac_dec_src_factory));
+      gst_static_pad_template_get (&flac_dec_sink_factory));
   gst_element_class_set_details_simple (element_class, "FLAC audio decoder",
       "Codec/Decoder/Audio",
       "Decodes FLAC lossless audio streams", "Wim Taymans <[email protected]>");
@@ -259,7 +269,8 @@
 gst_flac_dec_init (GstFlacDec * flacdec, GstFlacDecClass * klass)
-  flacdec->sinkpad = gst_pad_new_from_template (sink_template, "sink");
+  flacdec->sinkpad =
+      gst_pad_new_from_static_template (&flac_dec_sink_factory, "sink");
   gst_pad_set_activate_function (flacdec->sinkpad,
       GST_DEBUG_FUNCPTR (gst_flac_dec_sink_activate));
   gst_pad_set_activatepull_function (flacdec->sinkpad,
@@ -276,7 +287,8 @@
       GST_DEBUG_FUNCPTR (gst_flac_dec_chain));
   gst_element_add_pad (GST_ELEMENT (flacdec), flacdec->sinkpad);
-  flacdec->srcpad = gst_pad_new_from_template (src_template, "src");
+  flacdec->srcpad =
+      gst_pad_new_from_static_template (&flac_dec_src_factory, "src");
   gst_pad_set_query_type_function (flacdec->srcpad,
       GST_DEBUG_FUNCPTR (gst_flac_dec_get_src_query_types));
   gst_pad_set_query_function (flacdec->srcpad,
Index: alaw-decode.c
RCS file: /cvs/gstreamer/gst-plugins-good/gst/law/alaw-decode.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- alaw-decode.c	1 Apr 2008 11:00:43 -0000	1.31
+++ alaw-decode.c	13 Dec 2008 15:34:00 -0000	1.32
@@ -23,8 +23,8 @@
 #include "alaw-decode.h"
-extern GstPadTemplate *alawdec_src_template;
-extern GstPadTemplate *alawdec_sink_template;
+extern GstStaticPadTemplate alaw_dec_src_factory;
+extern GstStaticPadTemplate alaw_dec_sink_factory;
 GST_DEBUG_CATEGORY_STATIC (alaw_dec_debug);
 #define GST_CAT_DEFAULT alaw_dec_debug
@@ -145,8 +145,10 @@
   GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
-  gst_element_class_add_pad_template (element_class, alawdec_src_template);
-  gst_element_class_add_pad_template (element_class, alawdec_sink_template);
+      gst_static_pad_template_get (&alaw_dec_src_factory));
+      gst_static_pad_template_get (&alaw_dec_sink_factory));
   gst_element_class_set_details_simple (element_class, "A Law audio decoder",
       "Codec/Decoder/Audio", "Convert 8bit A law to 16bit PCM",
@@ -166,14 +168,16 @@
 gst_alaw_dec_init (GstALawDec * alawdec, GstALawDecClass * klass)
-  alawdec->sinkpad = gst_pad_new_from_template (alawdec_sink_template, "sink");
+  alawdec->sinkpad =
+      gst_pad_new_from_static_template (&alaw_dec_sink_factory, "sink");
   gst_pad_set_setcaps_function (alawdec->sinkpad,
       GST_DEBUG_FUNCPTR (gst_alaw_dec_sink_setcaps));
   gst_pad_set_chain_function (alawdec->sinkpad,
       GST_DEBUG_FUNCPTR (gst_alaw_dec_chain));
   gst_element_add_pad (GST_ELEMENT (alawdec), alawdec->sinkpad);
-  alawdec->srcpad = gst_pad_new_from_template (alawdec_src_template, "src");
+  alawdec->srcpad =
+      gst_pad_new_from_static_template (&alaw_dec_src_factory, "src");
   gst_pad_use_fixed_caps (alawdec->srcpad);
   gst_element_add_pad (GST_ELEMENT (alawdec), alawdec->srcpad);
 }
Index: alaw-encode.c
RCS file: /cvs/gstreamer/gst-plugins-good/gst/law/alaw-encode.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- alaw-encode.c	25 Aug 2008 09:48:06 -0000	1.34
+++ alaw-encode.c	13 Dec 2008 15:34:00 -0000	1.35
@@ -26,8 +26,8 @@
 GST_DEBUG_CATEGORY_STATIC (alaw_enc_debug);
 #define GST_CAT_DEFAULT alaw_enc_debug
-extern GstPadTemplate *alawenc_src_template;
-extern GstPadTemplate *alawenc_sink_template;
+extern GstStaticPadTemplate alaw_enc_src_factory;
+extern GstStaticPadTemplate alaw_enc_sink_factory;
 static GstFlowReturn gst_alaw_enc_chain (GstPad * pad, GstBuffer * buffer);
@@ -387,8 +387,10 @@
-  gst_element_class_add_pad_template (element_class, alawenc_src_template);
-  gst_element_class_add_pad_template (element_class, alawenc_sink_template);
+      gst_static_pad_template_get (&alaw_enc_src_factory));
+      gst_static_pad_template_get (&alaw_enc_sink_factory));
   gst_element_class_set_details_simple (element_class,
       "A Law audio encoder", "Codec/Encoder/Audio",
@@ -407,7 +409,8 @@
 gst_alaw_enc_init (GstALawEnc * alawenc, GstALawEncClass * klass)
-  alawenc->sinkpad = gst_pad_new_from_template (alawenc_sink_template, "sink");
+  alawenc->sinkpad =
+      gst_pad_new_from_static_template (&alaw_enc_sink_factory, "sink");
   gst_pad_set_setcaps_function (alawenc->sinkpad,
       GST_DEBUG_FUNCPTR (gst_alaw_enc_setcaps));
   gst_pad_set_getcaps_function (alawenc->sinkpad,
@@ -416,7 +419,8 @@
       GST_DEBUG_FUNCPTR (gst_alaw_enc_chain));
   gst_element_add_pad (GST_ELEMENT (alawenc), alawenc->sinkpad);
-  alawenc->srcpad = gst_pad_new_from_template (alawenc_src_template, "src");
+  alawenc->srcpad =
+      gst_pad_new_from_static_template (&alaw_enc_src_factory, "src");
   gst_pad_set_setcaps_function (alawenc->srcpad,
   gst_pad_set_getcaps_function (alawenc->srcpad,
Index: alaw.c
RCS file: /cvs/gstreamer/gst-plugins-good/gst/law/alaw.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- alaw.c	29 Aug 2008 00:28:55 -0000	1.20
+++ alaw.c	13 Dec 2008 15:34:00 -0000	1.21
@@ -23,54 +23,43 @@
 #include "alaw-encode.h"
-static GstCaps *
-alaw_factory (void)
-{
-  return gst_caps_new_simple ("audio/x-alaw",
-      "rate", GST_TYPE_INT_RANGE, 8000, 192000,
-      "channels", GST_TYPE_INT_RANGE, 1, 2, NULL);
-}
+GstStaticPadTemplate alaw_dec_src_factory = GST_STATIC_PAD_TEMPLATE ("src",
+    GST_STATIC_CAPS ("audio/x-raw-int, "
+        "rate = (int) [ 8000, 192000 ], "
+        "channels = (int) [ 1, 2 ], "
+        "endianness = (int) BYTE_ORDER, "
+        "width = (int) 16, " "width = (int) 16, " "signed = (boolean) True")
-linear_factory (void)
-  return gst_caps_new_simple ("audio/x-raw-int",
-      "width", G_TYPE_INT, 16,
-      "depth", G_TYPE_INT, 16,
-      "endianness", G_TYPE_INT, G_BYTE_ORDER,
-      "signed", G_TYPE_BOOLEAN, TRUE,
+GstStaticPadTemplate alaw_dec_sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
+    GST_STATIC_CAPS ("audio/x-alaw, "
+        "rate = [ 8000 , 192000 ], " "channels = [ 1 , 2 ]")
-GstPadTemplate *alawenc_src_template, *alawenc_sink_template;
-GstPadTemplate *alawdec_src_template, *alawdec_sink_template;
+GstStaticPadTemplate alaw_enc_sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
+GstStaticPadTemplate alaw_enc_src_factory = GST_STATIC_PAD_TEMPLATE ("src",
 static gboolean
 plugin_init (GstPlugin * plugin)
-  GstCaps *alaw_caps, *linear_caps;
-  alaw_caps = alaw_factory ();
-  linear_caps = linear_factory ();
-  gst_caps_ref (alaw_caps);
-  gst_caps_ref (linear_caps);
-  alawenc_src_template =
-      gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, alaw_caps);
-  alawenc_sink_template =
-      gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, linear_caps);
-  alawdec_src_template =
-      gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, linear_caps);
-  alawdec_sink_template =
-      gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, alaw_caps);
-  gst_caps_unref (alaw_caps);
-  gst_caps_unref (linear_caps);
   if (!gst_element_register (plugin, "alawenc",
           GST_RANK_NONE, GST_TYPE_ALAW_ENC) ||
       !gst_element_register (plugin, "alawdec",
Index: mulaw-decode.c
RCS file: /cvs/gstreamer/gst-plugins-good/gst/law/mulaw-decode.c,v
retrieving revision 1.33
diff -u -d -r1.33 -r1.34
--- mulaw-decode.c	1 Apr 2008 11:00:43 -0000	1.33
+++ mulaw-decode.c	13 Dec 2008 15:34:00 -0000	1.34
@@ -24,7 +24,8 @@
 #include "mulaw-decode.h"
 #include "mulaw-conversion.h"
-extern GstPadTemplate *mulawdec_src_template, *mulawdec_sink_template;
+extern GstStaticPadTemplate mulaw_dec_src_factory;
+extern GstStaticPadTemplate mulaw_dec_sink_factory;
 /* Stereo signals and args */
 enum
@@ -117,8 +118,10 @@
       "Convert 8bit mu law to 16bit PCM",
       "Zaheer Abbas Merali <zaheerabbas at merali dot org>");
-  gst_element_class_add_pad_template (element_class, mulawdec_src_template);
-  gst_element_class_add_pad_template (element_class, mulawdec_sink_template);
+      gst_static_pad_template_get (&mulaw_dec_src_factory));
+      gst_static_pad_template_get (&mulaw_dec_sink_factory));
   gst_element_class_set_details (element_class, &mulawdec_details);
@@ -136,12 +139,13 @@
 gst_mulawdec_init (GstMuLawDec * mulawdec)
   mulawdec->sinkpad =
-      gst_pad_new_from_template (mulawdec_sink_template, "sink");
+      gst_pad_new_from_static_template (&mulaw_dec_sink_factory, "sink");
   gst_pad_set_setcaps_function (mulawdec->sinkpad, mulawdec_sink_setcaps);
   gst_pad_set_chain_function (mulawdec->sinkpad, gst_mulawdec_chain);
   gst_element_add_pad (GST_ELEMENT (mulawdec), mulawdec->sinkpad);
-  mulawdec->srcpad = gst_pad_new_from_template (mulawdec_src_template, "src");
+  mulawdec->srcpad =
+      gst_pad_new_from_static_template (&mulaw_dec_src_factory, "src");
   gst_pad_use_fixed_caps (mulawdec->srcpad);
   gst_element_add_pad (GST_ELEMENT (mulawdec), mulawdec->srcpad);
Index: mulaw-encode.c
RCS file: /cvs/gstreamer/gst-plugins-good/gst/law/mulaw-encode.c,v
retrieving revision 1.30
diff -u -d -r1.30 -r1.31
--- mulaw-encode.c	25 Aug 2008 09:48:06 -0000	1.30
+++ mulaw-encode.c	13 Dec 2008 15:34:00 -0000	1.31
 #include "mulaw-encode.h"
-extern GstPadTemplate *mulawenc_src_template, *mulawenc_sink_template;
+extern GstStaticPadTemplate mulaw_enc_src_factory;
+extern GstStaticPadTemplate mulaw_enc_sink_factory;
@@ -170,8 +171,10 @@
       "Convert 16bit PCM to 8bit mu law",
-  gst_element_class_add_pad_template (element_class, mulawenc_src_template);
-  gst_element_class_add_pad_template (element_class, mulawenc_sink_template);
+      gst_static_pad_template_get (&mulaw_enc_src_factory));
+      gst_static_pad_template_get (&mulaw_enc_sink_factory));
   gst_element_class_set_details (element_class, &mulawenc_details);
@@ -185,13 +188,14 @@
 gst_mulawenc_init (GstMuLawEnc * mulawenc)
   mulawenc->sinkpad =
-      gst_pad_new_from_template (mulawenc_sink_template, "sink");
+      gst_pad_new_from_static_template (&mulaw_enc_sink_factory, "sink");
   gst_pad_set_setcaps_function (mulawenc->sinkpad, mulawenc_setcaps);
   gst_pad_set_getcaps_function (mulawenc->sinkpad, mulawenc_getcaps);
   gst_pad_set_chain_function (mulawenc->sinkpad, gst_mulawenc_chain);
   gst_element_add_pad (GST_ELEMENT (mulawenc), mulawenc->sinkpad);
-  mulawenc->srcpad = gst_pad_new_from_template (mulawenc_src_template, "src");
+  mulawenc->srcpad =
+      gst_pad_new_from_static_template (&mulaw_enc_src_factory, "src");
   gst_pad_set_setcaps_function (mulawenc->srcpad, mulawenc_setcaps);
   gst_pad_set_getcaps_function (mulawenc->srcpad, mulawenc_getcaps);
   gst_pad_use_fixed_caps (mulawenc->srcpad);
Index: mulaw.c
RCS file: /cvs/gstreamer/gst-plugins-good/gst/law/mulaw.c,v
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- mulaw.c	29 Aug 2008 00:28:55 -0000	1.21
+++ mulaw.c	13 Dec 2008 15:34:00 -0000	1.22
@@ -4,54 +4,43 @@
-mulaw_factory (void)
-  return gst_caps_new_simple ("audio/x-mulaw",
+GstStaticPadTemplate mulaw_dec_src_factory = GST_STATIC_PAD_TEMPLATE ("src",
+GstStaticPadTemplate mulaw_dec_sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
+    GST_STATIC_CAPS ("audio/x-mulaw, "
-GstPadTemplate *mulawenc_src_template, *mulawenc_sink_template;
-GstPadTemplate *mulawdec_src_template, *mulawdec_sink_template;
+GstStaticPadTemplate mulaw_enc_sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
+GstStaticPadTemplate mulaw_enc_src_factory = GST_STATIC_PAD_TEMPLATE ("src",
-  GstCaps *mulaw_caps, *linear_caps;
-  mulaw_caps = mulaw_factory ();
-  gst_caps_ref (mulaw_caps);
-  mulawenc_src_template =
-      gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, mulaw_caps);
-  mulawenc_sink_template =
-  mulawdec_src_template =
-  mulawdec_sink_template =
-      gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, mulaw_caps);
-  gst_caps_unref (mulaw_caps);
   if (!gst_element_register (plugin, "mulawenc",
           GST_RANK_NONE, GST_TYPE_MULAWENC) ||
       !gst_element_register (plugin, "mulawdec",
Index: gstudpnetutils.c
RCS file: /cvs/gstreamer/gst-plugins-good/gst/udp/gstudpnetutils.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- gstudpnetutils.c	20 Nov 2008 22:56:57 -0000	1.8
+++ gstudpnetutils.c	13 Dec 2008 15:34:00 -0000	1.9
@@ -91,7 +91,7 @@
   if ((ret = getaddrinfo (hostname, (port == -1) ? NULL : service, &hints,
               &res)) < 0) {
-    return ret;
+    goto beach;
   }
   nres = res;
@@ -107,8 +107,9 @@
     errno = EAI_ADDRFAMILY;
     ret = -1;
-  freeaddrinfo (res);
+beach:
+  freeaddrinfo (res);
   return ret;
Index: gstwavparse.c
RCS file: /cvs/gstreamer/gst-plugins-good/gst/wavparse/gstwavparse.c,v
retrieving revision 1.166
retrieving revision 1.167
diff -u -d -r1.166 -r1.167
--- gstwavparse.c	20 Nov 2008 20:07:26 -0000	1.166
+++ gstwavparse.c	13 Dec 2008 15:34:01 -0000	1.167
@@ -168,6 +168,7 @@
   wav->seek_event = NULL;
   if (wav->adapter) {
     gst_adapter_clear (wav->adapter);
+    g_object_unref (wav->adapter);
     wav->adapter = NULL;
   if (wav->tags)
@@ -2219,12 +2220,17 @@
   if (gst_pad_check_pull_range (sinkpad)) {
     GST_DEBUG ("going to pull mode");
     wav->streaming = FALSE;
+    if (wav->adapter) {
+      gst_adapter_clear (wav->adapter);
+      g_object_unref (wav->adapter);
+    }
     res = gst_pad_activate_pull (sinkpad, TRUE);
   } else {
     GST_DEBUG ("going to push (streaming) mode");
     wav->streaming = TRUE;
-    wav->adapter = gst_adapter_new ();
+    if (wav->adapter == NULL)
+      wav->adapter = gst_adapter_new ();
     res = gst_pad_activate_push (sinkpad, TRUE);
   gst_object_unref (wav);

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/