diff options
author | Uoti Urpala <uau@mplayer2.org> | 2011-07-18 00:28:22 +0300 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2011-07-18 00:57:05 +0300 |
commit | a4f41308190b79d79a5ac7a50791332e5c1d5600 (patch) | |
tree | 5207b45480ff2317544e17118a58e321160f856c /libmpcodecs/vd_ffmpeg.c | |
parent | 4e2b15fc5e5f457f62605262a46962b5fd63ff99 (diff) | |
download | mpv-a4f41308190b79d79a5ac7a50791332e5c1d5600.tar.bz2 mpv-a4f41308190b79d79a5ac7a50791332e5c1d5600.tar.xz |
cleanup: do libav* initialization on startup
Do the global initialization of libavcodec and libavformat
(avcodec_register_all(), av_register_all()) immediately on program
startup and remove the initialization calls from various individual
modules that use libavcodec/libavformat functionality.
Diffstat (limited to 'libmpcodecs/vd_ffmpeg.c')
-rw-r--r-- | libmpcodecs/vd_ffmpeg.c | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index 0a50415f66..9d33d5d963 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -38,7 +38,6 @@ #include "libmpdemux/stheader.h" #include "codec-cfg.h" #include "osdep/numcores.h" -#include "vd_ffmpeg.h" static const vd_info_t info = { "FFmpeg's libavcodec codec family", @@ -54,8 +53,6 @@ static const vd_info_t info = { #error palette too large, adapt libmpcodecs/vf.c:vf_get_image #endif -int avcodec_initialized=0; - typedef struct { AVCodecContext *avctx; AVFrame *pic; @@ -151,15 +148,6 @@ static int control(sh_video_t *sh, int cmd, void *arg, ...){ return CONTROL_UNKNOWN; } -void init_avcodec(void) -{ - if (!avcodec_initialized) { - avcodec_init(); - avcodec_register_all(); - avcodec_initialized = 1; - } -} - // init driver static int init(sh_video_t *sh){ struct lavc_param *lavc_param = &sh->opts->lavc_param; @@ -168,8 +156,6 @@ static int init(sh_video_t *sh){ AVCodec *lavc_codec; int do_vis_debug= lavc_param->vismv || (lavc_param->debug&(FF_DEBUG_VIS_MB_TYPE|FF_DEBUG_VIS_QP)); - init_avcodec(); - ctx = sh->context = talloc_zero(NULL, vd_ffmpeg_ctx); lavc_codec = avcodec_find_decoder_by_name(sh->codec->dll); |