Commit fe672ffe authored by Wim Taymans's avatar Wim Taymans
Browse files

Fixed some plugins

Original commit message from CVS:
Fixed some plugins
parent dcf3d39a
......@@ -979,7 +979,7 @@ gst_alsa_sink_process (GstAlsa *this, snd_pcm_uframes_t frames)
* me know when this is needed ;)
* also, for sample accuracy etc, we should play avail
* bytes, but hey. */
gst_element_set_state(GST_ELEMENT(this), GST_STATE_PAUSED);
gst_element_set_eos(GST_ELEMENT(this));
gst_event_free(event);
return TRUE;
}
......
......@@ -449,20 +449,21 @@ cdparanoia_get (GstPad *pad)
// update current sector and stop things if appropriate
src->cur_sector++;
src->cur_track = cdda_sector_gettrack( src->d, src->cur_sector );
if (src->cur_sector == src->end_sector) {
GST_DEBUG (0,"setting EOS flag on outgoing buffer\n");
GST_BUFFER_FLAG_SET (buf,GST_BUFFER_EOS);
gst_element_signal_eos(GST_ELEMENT(src));
}
// have to copy the buffer for now since we don't own it...
// FIXME must ask monty about allowing ownership transfer
GST_BUFFER_DATA (buf) = g_malloc(CD_FRAMESIZE_RAW);
memcpy (GST_BUFFER_DATA (buf), cdda_buf, CD_FRAMESIZE_RAW);
GST_BUFFER_SIZE (buf) = CD_FRAMESIZE_RAW;
GST_DEBUG (0,"setting EOS\n");
gst_element_set_eos(GST_ELEMENT(src));
buf = GST_BUFFER (gst_event_new (GST_EVENT_EOS));
}
else {
src->cur_track = cdda_sector_gettrack( src->d, src->cur_sector );
// have to copy the buffer for now since we don't own it...
// FIXME must ask monty about allowing ownership transfer
GST_BUFFER_DATA (buf) = g_malloc(CD_FRAMESIZE_RAW);
memcpy (GST_BUFFER_DATA (buf), cdda_buf, CD_FRAMESIZE_RAW);
GST_BUFFER_SIZE (buf) = CD_FRAMESIZE_RAW;
}
/* we're done, push the buffer off now */
return buf;
......
......@@ -217,8 +217,7 @@ static void gst_gnomevfssrc_set_property(GObject *object, guint prop_id, const G
/* clear the filename if we get a NULL (is that possible?) */
if (g_value_get_string (value) == NULL) {
gst_element_set_state(GST_ELEMENT(object),
GST_STATE_NULL);
gst_element_set_state(GST_ELEMENT(object), GST_STATE_NULL);
src->filename = NULL;
} else {
/* otherwise set the new filename */
......@@ -292,7 +291,7 @@ static GstBuffer *gst_gnomevfssrc_get(GstPad *pad)
/* deal with EOF state */
if ((src->curoffset >= src->size) && (src->size != 0))
{
gst_element_set_state (GST_ELEMENT (src), GST_STATE_PAUSED);
gst_element_set_eos (GST_ELEMENT (src));
return GST_BUFFER (gst_event_new (GST_EVENT_EOS));
}
......@@ -321,7 +320,7 @@ static GstBuffer *gst_gnomevfssrc_get(GstPad *pad)
if (src->new_seek)
{
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLUSH);
/* FIXME do a discont, flush event */
GST_DEBUG (0,"new seek\n");
src->new_seek = FALSE;
}
......@@ -336,7 +335,7 @@ static GstBuffer *gst_gnomevfssrc_get(GstPad *pad)
GNOME_VFS_SEEK_START, src->curoffset);
GST_DEBUG(0, "new_seek: %s\n",
gnome_vfs_result_to_string(result));
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLUSH);
/* FIXME do a discont, flush event */
src->new_seek = FALSE;
}
......@@ -350,7 +349,7 @@ static GstBuffer *gst_gnomevfssrc_get(GstPad *pad)
{
gst_buffer_unref(buf);
gst_element_set_state (GST_ELEMENT (src), GST_STATE_PAUSED);
gst_element_set_eos (GST_ELEMENT (src));
return GST_BUFFER (gst_event_new (GST_EVENT_EOS));
}
......
......@@ -214,19 +214,17 @@ gst_v4lmjpegsink_chain (GstPad *pad,
v4lmjpegsink = GST_V4LMJPEGSINK (gst_pad_get_parent (pad));
if (!GST_BUFFER_FLAG_IS_SET(buf, GST_BUFFER_FLUSH)) {
GST_DEBUG (0,"videosink: clock wait: %llu\n", GST_BUFFER_TIMESTAMP(buf));
jitter = gst_clock_current_diff(v4lmjpegsink->clock, GST_BUFFER_TIMESTAMP (buf));
if (jitter > 500000 || jitter < -500000)
{
GST_DEBUG (0, "jitter: %lld\n", jitter);
gst_clock_set (v4lmjpegsink->clock, GST_BUFFER_TIMESTAMP (buf));
}
else {
gst_clock_wait(v4lmjpegsink->clock, GST_BUFFER_TIMESTAMP(buf), GST_OBJECT(v4lmjpegsink));
}
GST_DEBUG (0,"videosink: clock wait: %llu\n", GST_BUFFER_TIMESTAMP(buf));
jitter = gst_clock_current_diff(v4lmjpegsink->clock, GST_BUFFER_TIMESTAMP (buf));
if (jitter > 500000 || jitter < -500000)
{
GST_DEBUG (0, "jitter: %lld\n", jitter);
gst_clock_set (v4lmjpegsink->clock, GST_BUFFER_TIMESTAMP (buf));
}
else {
gst_clock_wait(v4lmjpegsink->clock, GST_BUFFER_TIMESTAMP(buf), GST_OBJECT(v4lmjpegsink));
}
/* check size */
......
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