pause avthread after seek finished

This commit is contained in:
wang-bin
2016-02-03 19:41:43 +08:00
parent 5a3af9b503
commit ccf3bd3ca4
2 changed files with 15 additions and 12 deletions
+8 -7
View File
@@ -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;