Fix crash on seeking when using HW decoding in some cases.

This fix makes sure that we don't de-allocate the video buffer before
while the decoding thread is still working. We also don't throw
an misleading error when the decoding threads flushed the buffers
on seeking.
This commit is contained in:
Nils Hasenbanck 2020-02-04 21:29:35 +01:00
parent b1d56207e3
commit baf065b789

View file

@ -497,9 +497,6 @@ static void seek_frame(int seek_frames)
}
audio_frames = frame_cnt * media.sample_rate / media.interpolate_fps;
tpool_wait(tpool);
video_buffer_clear(video_buffer);
if (audio_decode_fifo)
fifo_clear(audio_decode_fifo);
scond_signal(fifo_decode_cond);
@ -512,7 +509,6 @@ static void seek_frame(int seek_frames)
}
slock_unlock(fifo_lock);
}
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)
{
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);
video_buffer_clear(video_buffer);
return;