# HG changeset patch # User rik # Date 1017409594 0 # Node ID 7a4ea9beebc0945823c80e8d1c562ab1fd14bdb4 # Parent 386f6fcc92d556243d9d4db379ed3b9c69d8bc9e use avcodec_inited instead of av_fdct to see if avcodec was initialized by another part of mplayer diff -r 386f6fcc92d5 -r 7a4ea9beebc0 libvo/jpeg_enc.c --- a/libvo/jpeg_enc.c Fri Mar 29 07:20:44 2002 +0000 +++ b/libvo/jpeg_enc.c Fri Mar 29 13:46:34 2002 +0000 @@ -41,6 +41,8 @@ #include "jpeg_enc.h" +extern int avcodec_inited; + /* zr_mjpeg_encode_mb needs access to these tables for the black & white * option */ typedef struct MJpegContext { @@ -297,15 +299,12 @@ /* 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. There must be a better way to find out - * if it is initialized */ - if (av_fdct != jpeg_fdct_ifast -#ifdef HAVE_MMX - && av_fdct != fdct_mmx -#endif - ) { + * initialize it here. */ + if (!avcodec_inited) { /* we need to initialize libavcodec */ avcodec_init(); + avcodec_register_all(); + avcodec_inited=1; } if (mjpeg_init(j->s) < 0) {