mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
audioringbuffer: check if acquired in set_timestamp
Also use GST_OBJECT_LOCK when accessing object data in set_timestamp. https://bugzilla.gnome.org/show_bug.cgi?id=702230
This commit is contained in:
parent
f330c01412
commit
09d628f8f1
1 changed files with 15 additions and 4 deletions
|
@ -1984,9 +1984,20 @@ gst_audio_ring_buffer_set_timestamp (GstAudioRingBuffer * buf, gint readseg,
|
||||||
|
|
||||||
GST_INFO_OBJECT (buf, "Storing timestamp %" GST_TIME_FORMAT
|
GST_INFO_OBJECT (buf, "Storing timestamp %" GST_TIME_FORMAT
|
||||||
" @ %d", GST_TIME_ARGS (timestamp), readseg);
|
" @ %d", GST_TIME_ARGS (timestamp), readseg);
|
||||||
if (buf->timestamps) {
|
|
||||||
buf->timestamps[readseg] = timestamp;
|
GST_OBJECT_LOCK (buf);
|
||||||
} else {
|
if (G_UNLIKELY (!buf->acquired))
|
||||||
GST_ERROR_OBJECT (buf, "Could not store timestamp, no timestamps buffer");
|
goto not_acquired;
|
||||||
|
|
||||||
|
buf->timestamps[readseg] = timestamp;
|
||||||
|
|
||||||
|
done:
|
||||||
|
GST_OBJECT_UNLOCK (buf);
|
||||||
|
return;
|
||||||
|
|
||||||
|
not_acquired:
|
||||||
|
{
|
||||||
|
GST_DEBUG_OBJECT (buf, "we are not acquired");
|
||||||
|
goto done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue