mirror of
https://github.com/wang-bin/QtAV.git
synced 2026-10-26 10:10:28 +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;
|
||||
|
||||
+7
-5
@@ -295,11 +295,13 @@ void VideoThread::run()
|
||||
processNextTask();
|
||||
//TODO: why put it at the end of loop then stepForward() not work?
|
||||
//processNextTask tryPause(timeout) and and continue outter loop
|
||||
if (tryPause()) { //DO NOT continue, or stepForward() will fail
|
||||
if (d.render_pts0 < 0) { // no pause when seeking
|
||||
if (tryPause()) { //DO NOT continue, or stepForward() will fail
|
||||
|
||||
} else {
|
||||
if (isPaused())
|
||||
continue; //timeout. process pending tasks
|
||||
} else {
|
||||
if (isPaused())
|
||||
continue; //timeout. process pending tasks
|
||||
}
|
||||
}
|
||||
if (d.seek_requested) {
|
||||
d.seek_requested = false;
|
||||
@@ -344,7 +346,7 @@ void VideoThread::run()
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (pkt.pts <= 0) {
|
||||
if (pkt.pts <= 0 && !pkt.isEOF() && pkt.data.size() > 0) {
|
||||
nb_no_pts++;
|
||||
} else {
|
||||
nb_no_pts = 0;
|
||||
|
||||
Reference in New Issue
Block a user