mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
openslessink: Return 0 delay if the player object is in PAUSED state
This commit is contained in:
parent
7c3a9c2974
commit
e4810c3420
1 changed files with 9 additions and 6 deletions
|
@ -887,13 +887,16 @@ gst_opensles_ringbuffer_delay (GstRingBuffer * rb)
|
||||||
thiz = GST_OPENSLES_RING_BUFFER_CAST (rb);
|
thiz = GST_OPENSLES_RING_BUFFER_CAST (rb);
|
||||||
|
|
||||||
if (thiz->playerPlay) {
|
if (thiz->playerPlay) {
|
||||||
|
SLuint32 state;
|
||||||
SLmillisecond position;
|
SLmillisecond position;
|
||||||
guint64 playedpos, queuedpos;
|
guint64 playedpos = 0, queuedpos = 0;
|
||||||
|
(*thiz->playerPlay)->GetPlayState (thiz->playerPlay, &state);
|
||||||
(*thiz->playerPlay)->GetPosition (thiz->playerPlay, &position);
|
if (state == SL_PLAYSTATE_PLAYING) {
|
||||||
playedpos = gst_util_uint64_scale_round (position, rb->spec.rate, 1000);
|
(*thiz->playerPlay)->GetPosition (thiz->playerPlay, &position);
|
||||||
queuedpos = g_atomic_int_get (&thiz->segqueued) * rb->samples_per_seg;
|
playedpos = gst_util_uint64_scale_round (position, rb->spec.rate, 1000);
|
||||||
res = queuedpos - playedpos;
|
queuedpos = g_atomic_int_get (&thiz->segqueued) * rb->samples_per_seg;
|
||||||
|
res = queuedpos - playedpos;
|
||||||
|
}
|
||||||
|
|
||||||
GST_LOG_OBJECT (thiz, "queued samples %" G_GUINT64_FORMAT " position %u ms "
|
GST_LOG_OBJECT (thiz, "queued samples %" G_GUINT64_FORMAT " position %u ms "
|
||||||
"(%" G_GUINT64_FORMAT " samples) delay %u samples",
|
"(%" G_GUINT64_FORMAT " samples) delay %u samples",
|
||||||
|
|
Loading…
Reference in a new issue