mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
openslesringbuffer: Warn if the position reported by OpenSL is higher than what we queued up so far
This would hint at wrong position reporting, and apparently sometimes happens after a seek.
This commit is contained in:
parent
a032347c77
commit
0acdcc1b37
1 changed files with 8 additions and 1 deletions
|
@ -973,8 +973,15 @@ gst_opensles_ringbuffer_delay (GstAudioRingBuffer * rb)
|
|||
playedpos =
|
||||
gst_util_uint64_scale_round (position, rb->spec.info.rate, 1000);
|
||||
queuedpos = g_atomic_int_get (&thiz->segqueued) * rb->samples_per_seg;
|
||||
if (queuedpos < playedpos) {
|
||||
res = 0;
|
||||
GST_ERROR_OBJECT (thiz,
|
||||
"Queued position smaller than playback position (%" G_GUINT64_FORMAT
|
||||
" < %" G_GUINT64_FORMAT ")", queuedpos, playedpos);
|
||||
} else {
|
||||
res = queuedpos - playedpos;
|
||||
}
|
||||
}
|
||||
|
||||
GST_LOG_OBJECT (thiz, "queued samples %" G_GUINT64_FORMAT " position %u ms "
|
||||
"(%" G_GUINT64_FORMAT " samples) delay %u samples",
|
||||
|
|
Loading…
Reference in a new issue