Commit 539647c6 authored by Stefano Sabatini's avatar Stefano Sabatini

ffplay: factorize code calling output_packet() in video_thread()

Slightly simplify.
Signed-off-by: 's avatarStefano Sabatini <stefano.sabatini-lala@poste.it>
parent c632a1c2
...@@ -1803,14 +1803,13 @@ static int video_thread(void *arg) ...@@ -1803,14 +1803,13 @@ static int video_thread(void *arg)
{ {
VideoState *is = arg; VideoState *is = arg;
AVFrame *frame= avcodec_alloc_frame(); AVFrame *frame= avcodec_alloc_frame();
int64_t pts_int; int64_t pts_int, pos;
double pts; double pts;
int ret; int ret;
#if CONFIG_AVFILTER #if CONFIG_AVFILTER
AVFilterGraph *graph = avfilter_graph_alloc(); AVFilterGraph *graph = avfilter_graph_alloc();
AVFilterContext *filt_out = NULL; AVFilterContext *filt_out = NULL;
int64_t pos;
if ((ret = configure_video_filters(graph, is, vfilters)) < 0) if ((ret = configure_video_filters(graph, is, vfilters)) < 0)
goto the_end; goto the_end;
...@@ -1844,6 +1843,7 @@ static int video_thread(void *arg) ...@@ -1844,6 +1843,7 @@ static int video_thread(void *arg)
} }
#else #else
ret = get_video_frame(is, frame, &pts_int, &pkt); ret = get_video_frame(is, frame, &pts_int, &pkt);
pos = pkt.pos;
#endif #endif
if (ret < 0) goto the_end; if (ret < 0) goto the_end;
...@@ -1853,10 +1853,8 @@ static int video_thread(void *arg) ...@@ -1853,10 +1853,8 @@ static int video_thread(void *arg)
pts = pts_int*av_q2d(is->video_st->time_base); pts = pts_int*av_q2d(is->video_st->time_base);
#if CONFIG_AVFILTER
ret = output_picture(is, frame, pts, pos); ret = output_picture(is, frame, pts, pos);
#else #if !CONFIG_AVFILTER
ret = output_picture(is, frame, pts, pkt.pos);
av_free_packet(&pkt); av_free_packet(&pkt);
#endif #endif
if (ret < 0) if (ret < 0)
......
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