Merge pull request #7 from kestred/cfs-fixes

Miscellaneous compilation fixes
This commit is contained in:
rdb 2015-02-25 02:25:19 +01:00
commit 69dc29d6f0
6 changed files with 17 additions and 3 deletions

View File

@ -148,7 +148,11 @@ FfmpegAudioCursor(FfmpegAudio *src) :
_can_seek = true;
_can_seek_fast = true;
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 59, 100)
_frame = av_frame_alloc();
#else
_frame = avcodec_alloc_frame();
#endif
_packet = new AVPacket;
_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE / 2;
@ -194,7 +198,9 @@ FfmpegAudioCursor::
void FfmpegAudioCursor::
cleanup() {
if (_frame) {
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 59, 100)
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55, 45, 101)
av_frame_free(&_frame);
#elif LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 59, 100)
avcodec_free_frame(&_frame);
#else
av_free(&_frame);
@ -313,8 +319,7 @@ reload_buffer() {
#ifdef HAVE_SWRESAMPLE
if (_resample_ctx) {
// Resample the data to signed 16-bit sample format.
uint8_t* out[SWR_CH_MAX] = {(uint8_t*) _buffer, NULL};
bufsize = swr_convert(_resample_ctx, out, _buffer_size / 2, (const uint8_t**)_frame->extended_data, _frame->nb_samples);
bufsize = swr_convert(_resample_ctx, (uint8_t **)&_buffer, _buffer_size / 2, (const uint8_t**)_frame->extended_data, _frame->nb_samples);
bufsize *= _audio_channels * 2;
} else
#endif

View File

@ -94,8 +94,13 @@ init_from(FfmpegVideo *source) {
PIX_FMT_BGR24, SWS_BILINEAR | SWS_PRINT_INFO, NULL, NULL, NULL);
#endif // HAVE_SWSCALE
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 59, 100)
_frame = av_frame_alloc();
_frame_out = av_frame_alloc();
#else
_frame = avcodec_alloc_frame();
_frame_out = avcodec_alloc_frame();
#endif
if ((_frame == 0)||(_frame_out == 0)) {
cleanup();

View File

@ -18,6 +18,7 @@
#include "pandabase.h"
#include "adaptiveLru.h"
#include "simpleLru.h"
#include "samplerState.h"
#include "savedContext.h"

View File

@ -21,6 +21,7 @@
#include "namable.h"
#include "luse.h"
#include "numeric_types.h"
#include "bamReader.h"
#include "config_gobj.h"
class FactoryParams;

View File

@ -20,6 +20,7 @@
#include "cullBinEnums.h"
#include "pointerTo.h"
#include "pvector.h"
#include "epvector.h"
#include "pmap.h"
#include "vector_int.h"
#include "pStatCollector.h"

View File

@ -18,6 +18,7 @@
#include "virtualFileSystem.h"
#include "loader.h"
#include "shader.h"
#include "string_utils.h"
ShaderPool *ShaderPool::_global_ptr = (ShaderPool *)NULL;