From: Martin Soto Date: Sun, 28 Nov 2004 13:35:44 +0000 (+0000) Subject: ext/alsa/: Make alsasink actually honor gst_element_set_clock and use that clock... X-Git-Tag: 1.19.3~511^2~13442 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a931717c2e2a617ddedce0f81b51d725c5b6e808;p=platform%2Fupstream%2Fgstreamer.git ext/alsa/: Make alsasink actually honor gst_element_set_clock and use that clock instead of ist internal one. Original commit message from CVS: 2004-11-28 Martin Soto * ext/alsa/gstalsasink.c (gst_alsa_sink_loop): * ext/alsa/gstalsa.h: * ext/alsa/gstalsa.c (gst_alsa_set_clock): Make alsasink actually honor gst_element_set_clock and use that clock instead of ist internal one. --- diff --git a/ChangeLog b/ChangeLog index cc3c43d..0996af1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-11-28 Martin Soto + + * ext/alsa/gstalsasink.c (gst_alsa_sink_loop): + * ext/alsa/gstalsa.h: + * ext/alsa/gstalsa.c (gst_alsa_set_clock): + Make alsasink actually honor gst_element_set_clock and use that + clock instead of ist internal one. + 2004-11-27 Christophe Fergeau * gst/playback/gstplaybasebin.c: (setup_source): fixed a caps leak diff --git a/ext/alsa/gstalsa.c b/ext/alsa/gstalsa.c index 7ff42c8..ab35db3 100644 --- a/ext/alsa/gstalsa.c +++ b/ext/alsa/gstalsa.c @@ -1213,7 +1213,9 @@ gst_alsa_get_clock (GstElement * element) static void gst_alsa_set_clock (GstElement * element, GstClock * clock) -{ /* we need this function just so everybody knows we use a clock */ +{ + /* we need this function just so everybody knows we use a clock */ + GST_ALSA (element)->ext_clock = clock; } /*** AUDIO PROCESSING *********************************************************/ diff --git a/ext/alsa/gstalsa.h b/ext/alsa/gstalsa.h index 35f930c..0c4cd2b 100644 --- a/ext/alsa/gstalsa.h +++ b/ext/alsa/gstalsa.h @@ -156,6 +156,7 @@ struct _GstAlsa { /* clocking */ GstAlsaClock * clock; /* our provided clock */ + GstClock * ext_clock; /* externally set clock. */ snd_pcm_uframes_t played; /* samples transmitted since last sync This thing actually is our master clock. We will event insert silent samples or diff --git a/ext/alsa/gstalsasink.c b/ext/alsa/gstalsasink.c index 09b8ac8..dd25d4a 100644 --- a/ext/alsa/gstalsasink.c +++ b/ext/alsa/gstalsasink.c @@ -405,7 +405,7 @@ sink_restart: * assumes that both calls return the same value. However they can be * wildly different, since snd_pcm_delay goes deep into the kernel. */ - if (gst_element_get_clock (element) == GST_CLOCK (this->clock)) { + if (this->ext_clock == GST_CLOCK (this->clock)) { /* FIXME: this is ugly because of the variables it uses but I * don't know a better way to get this info */ if (element->base_time > this->clock->start_time) {