From 6256b05272d1b94bc041cb077e71ab4c0fbe98d3 Mon Sep 17 00:00:00 2001 From: Mark Cannon Date: Mon, 9 Jan 2012 05:12:20 -0800 Subject: [PATCH] more platform-independent fix for URLRageFile_write prototype --- src/arch/MovieTexture/MovieTexture_FFMpeg.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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 )