# HG changeset patch # User romansh # Date 1136575179 0 # Node ID 97e6c0f82182427f69492a644331557b19d5d35d # Parent 1720680830c7a07a4cf56022ff05deef3bce4ec7 Moving dv_anchor back to the global scope. This creates a tiny memory leak for cases like dlopening libavcodec.so and such, but I still don't know how to catch such events. diff -r 1720680830c7 -r 97e6c0f82182 dv.c --- a/dv.c Fri Jan 06 13:18:31 2006 +0000 +++ b/dv.c Fri Jan 06 19:19:39 2006 +0000 @@ -49,10 +49,10 @@ void (*get_pixels)(DCTELEM *block, const uint8_t *pixels, int line_size); void (*fdct[2])(DCTELEM *block); void (*idct_put[2])(uint8_t *dest, int line_size, DCTELEM *block); +} DVVideoContext; - /* MultiThreading */ - uint8_t** dv_anchor; -} DVVideoContext; +/* MultiThreading - applies to entire DV codec, not just the avcontext */ +uint8_t** dv_anchor; #define TEX_VLC_BITS 9 @@ -118,12 +118,12 @@ return -ENOMEM; /* dv_anchor lets each thread know its Id */ - s->dv_anchor = av_malloc(12*27*sizeof(void*)); - if (!s->dv_anchor) { + dv_anchor = av_malloc(12*27*sizeof(void*)); + if (!dv_anchor) { return -ENOMEM; } for (i=0; i<12*27; i++) - s->dv_anchor[i] = (void*)(size_t)i; + dv_anchor[i] = (void*)(size_t)i; /* it's faster to include sign bit in a generic VLC parsing scheme */ for (i=0, j=0; idv_anchor); + if (!dv_rl_vlc) return -ENOMEM; - } + for(i = 0; i < dv_vlc.table_size; i++){ int code= dv_vlc.table[i][0]; int len = dv_vlc.table[i][1]; @@ -939,7 +938,7 @@ s->picture.top_field_first = 0; s->buf = buf; - avctx->execute(avctx, dv_decode_mt, (void**)&s->dv_anchor[0], NULL, + avctx->execute(avctx, dv_decode_mt, (void**)&dv_anchor[0], NULL, s->sys->difseg_size * 27); emms_c(); @@ -968,7 +967,7 @@ s->picture.pict_type = FF_I_TYPE; s->buf = buf; - c->execute(c, dv_encode_mt, (void**)&s->dv_anchor[0], NULL, + c->execute(c, dv_encode_mt, (void**)&dv_anchor[0], NULL, s->sys->difseg_size * 27); emms_c(); @@ -977,9 +976,6 @@ static int dvvideo_close(AVCodecContext *c) { - DVVideoContext *s = c->priv_data; - - av_free(s->dv_anchor); return 0; }