ffmpeg-tutorial icon indicating copy to clipboard operation
ffmpeg-tutorial copied to clipboard

Tuto7 : Async after seeking backwards

Open kherounts opened this issue 10 years ago • 2 comments

Hi The image and the audio are not synchronized anymore, once seeked backwards. The image seems to be in the correct position unlike the audio. However, the video becomes synchronized subsequently being seeked forwards once. Do you have any idea how to resolve this problem?

kherounts avatar Jul 09 '15 11:07 kherounts

Finally I found the solution. In the seek part of decode_thread() I changed :

if(is->audioStream >= 0) {
packet_queue_flush(&is->audioq);
packet_queue_put(&is->audioq, &flush_pkt);
}
if(is->videoStream >= 0) {
packet_queue_flush(&is->videoq);
packet_queue_put(&is->videoq, &flush_pkt);
}

to :

if(is->videoStream >= 0) {
packet_queue_flush(&is->videoq);
packet_queue_put(&is->videoq, &flush_pkt);
}
else if(is->audioStream >= 0) {
packet_queue_flush(&is->audioq);
packet_queue_put(&is->audioq, &flush_pkt);
}

kherounts avatar Jul 31 '15 13:07 kherounts

Can you push your changes?

mpenkov avatar Aug 03 '15 14:08 mpenkov