ext/alsa/gstalsasink.c: compute correct expected timestamps after seek (broken since last commit)

Original commit message from CVS:
* ext/alsa/gstalsasink.c: (gst_alsa_sink_loop):
compute correct expected timestamps after seek (broken since
last commit)
* ext/gdk_pixbuf/pixbufscale.c: (pixbufscale_init):
rename element and debugging category to gdkpixbufscale
This commit is contained in:
Benjamin Otte 2004-05-16 16:06:42 +00:00
parent 0640f43362
commit fe680690c1
2 changed files with 23 additions and 7 deletions

View file

@ -1,3 +1,11 @@
2004-05-16 Benjamin Otte <otte@gnome.org>
* ext/alsa/gstalsasink.c: (gst_alsa_sink_loop):
compute correct expected timestamps after seek (broken since
last commit)
* ext/gdk_pixbuf/pixbufscale.c: (pixbufscale_init):
rename element and debugging category to gdkpixbufscale
2004-05-16 Benjamin Otte <otte@gnome.org> 2004-05-16 Benjamin Otte <otte@gnome.org>
* ext/alsa/gstalsasink.c: (gst_alsa_sink_loop): * ext/alsa/gstalsasink.c: (gst_alsa_sink_loop):

View file

@ -229,7 +229,6 @@ gst_alsa_sink_check_event (GstAlsaSink * sink, gint pad_nr)
"couldn't extract time from discont event. Bad things might happen!"); "couldn't extract time from discont event. Bad things might happen!");
} }
break; break;
} }
default: default:
@ -371,19 +370,28 @@ sink_restart:
gst_alsa_timestamp_to_samples (this, gst_alsa_timestamp_to_samples (this,
GST_BUFFER_TIMESTAMP (sink->buf[i])); GST_BUFFER_TIMESTAMP (sink->buf[i]));
max_discont = gst_alsa_timestamp_to_samples (this, this->max_discont); max_discont = gst_alsa_timestamp_to_samples (this, this->max_discont);
if (snd_pcm_delay (this->handle, &sample_diff) != 0) {
sample_diff = 0;
}
/* optimization: check if we're using our own clock /* optimization: check if we're using our own clock
* This optimization is important because if we're using our own clock * This optimization is important because if we're using our own clock
* gst_element_get_time calls snd_pcm_delay and the following code assumes * gst_element_get_time calls snd_pcm_delay and the following code assumes
* that both calls return the same value. However they can be wildly * that both calls return the same value. However they can be wildly
* different, since snd_pcm_delay goes deep into the kernel. * different, since snd_pcm_delay goes deep into the kernel.
*/ */
if (gst_element_get_clock (GST_ELEMENT (this)) == if (gst_element_get_clock (element) == GST_CLOCK (this->clock)) {
GST_CLOCK (GST_ALSA (this)->clock)) { /* FIXME: this is ugly because of the variables it uses but I don't know a
expected = this->transmitted; * better way to get this info */
if (element->base_time > this->clock->start_time) {
expected =
this->transmitted - gst_alsa_timestamp_to_samples (this,
element->base_time - this->clock->start_time);
} else { } else {
expected =
this->transmitted + gst_alsa_timestamp_to_samples (this,
this->clock->start_time - element->base_time);
}
} else {
if (snd_pcm_delay (this->handle, &sample_diff) != 0) {
sample_diff = 0;
}
expected = expected =
gst_alsa_timestamp_to_samples (this, gst_alsa_timestamp_to_samples (this,
gst_element_get_time (GST_ELEMENT (this))) + sample_diff; gst_element_get_time (GST_ELEMENT (this))) + sample_diff;