mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
ffplay: avoid code duplication in AVFILTER enabled and disabled case
Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
parent
87434cf373
commit
105d4748cf
11
ffplay.c
11
ffplay.c
@ -1911,6 +1911,7 @@ static int video_thread(void *arg)
|
|||||||
double pts;
|
double pts;
|
||||||
int ret;
|
int ret;
|
||||||
int serial = 0;
|
int serial = 0;
|
||||||
|
AVRational tb = is->video_st->time_base;
|
||||||
|
|
||||||
#if CONFIG_AVFILTER
|
#if CONFIG_AVFILTER
|
||||||
AVFilterGraph *graph = avfilter_graph_alloc();
|
AVFilterGraph *graph = avfilter_graph_alloc();
|
||||||
@ -1984,15 +1985,13 @@ static int video_thread(void *arg)
|
|||||||
is->frame_last_filter_delay = av_gettime() / 1000000.0 - is->frame_last_returned_time;
|
is->frame_last_filter_delay = av_gettime() / 1000000.0 - is->frame_last_returned_time;
|
||||||
if (fabs(is->frame_last_filter_delay) > AV_NOSYNC_THRESHOLD / 10.0)
|
if (fabs(is->frame_last_filter_delay) > AV_NOSYNC_THRESHOLD / 10.0)
|
||||||
is->frame_last_filter_delay = 0;
|
is->frame_last_filter_delay = 0;
|
||||||
|
tb = filt_out->inputs[0]->time_base;
|
||||||
pts = (frame->pts == AV_NOPTS_VALUE) ? NAN : frame->pts * av_q2d(filt_out->inputs[0]->time_base);
|
#endif
|
||||||
|
pts = (frame->pts == AV_NOPTS_VALUE) ? NAN : frame->pts * av_q2d(tb);
|
||||||
ret = queue_picture(is, frame, pts, av_frame_get_pkt_pos(frame), serial);
|
ret = queue_picture(is, frame, pts, av_frame_get_pkt_pos(frame), serial);
|
||||||
av_frame_unref(frame);
|
av_frame_unref(frame);
|
||||||
|
#if CONFIG_AVFILTER
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
pts = (frame->pts == AV_NOPTS_VALUE) ? NAN : frame->pts * av_q2d(is->video_st->time_base);
|
|
||||||
ret = queue_picture(is, frame, pts, av_frame_get_pkt_pos(frame), serial);
|
|
||||||
av_frame_unref(frame);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user