Merge pull request #10100 from hasenbanck/fix-ffmpeg-seek

Fix crash on seeking when using HW decoding in some cases.
This commit is contained in:
Twinaphex 2020-02-05 02:31:06 +01:00 committed by GitHub
commit 0b7edbad28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -497,9 +497,6 @@ static void seek_frame(int seek_frames)
} }
audio_frames = frame_cnt * media.sample_rate / media.interpolate_fps; audio_frames = frame_cnt * media.sample_rate / media.interpolate_fps;
tpool_wait(tpool);
video_buffer_clear(video_buffer);
if (audio_decode_fifo) if (audio_decode_fifo)
fifo_clear(audio_decode_fifo); fifo_clear(audio_decode_fifo);
scond_signal(fifo_decode_cond); scond_signal(fifo_decode_cond);
@ -512,7 +509,6 @@ static void seek_frame(int seek_frames)
} }
slock_unlock(fifo_lock); slock_unlock(fifo_lock);
} }
void CORE_PREFIX(retro_run)(void) void CORE_PREFIX(retro_run)(void)
@ -1363,7 +1359,8 @@ static void decode_video(AVCodecContext *ctx, AVPacket *pkt, size_t frame_size)
{ {
if (main_sleeping) if (main_sleeping)
{ {
log_cb(RETRO_LOG_ERROR, "[FFMPEG] Thread: Video deadlock detected.\n"); if (!do_seek)
log_cb(RETRO_LOG_ERROR, "[FFMPEG] Thread: Video deadlock detected.\n");
tpool_wait(tpool); tpool_wait(tpool);
video_buffer_clear(video_buffer); video_buffer_clear(video_buffer);
return; return;