From 4f8c5829e3536d156e6d257b70f312268bb72e41 Mon Sep 17 00:00:00 2001 From: tobigun Date: Tue, 9 Nov 2010 14:51:11 +0000 Subject: compatibility with older ffmpeg versions git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@2719 b956fd51-792f-4845-bead-9b4dfca2ff2c --- mediaplugin/src/plugins/media/ffmpeg/ffmpeg_audio_convert.h | 9 +++++---- mediaplugin/src/plugins/media/ffmpeg/ffmpeg_core.cpp | 5 +++++ mediaplugin/src/plugins/media/ffmpeg/ffmpeg_video_decode.cpp | 1 + 3 files changed, 11 insertions(+), 4 deletions(-) (limited to 'mediaplugin/src/plugins') diff --git a/mediaplugin/src/plugins/media/ffmpeg/ffmpeg_audio_convert.h b/mediaplugin/src/plugins/media/ffmpeg/ffmpeg_audio_convert.h index f2b44e48..ee4c5a81 100644 --- a/mediaplugin/src/plugins/media/ffmpeg/ffmpeg_audio_convert.h +++ b/mediaplugin/src/plugins/media/ffmpeg/ffmpeg_audio_convert.h @@ -27,6 +27,7 @@ #include "ffmpeg_core.h" #include "core/plugin_audio_convert.h" +#include extern const audioConverterInfo_t audioConverterInfo; @@ -68,10 +69,10 @@ protected: TAPS, 10, 0, 0.8); #else _resampleContext = audio_resample_init( - dstFormatInfo.getChannels(), - srcFormatInfo.getChannels(), - lround(dstFormatInfo.getSampleRate()), - lround(srcFormatInfo.getSampleRate())); + _dstFormatInfo.getChannels(), + _srcFormatInfo.getChannels(), + lround(_dstFormatInfo.getSampleRate()), + lround(_srcFormatInfo.getSampleRate())); #endif if (!_resampleContext) { diff --git a/mediaplugin/src/plugins/media/ffmpeg/ffmpeg_core.cpp b/mediaplugin/src/plugins/media/ffmpeg/ffmpeg_core.cpp index 7e55802b..6456322b 100644 --- a/mediaplugin/src/plugins/media/ffmpeg/ffmpeg_core.cpp +++ b/mediaplugin/src/plugins/media/ffmpeg/ffmpeg_core.cpp @@ -24,6 +24,7 @@ */ #include "ffmpeg_core.h" #include "core/logger.h" +#include #include const uint8_t* STATUS_PACKET = (uint8_t*)"STATUS_PACKET"; @@ -175,9 +176,11 @@ bool MediaCore_FFmpeg::convertFFmpegToAudioFormat(SampleFormat ffmpegFormat, aud case SAMPLE_FMT_FLT: *format = asfFloat; break; +#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(51,65,0) case SAMPLE_FMT_DBL: *format = asfDouble; break; +#endif default: return false; } @@ -206,6 +209,8 @@ static int CDECL ffmpegStreamOpen(URLContext *h, const char *filename, int flags break; case URL_RDONLY: mode = FILE_OPEN_MODE_READ; + default: + return AVERROR(ENOSYS); } fileStream_t *stream = pluginCore->fileOpen(utf8Filename.c_str(), mode); diff --git a/mediaplugin/src/plugins/media/ffmpeg/ffmpeg_video_decode.cpp b/mediaplugin/src/plugins/media/ffmpeg/ffmpeg_video_decode.cpp index c582c771..b3fc77b3 100644 --- a/mediaplugin/src/plugins/media/ffmpeg/ffmpeg_video_decode.cpp +++ b/mediaplugin/src/plugins/media/ffmpeg/ffmpeg_video_decode.cpp @@ -29,6 +29,7 @@ #include "ffmpeg_video_decode.h" #include +#include // These are called whenever we allocate a frame buffer. // We use this to store the global_pts in a frame at the time it is allocated. -- cgit v1.2.3