mirror of
https://github.com/wang-bin/QtAV.git
synced 2026-10-26 01:59:31 +08:00
pause avthread after seek finished
This commit is contained in:
+8
-7
@@ -87,13 +87,14 @@ void AudioThread::run()
|
||||
int sync_id = 0;
|
||||
while (!d.stop) {
|
||||
processNextTask();
|
||||
//TODO: why put it at the end of loop then playNextFrame() not work?
|
||||
if (tryPause()) { //DO NOT continue, or playNextFrame() will fail
|
||||
if (d.stop)
|
||||
break; //the queue is empty and may block. should setBlocking(false) wake up cond empty?
|
||||
} else {
|
||||
if (isPaused())
|
||||
continue;
|
||||
if (d.render_pts0 < 0) { // no pause when seeking
|
||||
if (tryPause()) { //DO NOT continue, or stepForward() will fail
|
||||
if (d.stop)
|
||||
break; //the queue is empty and may block. should setBlocking(false) wake up cond empty?
|
||||
} else {
|
||||
if (isPaused())
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (d.seek_requested) {
|
||||
d.seek_requested = false;
|
||||
|
||||
Reference in New Issue
Block a user