changeset 5081:46c9abb46638 libavcodec

Do proper frame swapping so VMD video decoder works again
author kostya
date Tue, 29 May 2007 16:43:25 +0000
parents e72265f4e518
children 176ac8353f48
files vmdav.c
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/vmdav.c	Tue May 29 15:01:33 2007 +0000
+++ b/vmdav.c	Tue May 29 16:43:25 2007 +0000
@@ -380,14 +380,13 @@
     /* make the palette available on the way out */
     memcpy(s->frame.data[1], s->palette, PALETTE_COUNT * 4);
 
-    if (s->prev_frame.data[0])
-        avctx->release_buffer(avctx, &s->prev_frame);
-
     /* shuffle frames */
-    s->prev_frame = s->frame;
+    FFSWAP(AVFrame, s->frame, s->prev_frame);
+    if (s->frame.data[0])
+        avctx->release_buffer(avctx, &s->frame);
 
     *data_size = sizeof(AVFrame);
-    *(AVFrame*)data = s->frame;
+    *(AVFrame*)data = s->prev_frame;
 
     /* report that the buffer was completely consumed */
     return buf_size;