From f2899d96eecc7de5a3f4b2ef231e514085e467e0 Mon Sep 17 00:00:00 2001 From: diego Date: Sat, 4 Sep 2010 08:11:31 +0000 Subject: Add central init_avcodec() to avoid duplicated libavcodec init code Patch by Vlad Seryakov, vseryakov gmail com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32043 b3059339-0415-0410-9bf9-f77b7e298cf2 Refactor more instances of avcodec_initialized handling into init_avcodec(). This is a leftover from the previous commit. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32044 b3059339-0415-0410-9bf9-f77b7e298cf2 Add missing #include for vd_ffmpeg.h; fixes the warning: libmpcodecs/vf_zrmjpeg.c:472: warning: implicit declaration of function 'init_avcodec' git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32176 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/jpeg_enc.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'libvo') diff --git a/libvo/jpeg_enc.c b/libvo/jpeg_enc.c index 5356d4b26d..37b5010250 100644 --- a/libvo/jpeg_enc.c +++ b/libvo/jpeg_enc.c @@ -41,10 +41,9 @@ #include "libavcodec/mpegvideo.h" #include "libavcodec/mjpegenc.h" +#include "libmpcodecs/vd_ffmpeg.h" #include "jpeg_enc.h" -extern int avcodec_initialized; - /* Begin excessive code duplication ************************************/ /* Code coming from mpegvideo.c and mjpeg.c in ../libavcodec ***********/ @@ -320,15 +319,7 @@ jpeg_enc_t *jpeg_enc_init(int w, int h, int y_psize, int y_rsize, j->cheap_upsample = cu; j->bw = b; - /* if libavcodec is used by the decoder then we must not - * initialize again, but if it is not initialized then we must - * initialize it here. */ - if (!avcodec_initialized) { - /* we need to initialize libavcodec */ - avcodec_init(); - avcodec_register_all(); - avcodec_initialized=1; - } + init_avcodec(); if (ff_mjpeg_encode_init(j->s) < 0) { av_free(j->s); -- cgit v1.2.3