4xm: simplify code with FFSWAP
authorAnton Khirnov <anton@khirnov.net>
Tue, 13 Nov 2012 20:57:13 +0000 (21:57 +0100)
committerAnton Khirnov <anton@khirnov.net>
Sun, 6 Jan 2013 12:31:39 +0000 (13:31 +0100)
libavcodec/4xm.c

index 304dfc0c13a84789541fd47e05221bb007aa8657..446c085f1bc6bdbe0443a2e05da3458e682a9e3f 100644 (file)
@@ -760,7 +760,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
     int buf_size          = avpkt->size;
     FourXContext *const f = avctx->priv_data;
     AVFrame *picture      = data;
-    AVFrame *p, temp;
+    AVFrame *p;
     int i, frame_4cc, frame_size, ret;
 
     frame_4cc = AV_RL32(buf);
@@ -821,9 +821,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
         frame_size = buf_size - 12;
     }
 
-    temp               = f->current_picture;
-    f->current_picture = f->last_picture;
-    f->last_picture    = temp;
+    FFSWAP(AVFrame, f->current_picture, f->last_picture);
 
     p                  = &f->current_picture;
     avctx->coded_frame = p;