changeset 4558:4d1b45b20f8c libavcodec

simplify release_buffer using FFSWAP
author aurel
date Wed, 21 Feb 2007 23:46:25 +0000
parents 6d4ac79304da
children 53ed3a394b4b
files utils.c
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/utils.c	Wed Feb 21 23:32:13 2007 +0000
+++ b/utils.c	Wed Feb 21 23:46:25 2007 +0000
@@ -333,7 +333,7 @@
 
 void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic){
     int i;
-    InternalBuffer *buf, *last, temp;
+    InternalBuffer *buf, *last;
 
     assert(pic->type==FF_BUFFER_TYPE_INTERNAL);
     assert(s->internal_buffer_count);
@@ -348,9 +348,7 @@
     s->internal_buffer_count--;
     last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count];
 
-    temp= *buf;
-    *buf= *last;
-    *last= temp;
+    FFSWAP(InternalBuffer, *buf, *last);
 
     for(i=0; i<3; i++){
         pic->data[i]=NULL;