gst/elements/gstfilesrc.*: s/seek_happened/need_discont/ and require discont before...
authorBenjamin Otte <otte@gnome.org>
Fri, 16 Apr 2004 02:57:55 +0000 (02:57 +0000)
committerBenjamin Otte <otte@gnome.org>
Fri, 16 Apr 2004 02:57:55 +0000 (02:57 +0000)
Original commit message from CVS:
* gst/elements/gstfilesrc.c: (gst_filesrc_init), (gst_filesrc_get),
(gst_filesrc_change_state), (gst_filesrc_srcpad_event):
* gst/elements/gstfilesrc.h:
s/seek_happened/need_discont/ and require discont before sending any
data

ChangeLog
gst/elements/gstfilesrc.c
gst/elements/gstfilesrc.h
plugins/elements/gstfilesrc.c
plugins/elements/gstfilesrc.h

index 9d9b6f934f0c30de5c83d419f1e7f008dbbd1e76..38e8cbfaacf6fabd0cdbf22fe009b86f5130371f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2004-04-16  Benjamin Otte  <otte@gnome.org>
+
+       * gst/elements/gstfilesrc.c: (gst_filesrc_init), (gst_filesrc_get),
+       (gst_filesrc_change_state), (gst_filesrc_srcpad_event):
+       * gst/elements/gstfilesrc.h:
+         s/seek_happened/need_discont/ and require discont before sending any
+         data
+
 2004-04-15  David Schleef  <ds@schleef.org>
 
        * gst/gstvalue.c: (gst_value_serialize_buffer),
index eac08fa9fdb6917fdc891240d6a8dc4199afbe46..1943b24d782c2c8c6f45ca649e67a76e355be986 100644 (file)
@@ -245,8 +245,6 @@ gst_filesrc_init (GstFileSrc * src)
 
   src->mapbuf = NULL;
   src->mapsize = DEFAULT_MMAPSIZE;      /* default is 4MB */
-
-  src->seek_happened = FALSE;
 }
 
 static void
@@ -660,10 +658,10 @@ gst_filesrc_get (GstPad * pad)
     return GST_DATA (gst_event_new_flush ());
   }
   /* check for seek */
-  if (src->seek_happened) {
+  if (src->need_discont) {
     GstEvent *event;
 
-    src->seek_happened = FALSE;
+    src->need_discont = FALSE;
     GST_DEBUG_OBJECT (src, "sending discont");
     event =
         gst_event_new_discontinuous (FALSE, GST_FORMAT_BYTES, src->curoffset,
@@ -806,11 +804,12 @@ gst_filesrc_change_state (GstElement * element)
         if (!gst_filesrc_open_file (GST_FILESRC (element)))
           return GST_STATE_FAILURE;
       }
+      src->need_discont = TRUE;
       break;
     case GST_STATE_PAUSED_TO_READY:
       if (GST_FLAG_IS_SET (element, GST_FILESRC_OPEN))
         gst_filesrc_close_file (GST_FILESRC (element));
-      src->seek_happened = TRUE;
+      src->need_discont = TRUE;
       break;
     default:
       break;
@@ -910,7 +909,7 @@ gst_filesrc_srcpad_event (GstPad * pad, GstEvent * event)
           goto error;
           break;
       }
-      src->seek_happened = TRUE;
+      src->need_discont = TRUE;
       src->need_flush = GST_EVENT_SEEK_FLAGS (event) & GST_SEEK_FLAG_FLUSH;
       break;
     }
index 8ebda1e5c6d580a848114f78c1cce0e5191947ce..bd6a7bad2d3938305a6e5454f5780c7d123b7ad9 100644 (file)
@@ -70,7 +70,7 @@ struct _GstFileSrc {
   GstBuffer *mapbuf;
   size_t mapsize;
 
-  gboolean seek_happened;
+  gboolean need_discont;
   gboolean need_flush;
 };
 
index eac08fa9fdb6917fdc891240d6a8dc4199afbe46..1943b24d782c2c8c6f45ca649e67a76e355be986 100644 (file)
@@ -245,8 +245,6 @@ gst_filesrc_init (GstFileSrc * src)
 
   src->mapbuf = NULL;
   src->mapsize = DEFAULT_MMAPSIZE;      /* default is 4MB */
-
-  src->seek_happened = FALSE;
 }
 
 static void
@@ -660,10 +658,10 @@ gst_filesrc_get (GstPad * pad)
     return GST_DATA (gst_event_new_flush ());
   }
   /* check for seek */
-  if (src->seek_happened) {
+  if (src->need_discont) {
     GstEvent *event;
 
-    src->seek_happened = FALSE;
+    src->need_discont = FALSE;
     GST_DEBUG_OBJECT (src, "sending discont");
     event =
         gst_event_new_discontinuous (FALSE, GST_FORMAT_BYTES, src->curoffset,
@@ -806,11 +804,12 @@ gst_filesrc_change_state (GstElement * element)
         if (!gst_filesrc_open_file (GST_FILESRC (element)))
           return GST_STATE_FAILURE;
       }
+      src->need_discont = TRUE;
       break;
     case GST_STATE_PAUSED_TO_READY:
       if (GST_FLAG_IS_SET (element, GST_FILESRC_OPEN))
         gst_filesrc_close_file (GST_FILESRC (element));
-      src->seek_happened = TRUE;
+      src->need_discont = TRUE;
       break;
     default:
       break;
@@ -910,7 +909,7 @@ gst_filesrc_srcpad_event (GstPad * pad, GstEvent * event)
           goto error;
           break;
       }
-      src->seek_happened = TRUE;
+      src->need_discont = TRUE;
       src->need_flush = GST_EVENT_SEEK_FLAGS (event) & GST_SEEK_FLAG_FLUSH;
       break;
     }
index 8ebda1e5c6d580a848114f78c1cce0e5191947ce..bd6a7bad2d3938305a6e5454f5780c7d123b7ad9 100644 (file)
@@ -70,7 +70,7 @@ struct _GstFileSrc {
   GstBuffer *mapbuf;
   size_t mapsize;
 
-  gboolean seek_happened;
+  gboolean need_discont;
   gboolean need_flush;
 };