diff rv10.c @ 3185:333e016c2c8a libavcodec

cleanup picture / debug output code
author michael
date Fri, 10 Mar 2006 20:40:52 +0000
parents 8d1b2cc2a75b
children 525c73deb1d5
line wrap: on
line diff
--- a/rv10.c	Fri Mar 10 19:42:51 2006 +0000
+++ b/rv10.c	Fri Mar 10 20:40:52 2006 +0000
@@ -741,15 +741,16 @@
         ff_er_frame_end(s);
         MPV_frame_end(s);
 
-        if(s->pict_type==B_TYPE || s->low_delay){
-            *pict= *(AVFrame*)&s->current_picture;
-            ff_print_debug_info(s, pict);
-        } else {
-            *pict= *(AVFrame*)&s->last_picture;
+        if (s->pict_type == B_TYPE || s->low_delay) {
+            *pict= *(AVFrame*)s->current_picture_ptr;
+        } else if (s->last_picture_ptr != NULL) {
+            *pict= *(AVFrame*)s->last_picture_ptr;
+        }
+
+        if(s->last_picture_ptr || s->low_delay){
+            *data_size = sizeof(AVFrame);
             ff_print_debug_info(s, pict);
         }
-        if(s->last_picture_ptr || s->low_delay)
-            *data_size = sizeof(AVFrame);
         s->current_picture_ptr= NULL; //so we can detect if frame_end wasnt called (find some nicer solution...)
     }