You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avcodec/rv34: Make initializing static VLC tables thread-safe
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
@@ -27,6 +27,7 @@
|
|||||||
#include "libavutil/avassert.h"
|
#include "libavutil/avassert.h"
|
||||||
#include "libavutil/imgutils.h"
|
#include "libavutil/imgutils.h"
|
||||||
#include "libavutil/internal.h"
|
#include "libavutil/internal.h"
|
||||||
|
#include "libavutil/thread.h"
|
||||||
|
|
||||||
#include "avcodec.h"
|
#include "avcodec.h"
|
||||||
#include "error_resilience.h"
|
#include "error_resilience.h"
|
||||||
@@ -1481,6 +1482,7 @@ static int rv34_decode_slice(RV34DecContext *r, int end, const uint8_t* buf, int
|
|||||||
*/
|
*/
|
||||||
av_cold int ff_rv34_decode_init(AVCodecContext *avctx)
|
av_cold int ff_rv34_decode_init(AVCodecContext *avctx)
|
||||||
{
|
{
|
||||||
|
static AVOnce init_static_once = AV_ONCE_INIT;
|
||||||
RV34DecContext *r = avctx->priv_data;
|
RV34DecContext *r = avctx->priv_data;
|
||||||
MpegEncContext *s = &r->s;
|
MpegEncContext *s = &r->s;
|
||||||
int ret;
|
int ret;
|
||||||
@@ -1513,8 +1515,7 @@ av_cold int ff_rv34_decode_init(AVCodecContext *avctx)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!intra_vlcs[0].cbppattern[0].bits)
|
ff_thread_once(&init_static_once, rv34_init_tables);
|
||||||
rv34_init_tables();
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user