mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-19 20:46:22 +00:00
audiobasesrc: Always resync the ringbuffer on the first buffer
In SKEW mode, use next_sample == -1 to check for the first sample when starting to read samples so it resyncs the ringbuffer and timestamps are ok. Suggestion from Teemu Katajisto <teemu.katajisto@digia.com> https://bugzilla.gnome.org/show_bug.cgi?id=648359
This commit is contained in:
parent
53072a4326
commit
929edc2572
1 changed files with 2 additions and 1 deletions
|
@ -766,6 +766,7 @@ gst_audio_base_src_create (GstBaseSrc * bsrc, guint64 offset, guint length,
|
||||||
GstClockTime rb_timestamp = GST_CLOCK_TIME_NONE;
|
GstClockTime rb_timestamp = GST_CLOCK_TIME_NONE;
|
||||||
GstClock *clock;
|
GstClock *clock;
|
||||||
gboolean first;
|
gboolean first;
|
||||||
|
gboolean first_sample = src->next_sample == -1;
|
||||||
|
|
||||||
ringbuffer = src->ringbuffer;
|
ringbuffer = src->ringbuffer;
|
||||||
spec = &ringbuffer->spec;
|
spec = &ringbuffer->spec;
|
||||||
|
@ -938,7 +939,7 @@ gst_audio_base_src_create (GstBaseSrc * bsrc, guint64 offset, guint length,
|
||||||
* the first time we are ran.
|
* the first time we are ran.
|
||||||
*/
|
*/
|
||||||
if ((segment_skew >= ringbuffer->spec.segtotal) ||
|
if ((segment_skew >= ringbuffer->spec.segtotal) ||
|
||||||
(last_read_segment == 0)) {
|
(last_read_segment == 0) || first_sample) {
|
||||||
gint new_read_segment;
|
gint new_read_segment;
|
||||||
gint segment_diff;
|
gint segment_diff;
|
||||||
guint64 new_sample;
|
guint64 new_sample;
|
||||||
|
|
Loading…
Reference in a new issue