[FFmpeg-cvslog] ffplay: factorize code calling output_packet() in video_thread()

Stefano Sabatini git at videolan.org
Sat Apr 23 12:52:21 CEST 2011


ffmpeg | branch: master | Stefano Sabatini <stefano.sabatini-lala at poste.it> | Fri Apr 22 11:09:48 2011 +0200| [539647c6ffa9c39f60cee41e1eb79e491bc4f4c5] | committer: Stefano Sabatini

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

Slightly simplify.

Signed-off-by: Stefano Sabatini <stefano.sabatini-lala at poste.it>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=539647c6ffa9c39f60cee41e1eb79e491bc4f4c5
---

 ffplay.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/ffplay.c b/ffplay.c
index f97d97f..eb08f36 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -1803,14 +1803,13 @@ static int video_thread(void *arg)
 {
     VideoState *is = arg;
     AVFrame *frame= avcodec_alloc_frame();
-    int64_t pts_int;
+    int64_t pts_int, pos;
     double pts;
     int ret;
 
 #if CONFIG_AVFILTER
     AVFilterGraph *graph = avfilter_graph_alloc();
     AVFilterContext *filt_out = NULL;
-    int64_t pos;
 
     if ((ret = configure_video_filters(graph, is, vfilters)) < 0)
         goto the_end;
@@ -1844,6 +1843,7 @@ static int video_thread(void *arg)
         }
 #else
         ret = get_video_frame(is, frame, &pts_int, &pkt);
+        pos = pkt.pos;
 #endif
 
         if (ret < 0) goto the_end;
@@ -1853,10 +1853,8 @@ static int video_thread(void *arg)
 
         pts = pts_int*av_q2d(is->video_st->time_base);
 
-#if CONFIG_AVFILTER
         ret = output_picture(is, frame, pts, pos);
-#else
-        ret = output_picture(is, frame, pts,  pkt.pos);
+#if !CONFIG_AVFILTER
         av_free_packet(&pkt);
 #endif
         if (ret < 0)



More information about the ffmpeg-cvslog mailing list