summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authordiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-09-04 08:11:31 +0000
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-02 04:15:51 +0200
commitf2899d96eecc7de5a3f4b2ef231e514085e467e0 (patch)
tree43afa4796389fd043b0b6d8172a71b069598bb0b /libvo
parenta92b4adf61c4f2a77822326d18b983e7e8fb21fb (diff)
downloadmpv-f2899d96eecc7de5a3f4b2ef231e514085e467e0.tar.bz2
mpv-f2899d96eecc7de5a3f4b2ef231e514085e467e0.tar.xz
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
Diffstat (limited to 'libvo')
-rw-r--r--libvo/jpeg_enc.c13
1 files changed, 2 insertions, 11 deletions
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);