mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-23 06:26:23 +00:00
alsasrc: Make using driver timestamps possible
https://bugzilla.gnome.org/show_bug.cgi?id=699744
This commit is contained in:
parent
0bc25f0325
commit
a049b102da
2 changed files with 13 additions and 9 deletions
|
@ -224,7 +224,6 @@ static GstStateChangeReturn
|
|||
gst_alsasrc_change_state (GstElement * element, GstStateChange transition)
|
||||
{
|
||||
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
|
||||
GstAudioBaseSrc *src = GST_AUDIO_BASE_SRC (element);
|
||||
GstAlsaSrc *alsa = GST_ALSA_SRC (element);
|
||||
GstClock *clk;
|
||||
|
||||
|
@ -238,15 +237,20 @@ gst_alsasrc_change_state (GstElement * element, GstStateChange transition)
|
|||
break;
|
||||
|
||||
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
|
||||
clk = src->clock;
|
||||
alsa->driver_timestamps = FALSE;
|
||||
if (GST_IS_SYSTEM_CLOCK (clk)) {
|
||||
gint clocktype;
|
||||
g_object_get (clk, "clock-type", &clocktype, NULL);
|
||||
if (clocktype == GST_CLOCK_TYPE_MONOTONIC) {
|
||||
GST_INFO ("Using driver timestamps !");
|
||||
alsa->driver_timestamps = TRUE;
|
||||
|
||||
clk = gst_element_get_clock (element);
|
||||
if (clk != NULL) {
|
||||
if (GST_IS_SYSTEM_CLOCK (clk)) {
|
||||
gint clocktype;
|
||||
g_object_get (clk, "clock-type", &clocktype, NULL);
|
||||
if (clocktype == GST_CLOCK_TYPE_MONOTONIC) {
|
||||
GST_INFO ("Using driver timestamps !");
|
||||
alsa->driver_timestamps = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
gst_object_unref (clk);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -869,7 +869,7 @@ gst_audio_base_src_create (GstBaseSrc * bsrc, guint64 offset, guint length,
|
|||
if (!(clock = GST_ELEMENT_CLOCK (src)))
|
||||
goto no_sync;
|
||||
|
||||
if (clock != src->clock) {
|
||||
if (!GST_CLOCK_TIME_IS_VALID (rb_timestamp) && clock != src->clock) {
|
||||
/* we are slaved, check how to handle this */
|
||||
switch (src->priv->slave_method) {
|
||||
case GST_AUDIO_BASE_SRC_SLAVE_RESAMPLE:
|
||||
|
|
Loading…
Reference in a new issue