GST_FLOW_UNEXPECTED -> GST_FLOW_EOS
authorWim Taymans <wim.taymans@collabora.co.uk>
Tue, 3 Jan 2012 14:27:42 +0000 (15:27 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Tue, 3 Jan 2012 14:27:42 +0000 (15:27 +0100)
ext/amrwbdec/amrwbdec.c
ext/dvdread/dvdreadsrc.c
ext/mad/gstmad.c
ext/sidplay/gstsiddec.cc
gst/asfdemux/gstasfdemux.c
gst/realmedia/pnmsrc.c
gst/realmedia/rdtmanager.c
gst/realmedia/rmdemux.c

index b9d8660..daed475 100644 (file)
@@ -192,7 +192,7 @@ gst_amrwbdec_parse (GstAudioDecoder * dec, GstAdapter * adapter,
     /* no frame yet, skip one byte */
     GST_LOG_OBJECT (amrwbdec, "skipping byte");
     *offset = 1;
-    return GST_FLOW_UNEXPECTED;
+    return GST_FLOW_EOS;
   }
 
   return GST_FLOW_OK;
index 358ae2e..71497a7 100644 (file)
@@ -962,7 +962,7 @@ gst_dvd_read_src_create (GstPushSrc * pushsrc, GstBuffer ** p_buf)
       return GST_FLOW_ERROR;
     }
     case GST_DVD_READ_EOS:{
-      return GST_FLOW_UNEXPECTED;
+      return GST_FLOW_EOS;
     }
     case GST_DVD_READ_OK:{
       src->change_cell = FALSE;
@@ -972,7 +972,7 @@ gst_dvd_read_src_create (GstPushSrc * pushsrc, GstBuffer ** p_buf)
       break;
   }
 
-  g_return_val_if_reached (GST_FLOW_UNEXPECTED);
+  g_return_val_if_reached (GST_FLOW_EOS);
 }
 
 static void
index 78277d2..aa42e69 100644 (file)
@@ -267,7 +267,7 @@ gst_mad_parse (GstAudioDecoder * dec, GstAdapter * adapter,
     gint * _offset, gint * len)
 {
   GstMad *mad;
-  GstFlowReturn ret = GST_FLOW_UNEXPECTED;
+  GstFlowReturn ret = GST_FLOW_EOS;
   gint av, size, offset, prev_offset, consumed = 0;
   const guint8 *data;
 
@@ -400,7 +400,7 @@ static GstFlowReturn
 gst_mad_handle_frame (GstAudioDecoder * dec, GstBuffer * buffer)
 {
   GstMad *mad;
-  GstFlowReturn ret = GST_FLOW_UNEXPECTED;
+  GstFlowReturn ret = GST_FLOW_EOS;
   GstBuffer *outbuffer;
   guint nsamples;
   gint32 *outdata;
index 022d998..801f889 100644 (file)
@@ -407,10 +407,10 @@ pause:
   {
     const gchar *reason = gst_flow_get_name (ret);
 
-    if (ret == GST_FLOW_UNEXPECTED) {
+    if (ret == GST_FLOW_EOS) {
       /* perform EOS logic, FIXME, segment seek? */
       gst_pad_push_event (pad, gst_event_new_eos ());
-    } else  if (ret < GST_FLOW_UNEXPECTED || ret == GST_FLOW_NOT_LINKED) {
+    } else  if (ret < GST_FLOW_EOS || ret == GST_FLOW_NOT_LINKED) {
       /* for fatal errors we post an error message */
       GST_ELEMENT_ERROR (siddec, STREAM, FAILED,
           (NULL), ("streaming task paused, reason %s", reason));
index 2bbcd72..8e1103e 100644 (file)
@@ -405,7 +405,7 @@ gst_asf_demux_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
         break;
       }
       flow = gst_asf_demux_push_complete_payloads (demux, TRUE);
-      if (flow < GST_FLOW_UNEXPECTED || flow == GST_FLOW_NOT_LINKED) {
+      if (flow < GST_FLOW_EOS || flow == GST_FLOW_NOT_LINKED) {
         GST_ELEMENT_ERROR (demux, STREAM, FAILED,
             (_("Internal data stream error.")),
             ("streaming stopped, reason %s", gst_flow_get_name (flow)));
@@ -963,7 +963,7 @@ gst_asf_demux_pull_data (GstASFDemux * demux, guint64 offset, guint size,
         "+%u (got only %" G_GSIZE_FORMAT " bytes)", offset, size, buffer_size);
     gst_buffer_unref (*p_buf);
     if (G_LIKELY (p_flow))
-      *p_flow = GST_FLOW_UNEXPECTED;
+      *p_flow = GST_FLOW_EOS;
     *p_buf = NULL;
     return FALSE;
   }
@@ -1578,7 +1578,7 @@ gst_asf_demux_loop (GstASFDemux * demux)
   if (G_UNLIKELY (!gst_asf_demux_pull_data (demux, off,
               demux->packet_size * demux->speed_packets, &buf, &flow))) {
     GST_DEBUG_OBJECT (demux, "got flow %s", gst_flow_get_name (flow));
-    if (flow == GST_FLOW_UNEXPECTED)
+    if (flow == GST_FLOW_EOS)
       goto eos;
     else if (flow == GST_FLOW_WRONG_STATE) {
       GST_DEBUG_OBJECT (demux, "Not fatal");
@@ -1686,7 +1686,7 @@ eos:
       gst_element_post_message (GST_ELEMENT_CAST (demux),
           gst_message_new_segment_done (GST_OBJECT (demux), GST_FORMAT_TIME,
               stop));
-    } else if (flow != GST_FLOW_UNEXPECTED) {
+    } else if (flow != GST_FLOW_EOS) {
       /* check if we have a chained asf, in case, we don't eos yet */
       if (gst_asf_demux_check_chained_asf (demux)) {
         GST_INFO_OBJECT (demux, "Chained ASF starting");
@@ -1709,9 +1709,9 @@ pause:
 
     /* For the error cases (not EOS) */
     if (!sent_eos) {
-      if (flow == GST_FLOW_UNEXPECTED)
+      if (flow == GST_FLOW_EOS)
         gst_asf_demux_send_event_unlocked (demux, gst_event_new_eos ());
-      else if (flow < GST_FLOW_UNEXPECTED || flow == GST_FLOW_NOT_LINKED) {
+      else if (flow < GST_FLOW_EOS || flow == GST_FLOW_NOT_LINKED) {
         /* Post an error. Hopefully something else already has, but if not... */
         GST_ELEMENT_ERROR (demux, STREAM, FAILED,
             (_("Internal data stream error.")),
@@ -1726,7 +1726,7 @@ read_failed:
   {
     GST_DEBUG_OBJECT (demux, "Read failed, doh");
     gst_asf_demux_send_event_unlocked (demux, gst_event_new_eos ());
-    flow = GST_FLOW_UNEXPECTED;
+    flow = GST_FLOW_EOS;
     goto pause;
   }
 parse_error:
@@ -1874,7 +1874,7 @@ done:
 eos:
   {
     GST_DEBUG_OBJECT (demux, "Handled last packet, setting EOS");
-    ret = GST_FLOW_UNEXPECTED;
+    ret = GST_FLOW_EOS;
     goto done;
   }
 }
@@ -2349,7 +2349,7 @@ gst_asf_demux_parse_stream_object (GstASFDemux * demux, guint8 * data,
 
   flags = gst_asf_demux_get_uint16 (&data, &size);
   stream_id = flags & 0x7f;
-  is_encrypted = !!((flags & 0x8000) << 15);
+  is_encrypted = ! !((flags & 0x8000) << 15);
   unknown = gst_asf_demux_get_uint32 (&data, &size);
 
   GST_DEBUG_OBJECT (demux, "Found stream %u, time_offset=%" GST_TIME_FORMAT,
@@ -2957,8 +2957,8 @@ gst_asf_demux_process_file (GstASFDemux * demux, guint8 * data, guint64 size)
   max_pktsize = gst_asf_demux_get_uint32 (&data, &size);
   min_bitrate = gst_asf_demux_get_uint32 (&data, &size);
 
-  demux->broadcast = !!(flags & 0x01);
-  demux->seekable = !!(flags & 0x02);
+  demux->broadcast = ! !(flags & 0x01);
+  demux->seekable = ! !(flags & 0x02);
 
   GST_DEBUG_OBJECT (demux, "min_pktsize = %u", min_pktsize);
   GST_DEBUG_OBJECT (demux, "flags::broadcast = %d", demux->broadcast);
index a2671af..a165133 100644 (file)
@@ -188,7 +188,7 @@ gst_pnm_src_create (GstPushSrc * psrc, GstBuffer ** buf)
   gst_element_post_message (GST_ELEMENT_CAST (src), m);
 
 
-  return GST_FLOW_UNEXPECTED;
+  return GST_FLOW_EOS;
 }
 
 /*** GSTURIHANDLER INTERFACE *************************************************/
index 4dd47fd..8fb5503 100644 (file)
@@ -882,7 +882,7 @@ do_eos:
   {
     /* store result, we are flushing now */
     GST_DEBUG_OBJECT (rdtmanager, "We are EOS, pushing EOS downstream");
-    session->srcresult = GST_FLOW_UNEXPECTED;
+    session->srcresult = GST_FLOW_EOS;
     gst_pad_pause_task (session->recv_rtp_src);
     gst_pad_push_event (session->recv_rtp_src, gst_event_new_eos ());
     JBUF_UNLOCK (session);
index 0c88f46..d89d046 100644 (file)
@@ -829,7 +829,7 @@ gst_rmdemux_loop (GstPad * pad)
       break;
     case RMDEMUX_STATE_EOS:
       GST_LOG_OBJECT (rmdemux, "At EOS, pausing task");
-      ret = GST_FLOW_UNEXPECTED;
+      ret = GST_FLOW_EOS;
       goto need_pause;
     default:
       GST_LOG_OBJECT (rmdemux, "Default: requires %d bytes (state is %d)",
@@ -904,7 +904,7 @@ need_pause:
     rmdemux->segment_running = FALSE;
     gst_pad_pause_task (rmdemux->sinkpad);
 
-    if (ret == GST_FLOW_UNEXPECTED) {
+    if (ret == GST_FLOW_EOS) {
       /* perform EOS logic */
       if (rmdemux->segment.flags & GST_SEEK_FLAG_SEGMENT) {
         gint64 stop;
@@ -923,7 +923,7 @@ need_pause:
         GST_LOG_OBJECT (rmdemux, "Sending EOS, at end of stream");
         gst_rmdemux_send_event (rmdemux, gst_event_new_eos ());
       }
-    } else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_UNEXPECTED) {
+    } else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_EOS) {
       GST_ELEMENT_ERROR (rmdemux, STREAM, FAILED,
           (NULL), ("stream stopped, reason %s", reason));
       gst_rmdemux_send_event (rmdemux, gst_event_new_eos ());