[Ffmpeg-cvslog] CVS: ffmpeg/libavcodec h263dec.c, 1.176, 1.177 rv10.c, 1.78, 1.79 vc9.c, 1.27, 1.28

Michael Niedermayer CVS michael
Fri Mar 10 21:40:54 CET 2006


Update of /cvsroot/ffmpeg/ffmpeg/libavcodec
In directory mail:/var2/tmp/cvs-serv17618

Modified Files:
	h263dec.c rv10.c vc9.c 
Log Message:
cleanup picture / debug output code


Index: h263dec.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/h263dec.c,v
retrieving revision 1.176
retrieving revision 1.177
diff -u -d -r1.176 -r1.177
--- h263dec.c	8 Mar 2006 11:43:08 -0000	1.176
+++ h263dec.c	10 Mar 2006 20:40:52 -0000	1.177
@@ -766,22 +766,21 @@
 
 assert(s->current_picture.pict_type == s->current_picture_ptr->pict_type);
 assert(s->current_picture.pict_type == s->pict_type);
-    if(s->pict_type==B_TYPE || s->low_delay){
-        *pict= *(AVFrame*)&s->current_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);
-    } else {
-        *pict= *(AVFrame*)&s->last_picture;
-        if(pict)
-            ff_print_debug_info(s, pict);
     }
 
     /* Return the Picture timestamp as the frame number */
     /* we substract 1 because it is added on utils.c    */
     avctx->frame_number = s->picture_number - 1;
 
-    /* don't output the last pic after seeking */
-    if(s->last_picture_ptr || s->low_delay)
-        *data_size = sizeof(AVFrame);
 #ifdef PRINT_FRAME_TIME
 av_log(avctx, AV_LOG_DEBUG, "%Ld\n", rdtsc()-time);
 #endif

Index: rv10.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/rv10.c,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- rv10.c	8 Mar 2006 11:43:09 -0000	1.78
+++ rv10.c	10 Mar 2006 20:40:52 -0000	1.79
@@ -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;
-            ff_print_debug_info(s, pict);
+        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)
+
+        if(s->last_picture_ptr || s->low_delay){
             *data_size = sizeof(AVFrame);
+            ff_print_debug_info(s, pict);
+        }
         s->current_picture_ptr= NULL; //so we can detect if frame_end wasnt called (find some nicer solution...)
     }
 

Index: vc9.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/vc9.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- vc9.c	30 Jan 2006 23:33:18 -0000	1.27
+++ vc9.c	10 Mar 2006 20:40:52 -0000	1.28
@@ -2606,23 +2606,22 @@
 
     assert(s->current_picture.pict_type == s->current_picture_ptr->pict_type);
     assert(s->current_picture.pict_type == s->pict_type);
-    if(s->pict_type==B_TYPE || s->low_delay){
-        *pict= *(AVFrame*)&s->current_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);
-    } else {
-        *pict= *(AVFrame*)&s->last_picture;
-        if(pict)
-            ff_print_debug_info(s, pict);
     }
 
     /* Return the Picture timestamp as the frame number */
     /* we substract 1 because it is added on utils.c    */
     avctx->frame_number = s->picture_number - 1;
 
-    /* dont output the last pic after seeking */
-    if(s->last_picture_ptr || s->low_delay)
-        *data_size = sizeof(AVFrame);
-
     av_log(avctx, AV_LOG_DEBUG, "Consumed %i/%i bits\n",
            get_bits_count(&s->gb), buf_size*8);
 





More information about the ffmpeg-cvslog mailing list