diff --git a/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp b/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp index 9fcedfd7f7..c81318a737 100644 --- a/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp +++ b/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp @@ -681,16 +681,19 @@ int URLRageFile_read( avcodec::URLContext *h, unsigned char *buf, int size ) return f->Read( buf, size ); } -#if defined(MACOSX) || defined(_MSC_VER) // still using older ffmpeg versions - int URLRageFile_write( avcodec::URLContext *h, unsigned char *buf, int size ) -#else // assume ffmpeg 0.6 on *nix - int URLRageFile_write( avcodec::URLContext *h, const unsigned char *buf, int size ) -#endif +int URLRageFile_write( avcodec::URLContext *h, const unsigned char *buf, int size ) { RageFileBasic *f = (RageFileBasic *) h->priv_data; return f->Write( buf, size ); } +/* Some avcodecs want unsigned char, others want const. Make everyone happy + * by providing a const overload and letting the compiler figure it out. */ +int URLRageFile_write( avcodec::URLContext *h, unsigned char *buf, int size ) +{ + return URLRageFile_write( h, (const unsigned char*)buf, size ); +} + // sm4svn has it as: #if defined(MACOSX) avcodec::offset_t URLRageFile_seek( avcodec::URLContext *h, avcodec::offset_t pos, int whence )