mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-04-14 00:58:38 +02:00
avcodec/dvenc: Make encoder init-threadsafe
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
parent
bc5e68ea88
commit
e10d75610c
@ -33,6 +33,7 @@
|
|||||||
#include "libavutil/mem_internal.h"
|
#include "libavutil/mem_internal.h"
|
||||||
#include "libavutil/opt.h"
|
#include "libavutil/opt.h"
|
||||||
#include "libavutil/pixdesc.h"
|
#include "libavutil/pixdesc.h"
|
||||||
|
#include "libavutil/thread.h"
|
||||||
|
|
||||||
#include "avcodec.h"
|
#include "avcodec.h"
|
||||||
#include "dv.h"
|
#include "dv.h"
|
||||||
@ -68,8 +69,6 @@ static av_cold int dvvideo_encode_init(AVCodecContext *avctx)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
dv_vlc_map_tableinit();
|
|
||||||
|
|
||||||
memset(&fdsp,0, sizeof(fdsp));
|
memset(&fdsp,0, sizeof(fdsp));
|
||||||
memset(&mecc,0, sizeof(mecc));
|
memset(&mecc,0, sizeof(mecc));
|
||||||
memset(&pdsp,0, sizeof(pdsp));
|
memset(&pdsp,0, sizeof(pdsp));
|
||||||
@ -84,6 +83,13 @@ static av_cold int dvvideo_encode_init(AVCodecContext *avctx)
|
|||||||
s->fdct[0] = fdsp.fdct;
|
s->fdct[0] = fdsp.fdct;
|
||||||
s->fdct[1] = fdsp.fdct248;
|
s->fdct[1] = fdsp.fdct248;
|
||||||
|
|
||||||
|
#if !CONFIG_HARDCODED_TABLES
|
||||||
|
{
|
||||||
|
static AVOnce init_static_once = AV_ONCE_INIT;
|
||||||
|
ff_thread_once(&init_static_once, dv_vlc_map_tableinit);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return ff_dvvideo_init(avctx);
|
return ff_dvvideo_init(avctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1212,4 +1218,5 @@ const AVCodec ff_dvvideo_encoder = {
|
|||||||
AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE
|
AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE
|
||||||
},
|
},
|
||||||
.priv_class = &dvvideo_encode_class,
|
.priv_class = &dvvideo_encode_class,
|
||||||
|
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user