Fixed some plugins

Original commit message from CVS:
Fixed some plugins
This commit is contained in:
Wim Taymans 2001-12-28 20:24:41 +00:00
parent dcf3d39af1
commit fe672ffe26
4 changed files with 27 additions and 29 deletions

View file

@ -979,7 +979,7 @@ gst_alsa_sink_process (GstAlsa *this, snd_pcm_uframes_t frames)
* me know when this is needed ;) * me know when this is needed ;)
* also, for sample accuracy etc, we should play avail * also, for sample accuracy etc, we should play avail
* bytes, but hey. */ * bytes, but hey. */
gst_element_set_state(GST_ELEMENT(this), GST_STATE_PAUSED); gst_element_set_eos(GST_ELEMENT(this));
gst_event_free(event); gst_event_free(event);
return TRUE; return TRUE;
} }

View file

@ -449,20 +449,21 @@ cdparanoia_get (GstPad *pad)
// update current sector and stop things if appropriate // update current sector and stop things if appropriate
src->cur_sector++; src->cur_sector++;
src->cur_track = cdda_sector_gettrack( src->d, src->cur_sector );
if (src->cur_sector == src->end_sector) { if (src->cur_sector == src->end_sector) {
GST_DEBUG (0,"setting EOS flag on outgoing buffer\n"); GST_DEBUG (0,"setting EOS\n");
GST_BUFFER_FLAG_SET (buf,GST_BUFFER_EOS); gst_element_set_eos(GST_ELEMENT(src));
gst_element_signal_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... // have to copy the buffer for now since we don't own it...
// FIXME must ask monty about allowing ownership transfer // FIXME must ask monty about allowing ownership transfer
GST_BUFFER_DATA (buf) = g_malloc(CD_FRAMESIZE_RAW); GST_BUFFER_DATA (buf) = g_malloc(CD_FRAMESIZE_RAW);
memcpy (GST_BUFFER_DATA (buf), cdda_buf, CD_FRAMESIZE_RAW); memcpy (GST_BUFFER_DATA (buf), cdda_buf, CD_FRAMESIZE_RAW);
GST_BUFFER_SIZE (buf) = CD_FRAMESIZE_RAW; GST_BUFFER_SIZE (buf) = CD_FRAMESIZE_RAW;
}
/* we're done, push the buffer off now */ /* we're done, push the buffer off now */
return buf; return buf;

View file

@ -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?) */ /* clear the filename if we get a NULL (is that possible?) */
if (g_value_get_string (value) == NULL) { if (g_value_get_string (value) == NULL) {
gst_element_set_state(GST_ELEMENT(object), gst_element_set_state(GST_ELEMENT(object), GST_STATE_NULL);
GST_STATE_NULL);
src->filename = NULL; src->filename = NULL;
} else { } else {
/* otherwise set the new filename */ /* otherwise set the new filename */
@ -292,7 +291,7 @@ static GstBuffer *gst_gnomevfssrc_get(GstPad *pad)
/* deal with EOF state */ /* deal with EOF state */
if ((src->curoffset >= src->size) && (src->size != 0)) 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)); return GST_BUFFER (gst_event_new (GST_EVENT_EOS));
} }
@ -321,7 +320,7 @@ static GstBuffer *gst_gnomevfssrc_get(GstPad *pad)
if (src->new_seek) if (src->new_seek)
{ {
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLUSH); /* FIXME do a discont, flush event */
GST_DEBUG (0,"new seek\n"); GST_DEBUG (0,"new seek\n");
src->new_seek = FALSE; src->new_seek = FALSE;
} }
@ -336,7 +335,7 @@ static GstBuffer *gst_gnomevfssrc_get(GstPad *pad)
GNOME_VFS_SEEK_START, src->curoffset); GNOME_VFS_SEEK_START, src->curoffset);
GST_DEBUG(0, "new_seek: %s\n", GST_DEBUG(0, "new_seek: %s\n",
gnome_vfs_result_to_string(result)); gnome_vfs_result_to_string(result));
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLUSH); /* FIXME do a discont, flush event */
src->new_seek = FALSE; src->new_seek = FALSE;
} }
@ -350,7 +349,7 @@ static GstBuffer *gst_gnomevfssrc_get(GstPad *pad)
{ {
gst_buffer_unref(buf); 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)); return GST_BUFFER (gst_event_new (GST_EVENT_EOS));
} }

View file

@ -214,19 +214,17 @@ gst_v4lmjpegsink_chain (GstPad *pad,
v4lmjpegsink = GST_V4LMJPEGSINK (gst_pad_get_parent (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));
GST_DEBUG (0,"videosink: clock wait: %llu\n", GST_BUFFER_TIMESTAMP(buf));
jitter = gst_clock_current_diff(v4lmjpegsink->clock, GST_BUFFER_TIMESTAMP (buf)); jitter = gst_clock_current_diff(v4lmjpegsink->clock, GST_BUFFER_TIMESTAMP (buf));
if (jitter > 500000 || jitter < -500000) if (jitter > 500000 || jitter < -500000)
{ {
GST_DEBUG (0, "jitter: %lld\n", jitter); GST_DEBUG (0, "jitter: %lld\n", jitter);
gst_clock_set (v4lmjpegsink->clock, GST_BUFFER_TIMESTAMP (buf)); gst_clock_set (v4lmjpegsink->clock, GST_BUFFER_TIMESTAMP (buf));
} }
else { else {
gst_clock_wait(v4lmjpegsink->clock, GST_BUFFER_TIMESTAMP(buf), GST_OBJECT(v4lmjpegsink)); gst_clock_wait(v4lmjpegsink->clock, GST_BUFFER_TIMESTAMP(buf), GST_OBJECT(v4lmjpegsink));
}
} }
/* check size */ /* check size */