summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorBenjamin Otte <otte@gnome.org>2004-04-16 02:57:55 +0000
committerBenjamin Otte <otte@gnome.org>2004-04-16 02:57:55 +0000
commit271371290666c6c58ba7c225d411f229d1ebf725 (patch)
treeca9a026531153e33ca38ef366c86522240ab7046 /plugins
parent06940084e54fca5adea7bd2545ab7f290728aa19 (diff)
gst/elements/gstfilesrc.*: s/seek_happened/need_discont/ and require discont before sending any data
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
Diffstat (limited to 'plugins')
-rw-r--r--plugins/elements/gstfilesrc.c11
-rw-r--r--plugins/elements/gstfilesrc.h2
2 files changed, 6 insertions, 7 deletions
diff --git a/plugins/elements/gstfilesrc.c b/plugins/elements/gstfilesrc.c
index eac08fa9fd..1943b24d78 100644
--- a/plugins/elements/gstfilesrc.c
+++ b/plugins/elements/gstfilesrc.c
@@ -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;
}
diff --git a/plugins/elements/gstfilesrc.h b/plugins/elements/gstfilesrc.h
index 8ebda1e5c6..bd6a7bad2d 100644
--- a/plugins/elements/gstfilesrc.h
+++ b/plugins/elements/gstfilesrc.h
@@ -70,7 +70,7 @@ struct _GstFileSrc {
GstBuffer *mapbuf;
size_t mapsize;
- gboolean seek_happened;
+ gboolean need_discont;
gboolean need_flush;
};