[FFmpeg-cvslog] commit: Fix weird indent in get_video_frame(). (Stefano Sabatini )

git at videolan.org git
Sun Jan 16 18:34:44 CET 2011


ffmpeg | branch: master | Stefano Sabatini <stefano.sabatini-lala at poste.it> | Sun Jan 16 17:26:00 2011 +0000| [199c18a784ee6724453567aeb7d483ca2585f757] | committer: Stefano Sabatini 

Fix weird indent in get_video_frame().

Originally committed as revision 26390 to svn://svn.ffmpeg.org/ffmpeg/trunk

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

 ffplay.c |   80 +++++++++++++++++++++++++++++++-------------------------------
 1 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/ffplay.c b/ffplay.c
index 11a7ed1..6f476fc 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -1543,53 +1543,53 @@ static int get_video_frame(VideoState *is, AVFrame *frame, int64_t *pts, AVPacke
 {
     int len1, got_picture, i;
 
-        if (packet_queue_get(&is->videoq, pkt, 1) < 0)
-            return -1;
-
-        if(pkt->data == flush_pkt.data){
-            avcodec_flush_buffers(is->video_st->codec);
+    if (packet_queue_get(&is->videoq, pkt, 1) < 0)
+        return -1;
 
-            SDL_LockMutex(is->pictq_mutex);
-            //Make sure there are no long delay timers (ideally we should just flush the que but thats harder)
-            for(i=0; i<VIDEO_PICTURE_QUEUE_SIZE; i++){
-                is->pictq[i].target_clock= 0;
-            }
-            while (is->pictq_size && !is->videoq.abort_request) {
-                SDL_CondWait(is->pictq_cond, is->pictq_mutex);
-            }
-            is->video_current_pos= -1;
-            SDL_UnlockMutex(is->pictq_mutex);
+    if (pkt->data == flush_pkt.data) {
+        avcodec_flush_buffers(is->video_st->codec);
 
-            init_pts_correction(&is->pts_ctx);
-            is->frame_last_pts= AV_NOPTS_VALUE;
-            is->frame_last_delay = 0;
-            is->frame_timer = (double)av_gettime() / 1000000.0;
-            is->skip_frames= 1;
-            is->skip_frames_index= 0;
-            return 0;
+        SDL_LockMutex(is->pictq_mutex);
+        //Make sure there are no long delay timers (ideally we should just flush the que but thats harder)
+        for (i = 0; i < VIDEO_PICTURE_QUEUE_SIZE; i++) {
+            is->pictq[i].target_clock= 0;
         }
+        while (is->pictq_size && !is->videoq.abort_request) {
+            SDL_CondWait(is->pictq_cond, is->pictq_mutex);
+        }
+        is->video_current_pos = -1;
+        SDL_UnlockMutex(is->pictq_mutex);
 
-        /* NOTE: ipts is the PTS of the _first_ picture beginning in
-           this packet, if any */
-        is->video_st->codec->reordered_opaque= pkt->pts;
-        len1 = avcodec_decode_video2(is->video_st->codec,
-                                    frame, &got_picture,
-                                    pkt);
+        init_pts_correction(&is->pts_ctx);
+        is->frame_last_pts = AV_NOPTS_VALUE;
+        is->frame_last_delay = 0;
+        is->frame_timer = (double)av_gettime() / 1000000.0;
+        is->skip_frames = 1;
+        is->skip_frames_index = 0;
+        return 0;
+    }
 
-        if (got_picture) {
-            if (decoder_reorder_pts == -1) {
-                *pts = guess_correct_pts(&is->pts_ctx, frame->reordered_opaque, pkt->dts);
-            } else if (decoder_reorder_pts) {
-                *pts = frame->reordered_opaque;
-            } else {
-                *pts = pkt->dts;
-            }
+    /* NOTE: ipts is the PTS of the _first_ picture beginning in
+       this packet, if any */
+    is->video_st->codec->reordered_opaque = pkt->pts;
+    len1 = avcodec_decode_video2(is->video_st->codec,
+                                 frame, &got_picture,
+                                 pkt);
 
-            if (*pts == AV_NOPTS_VALUE) {
-                *pts = 0;
-            }
+    if (got_picture) {
+        if (decoder_reorder_pts == -1) {
+            *pts = guess_correct_pts(&is->pts_ctx, frame->reordered_opaque, pkt->dts);
+        } else if (decoder_reorder_pts) {
+            *pts = frame->reordered_opaque;
+        } else {
+            *pts = pkt->dts;
         }
 
+        if (*pts == AV_NOPTS_VALUE) {
+            *pts = 0;
+        }
+    }
+
 //            if (len1 < 0)
 //                break;
     if (got_picture){




More information about the ffmpeg-cvslog mailing list