diff --git a/modules/codec/avcodec/Modules.am b/modules/codec/avcodec/Modules.am index 67cfb8ab7b..f68022933d 100644 --- a/modules/codec/avcodec/Modules.am +++ b/modules/codec/avcodec/Modules.am @@ -5,7 +5,7 @@ SOURCES_avcodec = \ audio.c \ deinterlace.c \ avutil.h \ - fourcc.h \ + fourcc.c \ chroma.h \ $(NULL) diff --git a/modules/codec/avcodec/avcodec.c b/modules/codec/avcodec/avcodec.c index fda4da263b..59953ab82a 100644 --- a/modules/codec/avcodec/avcodec.c +++ b/modules/codec/avcodec/avcodec.c @@ -48,7 +48,6 @@ #endif #include "avcodec.h" -#include "fourcc.h" #include "avutil.h" /***************************************************************************** diff --git a/modules/codec/avcodec/avcodec.h b/modules/codec/avcodec/avcodec.h index 2c467e8879..6d8e08277d 100644 --- a/modules/codec/avcodec/avcodec.h +++ b/modules/codec/avcodec/avcodec.h @@ -21,6 +21,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ +int GetFfmpegCodec( vlc_fourcc_t i_fourcc, int *pi_cat, + int *pi_ffmpeg_codec, const char **ppsz_name ); +int GetVlcFourcc( int i_ffmpeg_codec, int *pi_cat, + vlc_fourcc_t *pi_fourcc, const char **ppsz_name ); + picture_t * DecodeVideo ( decoder_t *, block_t ** ); aout_buffer_t * DecodeAudio( decoder_t *, block_t ** ); diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c index d9b8285488..675c811c02 100644 --- a/modules/codec/avcodec/encoder.c +++ b/modules/codec/avcodec/encoder.c @@ -51,7 +51,6 @@ #include "avcodec.h" #include "chroma.h" -#include "fourcc.h" #define HURRY_UP_GUARD1 (450000) #define HURRY_UP_GUARD2 (300000) diff --git a/modules/codec/avcodec/fourcc.h b/modules/codec/avcodec/fourcc.c similarity index 98% rename from modules/codec/avcodec/fourcc.h rename to modules/codec/avcodec/fourcc.c index 0fb2dd64b6..9175056d45 100644 --- a/modules/codec/avcodec/fourcc.h +++ b/modules/codec/avcodec/fourcc.c @@ -1,5 +1,5 @@ /***************************************************************************** - * fourcc.h: libavcodec <-> libvlc conversion routines + * fourcc.c: libavcodec <-> libvlc conversion routines ***************************************************************************** * Copyright (C) 1999-2008 the VideoLAN team * $Id$ @@ -22,6 +22,22 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include + +#ifdef HAVE_LIBAVCODEC_AVCODEC_H +# include +#elif defined(HAVE_FFMPEG_AVCODEC_H) +# include +#else +# include +#endif +#include "avcodec.h" + /***************************************************************************** * Codec fourcc -> ffmpeg_id mapping *****************************************************************************/ @@ -30,7 +46,7 @@ static const struct vlc_fourcc_t i_fourcc; int i_codec; int i_cat; - const char *psz_name; + const char psz_name[40]; } codecs_table[] = { @@ -1049,15 +1065,13 @@ static const struct SPU_ES, "SubStation Alpha subtitles" }, #endif - { 0, 0, 0, 0 } + { 0, 0, 0, "" } }; -static int GetFfmpegCodec( vlc_fourcc_t i_fourcc, int *pi_cat, - int *pi_ffmpeg_codec, const char **ppsz_name ) +int GetFfmpegCodec( vlc_fourcc_t i_fourcc, int *pi_cat, + int *pi_ffmpeg_codec, const char **ppsz_name ) { - int i; - - for( i = 0; codecs_table[i].i_fourcc != 0; i++ ) + for( unsigned i = 0; codecs_table[i].i_fourcc != 0; i++ ) { if( codecs_table[i].i_fourcc == i_fourcc ) { @@ -1071,12 +1085,10 @@ static int GetFfmpegCodec( vlc_fourcc_t i_fourcc, int *pi_cat, return false; } -static int GetVlcFourcc( int i_ffmpeg_codec, int *pi_cat, - vlc_fourcc_t *pi_fourcc, const char **ppsz_name ) +int GetVlcFourcc( int i_ffmpeg_codec, int *pi_cat, + vlc_fourcc_t *pi_fourcc, const char **ppsz_name ) { - int i; - - for( i = 0; codecs_table[i].i_codec != 0; i++ ) + for( unsigned i = 0; codecs_table[i].i_codec != 0; i++ ) { if( codecs_table[i].i_codec == i_ffmpeg_codec ) {