diff options
author | Alexander Strange <astrange@ithinksw.com> | 2011-06-02 10:15:58 -0700 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2011-06-02 10:16:20 -0700 |
commit | 6a9c85944427e3c4355bce67d7f677ec69527bff (patch) | |
tree | df4bb83f820a5c0295485ca8b7751c4063d5165f /libavcodec/utils.c | |
parent | 53be7b23e9d7074d1aeee77407b008411d034e9e (diff) | |
download | ffmpeg-6a9c85944427e3c4355bce67d7f677ec69527bff.tar.gz |
H264/MPEG frame-level multi-threading.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 9e879940a9..0eb5afd63c 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -115,7 +115,7 @@ typedef struct InternalBuffer{ enum PixelFormat pix_fmt; }InternalBuffer; -#define INTERNAL_BUFFER_SIZE 32 +#define INTERNAL_BUFFER_SIZE (32+1) void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, int linesize_align[4]){ int w_align= 1; @@ -360,6 +360,7 @@ void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic){ assert(pic->type==FF_BUFFER_TYPE_INTERNAL); assert(s->internal_buffer_count); + if(s->internal_buffer){ buf = NULL; /* avoids warning */ for(i=0; i<s->internal_buffer_count; i++){ //just 3-5 checks so is not worth to optimize buf= &((InternalBuffer*)s->internal_buffer)[i]; @@ -371,6 +372,7 @@ void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic){ last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count]; FFSWAP(InternalBuffer, *buf, *last); + } for(i=0; i<4; i++){ pic->data[i]=NULL; |