---
 libavcodec/avcodec.h     |    1 +
 libavcodec/framethread.c |    2 ++
 libavcodec/utils.c       |    4 ++++
 3 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 71bf15a..80e7966 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1466,6 +1466,7 @@ typedef struct AVCodecContext {
 #define FF_DEBUG_BUGS        0x00001000
 #define FF_DEBUG_VIS_QP      0x00002000
 #define FF_DEBUG_VIS_MB_TYPE 0x00004000
+#define FF_DEBUG_BUFFER      0x00008000
 
     /**
      * debug
diff --git a/libavcodec/framethread.c b/libavcodec/framethread.c
index 68cf784..03a89b2 100644
--- a/libavcodec/framethread.c
+++ b/libavcodec/framethread.c
@@ -403,6 +403,8 @@ void ff_delayed_release_buffer(AVCodecContext *avctx, AVFrame *f)
         return;
     }
 
+    if(avctx->debug&FF_DEBUG_BUFFER) av_log(avctx, AV_LOG_DEBUG, "delayed_release_buffer called on pic %p, %d buffers used\n", f, f->avctx->internal_buffer_count);
+
     p->released_buffers[p->nb_released_buffers++] = *f;
     memset(f->data, 0, sizeof(f->data));
 }
\ No newline at end of file
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 8ca024d..96ae448 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -282,6 +282,8 @@ int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic){
     }
     s->internal_buffer_count++;
 
+    if(s->debug&FF_DEBUG_BUFFER) av_log(s, AV_LOG_DEBUG, "get_buffer called on pic %p, %d buffers used\n", pic, s->internal_buffer_count);
+
     return 0;
 }
 
@@ -308,6 +310,8 @@ void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic){
         pic->data[i]=NULL;
 //        pic->base[i]=NULL;
     }
+
+    if(s->debug&FF_DEBUG_BUFFER) av_log(s, AV_LOG_DEBUG, "release_buffer called on pic %p, %d buffers used\n", pic, s->internal_buffer_count);
 //printf("R%X\n", pic->opaque);
 }
 
_______________________________________________
FFmpeg-soc mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc

Reply via email to