Commit 0a1cf662 authored by Marton Balint's avatar Marton Balint Committed by Michael Niedermayer

ffplay: fix a crash caused by aborting the video queue

If the video queue is aborted, we have to pop the pending ALLOC event or wait
for the allocation to complete, because the current code assumes that
VideoState->pictq_windex does not change until the allocation is complete.
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 8af9366e
......@@ -1356,6 +1356,12 @@ static int queue_picture(VideoState *is, AVFrame *src_frame, double pts1, int64_
while (!vp->allocated && !is->videoq.abort_request) {
SDL_CondWait(is->pictq_cond, is->pictq_mutex);
}
/* if the queue is aborted, we have to pop the pending ALLOC event or wait for the allocation to complete */
if (is->videoq.abort_request && SDL_PeepEvents(&event, 1, SDL_GETEVENT, SDL_EVENTMASK(FF_ALLOC_EVENT)) != 1) {
while (!vp->allocated) {
SDL_CondWait(is->pictq_cond, is->pictq_mutex);
}
}
SDL_UnlockMutex(is->pictq_mutex);
if (is->videoq.abort_request)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment