+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),
src->mapbuf = NULL;
src->mapsize = DEFAULT_MMAPSIZE; /* default is 4MB */
-
- src->seek_happened = FALSE;
}
static void
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,
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;
goto error;
break;
}
- src->seek_happened = TRUE;
+ src->need_discont = TRUE;
src->need_flush = GST_EVENT_SEEK_FLAGS (event) & GST_SEEK_FLAG_FLUSH;
break;
}
GstBuffer *mapbuf;
size_t mapsize;
- gboolean seek_happened;
+ gboolean need_discont;
gboolean need_flush;
};
src->mapbuf = NULL;
src->mapsize = DEFAULT_MMAPSIZE; /* default is 4MB */
-
- src->seek_happened = FALSE;
}
static void
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,
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;
goto error;
break;
}
- src->seek_happened = TRUE;
+ src->need_discont = TRUE;
src->need_flush = GST_EVENT_SEEK_FLAGS (event) & GST_SEEK_FLAG_FLUSH;
break;
}
GstBuffer *mapbuf;
size_t mapsize;
- gboolean seek_happened;
+ gboolean need_discont;
gboolean need_flush;
};