bluez5: media-sink: resync ISO streams on playback start

Resynchronize ISO streams on playback (re)start, so the stream positions
are aligned immediately.  This is better than relying on rate matching
to correct any offsets.
This commit is contained in:
Pauli Virtanen 2023-04-09 19:53:42 +03:00 committed by Wim Taymans
parent 261fb64849
commit 5d1782760c
3 changed files with 49 additions and 33 deletions

View file

@ -157,9 +157,8 @@ static void group_on_timeout(struct spa_source *source)
if (!stream->sink)
continue;
if (stream->idle)
continue;
if (group->paused) {
if (stream->idle || group->paused) {
stream->this.resync = true;
stream->this.size = 0;
continue;
}
@ -355,13 +354,10 @@ void spa_bt_iso_io_set_cb(struct spa_bt_iso_io *this, spa_bt_iso_io_pull_t pull,
set_timers(stream->group);
stream->idle = true;
stream->this.resync = true;
if (pull == NULL) {
stream->this.size = 0;
return;
}
/* Pull data now for the next interval */
stream->this.now = stream->group->next;
stream->pull(&stream->this);
}