diff options
author | Marton Balint <cus@passwd.hu> | 2013-11-24 22:51:13 +0100 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2013-12-06 19:57:44 +0100 |
commit | 318bf57c3fb89a96008b114731e59063301ad6d1 (patch) | |
tree | 8b1eff4a85efb23a86471d3d57b9eb72d5f0772c /ffplay.c | |
parent | 90539cea336fd513c47295a03c164cb4a851166f (diff) | |
download | ffmpeg-318bf57c3fb89a96008b114731e59063301ad6d1.tar.gz |
ffplay: do not wait for flushing the picture queue on flush packet
It is no longer necessary. Also do frame timer and video current pos reset in
the main thread because with the wait removed, the timing would not be optimal
in the read thread.
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'ffplay.c')
-rw-r--r-- | ffplay.c | 13 |
1 files changed, 4 insertions, 9 deletions
@@ -1376,10 +1376,14 @@ retry: if (vp->serial != is->videoq.serial) { pictq_next_picture(is); + is->video_current_pos = -1; redisplay = 0; goto retry; } + if (lastvp->serial != vp->serial && !redisplay) + is->frame_timer = av_gettime() / 1000000.0; + if (is->paused) goto display; @@ -1670,15 +1674,6 @@ static int get_video_frame(VideoState *is, AVFrame *frame, AVPacket *pkt, int *s if (pkt->data == flush_pkt.data) { avcodec_flush_buffers(is->video_st->codec); - - SDL_LockMutex(is->pictq_mutex); - // Make sure there are no long delay timers (ideally we should just flush the queue but that's harder) - while (is->pictq_size && !is->videoq.abort_request) { - SDL_CondWait(is->pictq_cond, is->pictq_mutex); - } - is->video_current_pos = -1; - is->frame_timer = (double)av_gettime() / 1000000.0; - SDL_UnlockMutex(is->pictq_mutex); return 0; } |