mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-14 11:21:29 +00:00
ffplay: use framedrop by default when sync is not done to video
When using external sync, framedrop is perfectly fine. Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
parent
d7b8a9a589
commit
da56955621
4
ffplay.c
4
ffplay.c
@ -1217,7 +1217,7 @@ retry:
|
|||||||
if (is->pictq_size > 1) {
|
if (is->pictq_size > 1) {
|
||||||
VideoPicture *nextvp = &is->pictq[(is->pictq_rindex + 1) % VIDEO_PICTURE_QUEUE_SIZE];
|
VideoPicture *nextvp = &is->pictq[(is->pictq_rindex + 1) % VIDEO_PICTURE_QUEUE_SIZE];
|
||||||
duration = nextvp->pts - vp->pts;
|
duration = nextvp->pts - vp->pts;
|
||||||
if((framedrop>0 || (framedrop && is->audio_st)) && time > is->frame_timer + duration){
|
if((framedrop>0 || (framedrop && is->av_sync_type != AV_SYNC_VIDEO_MASTER)) && time > is->frame_timer + duration){
|
||||||
is->frame_drops_late++;
|
is->frame_drops_late++;
|
||||||
pictq_next_picture(is);
|
pictq_next_picture(is);
|
||||||
goto retry;
|
goto retry;
|
||||||
@ -1535,7 +1535,7 @@ static int get_video_frame(VideoState *is, AVFrame *frame, int64_t *pts, AVPacke
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (((is->av_sync_type == AV_SYNC_AUDIO_MASTER && is->audio_st) || is->av_sync_type == AV_SYNC_EXTERNAL_CLOCK) &&
|
if (((is->av_sync_type == AV_SYNC_AUDIO_MASTER && is->audio_st) || is->av_sync_type == AV_SYNC_EXTERNAL_CLOCK) &&
|
||||||
(framedrop>0 || (framedrop && is->audio_st))) {
|
(framedrop>0 || (framedrop && is->av_sync_type != AV_SYNC_VIDEO_MASTER))) {
|
||||||
SDL_LockMutex(is->pictq_mutex);
|
SDL_LockMutex(is->pictq_mutex);
|
||||||
if (is->frame_last_pts != AV_NOPTS_VALUE && *pts) {
|
if (is->frame_last_pts != AV_NOPTS_VALUE && *pts) {
|
||||||
double clockdiff = get_video_clock(is) - get_master_clock(is);
|
double clockdiff = get_video_clock(is) - get_master_clock(is);
|
||||||
|
Loading…
Reference in New Issue
Block a user