Commit 8c1aec66 authored by Ronald S. Bultje's avatar Ronald S. Bultje

Fix problems when seeking with esdsink (#106890)

Original commit message from CVS:
Fix problems when seeking with esdsink (#106890)
parent 46351d06
common @ 6b0a313b
Subproject commit d6e219fd076d8f182bd1ee84228b1b85cdb807a6
Subproject commit 6b0a313b93535f0df7956a01405ddb63a3d76b5a
......@@ -89,6 +89,7 @@ static GstElementStateReturn gst_esdsink_change_state (GstElement *element);
static gboolean gst_esdsink_sync_parms (GstEsdsink *esdsink);
static GstPadLinkReturn gst_esdsink_sinkconnect (GstPad *pad, GstCaps *caps);
static void gst_esdsink_set_clock (GstElement *element, GstClock *clock);
static void gst_esdsink_chain (GstPad *pad, GstBuffer *buf);
static void gst_esdsink_set_property (GObject *object, guint prop_id,
......@@ -184,6 +185,8 @@ gst_esdsink_class_init (GstEsdsinkClass *klass)
gobject_class->get_property = gst_esdsink_get_property;
gstelement_class->change_state = gst_esdsink_change_state;
gstelement_class->set_clock = gst_esdsink_set_clock;
//gstelement_class->get_clock = gst_esdsink_get_clock;
}
static void
......@@ -195,6 +198,8 @@ gst_esdsink_init(GstEsdsink *esdsink)
gst_pad_set_chain_function(esdsink->sinkpad, GST_DEBUG_FUNCPTR(gst_esdsink_chain));
gst_pad_set_link_function(esdsink->sinkpad, gst_esdsink_sinkconnect);
GST_FLAG_SET (esdsink, GST_ELEMENT_EVENT_AWARE);
esdsink->mute = FALSE;
esdsink->fd = -1;
/* FIXME: get default from somewhere better than just putting them inline. */
......@@ -238,6 +243,28 @@ gst_esdsink_sinkconnect (GstPad *pad, GstCaps *caps)
return GST_PAD_LINK_REFUSED;
}
#if 0
static GstClock *
gst_esdsink_get_clock (GstElement *element)
{
GstEsdsink *esdsink;
esdsink = GET_ESDSINK (element);
return GST_CLOCK(esdsink->provided_clock);
}
#endif
static void
gst_esdsink_set_clock (GstElement *element, GstClock *clock)
{
GstEsdsink *esdsink;
esdsink = GST_ESDSINK (element);
esdsink->clock = clock;
}
static void
gst_esdsink_chain (GstPad *pad, GstBuffer *buf)
{
......@@ -249,6 +276,33 @@ gst_esdsink_chain (GstPad *pad, GstBuffer *buf)
esdsink = GST_ESDSINK (gst_pad_get_parent (pad));
if (GST_IS_EVENT(buf)){
GstEvent *event = GST_EVENT(buf);
switch(GST_EVENT_TYPE(event)){
case GST_EVENT_EOS:
break;
case GST_EVENT_DISCONTINUOUS:
{
gint64 value;
if (gst_event_discont_get_value (event, GST_FORMAT_TIME, &value)) {
if (!gst_clock_handle_discont (esdsink->clock, value)){
//gst_esdsink_clock_set_active (osssink->provided_clock, FALSE);
}
//esdsink->handled = 0;
}
//esdsink->resync = TRUE;
break;
}
default:
gst_pad_event_default(pad, event);
break;
}
gst_event_unref(event);
return;
}
if (GST_BUFFER_DATA (buf) != NULL) {
if (!esdsink->mute && esdsink->fd >= 0) {
GST_DEBUG (0, "esdsink: fd=%d data=%p size=%d",
......
......@@ -52,6 +52,8 @@ struct _GstEsdsink {
GstPad *sinkpad;
GstClock *clock;
gboolean mute;
int fd;
gint format;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment