Merge branch 'master' into 0.11
[platform/upstream/gstreamer.git] / ext / wavpack / gstwavpackparse.c
index e3625c5..0af0a90 100644 (file)
 #include "config.h"
 #endif
 
-/* FIXME 0.11: suppress warnings for deprecated API such as GStaticRecMutex
- * with newer GLib versions (>= 2.31.0) */
-#define GLIB_DISABLE_DEPRECATION_WARNINGS
-
 #include <gst/gst.h>
 #include <gst/gst-i18n-plugin.h>
 
@@ -120,9 +116,12 @@ gst_wavpack_parse_base_init (gpointer klass)
 {
   GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
 
-  gst_element_class_add_static_pad_template (element_class, &src_factory);
-  gst_element_class_add_static_pad_template (element_class, &wvc_src_factory);
-  gst_element_class_add_static_pad_template (element_class, &sink_factory);
+  gst_element_class_add_pad_template (element_class,
+      gst_static_pad_template_get (&src_factory));
+  gst_element_class_add_pad_template (element_class,
+      gst_static_pad_template_get (&wvc_src_factory));
+  gst_element_class_add_pad_template (element_class,
+      gst_static_pad_template_get (&sink_factory));
 
   gst_element_class_set_details_simple (element_class, "Wavpack parser",
       "Codec/Demuxer/Audio",
@@ -774,7 +773,7 @@ gst_wavpack_parse_pull_buffer (GstWavpackParse * wvparse, gint64 offset,
     if (offset + size > wvparse->upstream_length) {
       GST_DEBUG_OBJECT (wvparse, "EOS: %" G_GINT64_FORMAT " + %u > %"
           G_GINT64_FORMAT, offset, size, wvparse->upstream_length);
-      flow_ret = GST_FLOW_UNEXPECTED;
+      flow_ret = GST_FLOW_EOS;
       goto done;
     }
   }
@@ -793,7 +792,7 @@ gst_wavpack_parse_pull_buffer (GstWavpackParse * wvparse, gint64 offset,
         ", got only %u of %u bytes", offset, GST_BUFFER_SIZE (buf), size);
     gst_buffer_unref (buf);
     buf = NULL;
-    flow_ret = GST_FLOW_UNEXPECTED;
+    flow_ret = GST_FLOW_EOS;
   }
 
 done:
@@ -1007,7 +1006,7 @@ gst_wavpack_parse_find_marker (guint8 * buf, guint size)
 static GstFlowReturn
 gst_wavpack_parse_resync_loop (GstWavpackParse * parse, WavpackHeader * header)
 {
-  GstFlowReturn flow_ret = GST_FLOW_UNEXPECTED;
+  GstFlowReturn flow_ret = GST_FLOW_EOS;
   GstBuffer *buf = NULL;
 
   /* loop until we have a frame header or reach the end of the stream */
@@ -1116,7 +1115,7 @@ pause:
     GST_LOG_OBJECT (parse, "pausing task, reason %s", reason);
     gst_pad_pause_task (parse->sinkpad);
 
-    if (flow_ret == GST_FLOW_UNEXPECTED && parse->srcpad) {
+    if (flow_ret == GST_FLOW_EOS && parse->srcpad) {
       if (parse->segment.flags & GST_SEEK_FLAG_SEGMENT) {
         GstClockTime stop;
 
@@ -1132,8 +1131,7 @@ pause:
         GST_LOG_OBJECT (parse, "Sending EOS, at end of stream");
         gst_pad_push_event (parse->srcpad, gst_event_new_eos ());
       }
-    } else if (flow_ret == GST_FLOW_NOT_LINKED
-        || flow_ret < GST_FLOW_UNEXPECTED) {
+    } else if (flow_ret == GST_FLOW_NOT_LINKED || flow_ret < GST_FLOW_EOS) {
       GST_ELEMENT_ERROR (parse, STREAM, FAILED,
           (_("Internal data stream error.")), ("stream stopped, reason %s",
               reason));