gst/elements/gstfilesrc.c: Fixing seeking by making FLUSH happen again and even befor...
authorJulien Moutte <julien@moutte.net>
Thu, 29 Jan 2004 22:43:41 +0000 (22:43 +0000)
committerJulien Moutte <julien@moutte.net>
Thu, 29 Jan 2004 22:43:41 +0000 (22:43 +0000)
Original commit message from CVS:
2004-01-29  Julien MOUTTE  <julien@moutte.net>

* gst/elements/gstfilesrc.c: (gst_filesrc_get),
(gst_filesrc_uri_handler_init): Fixing seeking by making FLUSH happen
again and even before DISCONT.
* gst/gstpad.c: (gst_pad_event_default): Remove a unused switch case.
* libs/gst/bytestream/bytestream.c: (gst_bytestream_get_next_buf): Fix
bytestream so that it's not stopping to fill the bytestream if events
different than EOS or DISCONT are received. Instead it process them so
that they go downstream.

ChangeLog
gst/elements/gstfilesrc.c
gst/gstpad.c
libs/gst/bytestream/bytestream.c
plugins/elements/gstfilesrc.c

index 4ab378f..d117264 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2004-01-29  Julien MOUTTE  <julien@moutte.net>
+
+       * gst/elements/gstfilesrc.c: (gst_filesrc_get),
+       (gst_filesrc_uri_handler_init): Fixing seeking by making FLUSH happen
+       again and even before DISCONT.
+       * gst/gstpad.c: (gst_pad_event_default): Remove a unused switch case.
+       * libs/gst/bytestream/bytestream.c: (gst_bytestream_get_next_buf): Fix
+       bytestream so that it's not stopping to fill the bytestream if events
+       different than EOS or DISCONT are received. Instead it process them so
+       that they go downstream.
+
 2004-01-29  Thomas Vander Stichele  <thomas at apestaart dot org>
 
        * docs/Makefile.am:
index d933591..569fa42 100644 (file)
@@ -667,6 +667,12 @@ gst_filesrc_get (GstPad *pad)
   src = GST_FILESRC (gst_pad_get_parent (pad));
   g_return_val_if_fail (GST_FLAG_IS_SET (src, GST_FILESRC_OPEN), NULL);
 
+  /* check for flush */
+  if (src->need_flush) {
+    src->need_flush = FALSE;
+    GST_DEBUG_OBJECT (src, "sending flush");
+    return GST_DATA (gst_event_new_flush ());
+  }
   /* check for seek */
   if (src->seek_happened) {
     GstEvent *event;
@@ -674,15 +680,8 @@ gst_filesrc_get (GstPad *pad)
     src->seek_happened = FALSE;
     GST_DEBUG_OBJECT (src, "sending discont");
     event = gst_event_new_discontinuous (FALSE, GST_FORMAT_BYTES, src->curoffset, NULL);
-    src->need_flush = FALSE;
     return GST_DATA (event);
   }
-  /* check for flush */
-  if (src->need_flush) {
-    src->need_flush = FALSE;
-    GST_DEBUG_OBJECT (src, "sending flush");
-    return GST_DATA (gst_event_new_flush ());
-  }
 
   /* check for EOF */
   g_assert (src->curoffset <= src->filelen);
@@ -997,4 +996,3 @@ gst_filesrc_uri_handler_init (gpointer g_iface, gpointer iface_data)
   iface->get_uri = gst_filesrc_uri_get_uri;
   iface->set_uri = gst_filesrc_uri_set_uri;
 }
-
index 9b35439..5ea3281 100644 (file)
@@ -3527,7 +3527,6 @@ gst_pad_event_default (GstPad *pad, GstEvent *event)
        }
       }
     }
-    case GST_EVENT_FLUSH:
     default:
       return gst_pad_event_default_dispatch (pad, element, event);
   }
index b0a2b72..829727a 100644 (file)
@@ -156,8 +156,19 @@ gst_bytestream_get_next_buf (GstByteStream *bs)
     return FALSE;
 
   if (GST_IS_EVENT (nextbuf)) {
-    bs->event = GST_EVENT (nextbuf);
-    return FALSE;
+    GstEvent *event = GST_EVENT (nextbuf);
+    switch (GST_EVENT_TYPE (event)) {
+      case GST_EVENT_EOS:
+      case GST_EVENT_DISCONTINUOUS:
+        GST_DEBUG ("get_next_buf: received EOS event.");
+        bs->event = event;
+        return FALSE;
+      default:
+        GST_DEBUG ("get_next_buf: received event %d, forwarding",
+                   GST_EVENT_TYPE (event));
+        gst_pad_event_default (bs->pad, event);
+        return TRUE;
+    }
   }
 
   if (GST_BUFFER_TIMESTAMP_IS_VALID (nextbuf))
index d933591..569fa42 100644 (file)
@@ -667,6 +667,12 @@ gst_filesrc_get (GstPad *pad)
   src = GST_FILESRC (gst_pad_get_parent (pad));
   g_return_val_if_fail (GST_FLAG_IS_SET (src, GST_FILESRC_OPEN), NULL);
 
+  /* check for flush */
+  if (src->need_flush) {
+    src->need_flush = FALSE;
+    GST_DEBUG_OBJECT (src, "sending flush");
+    return GST_DATA (gst_event_new_flush ());
+  }
   /* check for seek */
   if (src->seek_happened) {
     GstEvent *event;
@@ -674,15 +680,8 @@ gst_filesrc_get (GstPad *pad)
     src->seek_happened = FALSE;
     GST_DEBUG_OBJECT (src, "sending discont");
     event = gst_event_new_discontinuous (FALSE, GST_FORMAT_BYTES, src->curoffset, NULL);
-    src->need_flush = FALSE;
     return GST_DATA (event);
   }
-  /* check for flush */
-  if (src->need_flush) {
-    src->need_flush = FALSE;
-    GST_DEBUG_OBJECT (src, "sending flush");
-    return GST_DATA (gst_event_new_flush ());
-  }
 
   /* check for EOF */
   g_assert (src->curoffset <= src->filelen);
@@ -997,4 +996,3 @@ gst_filesrc_uri_handler_init (gpointer g_iface, gpointer iface_data)
   iface->get_uri = gst_filesrc_uri_get_uri;
   iface->set_uri = gst_filesrc_uri_set_uri;
 }
-