mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
Merge pull request #7 from kestred/cfs-fixes
Miscellaneous compilation fixes
This commit is contained in:
commit
69dc29d6f0
@ -148,7 +148,11 @@ FfmpegAudioCursor(FfmpegAudio *src) :
|
|||||||
_can_seek = true;
|
_can_seek = true;
|
||||||
_can_seek_fast = true;
|
_can_seek_fast = true;
|
||||||
|
|
||||||
|
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 59, 100)
|
||||||
|
_frame = av_frame_alloc();
|
||||||
|
#else
|
||||||
_frame = avcodec_alloc_frame();
|
_frame = avcodec_alloc_frame();
|
||||||
|
#endif
|
||||||
|
|
||||||
_packet = new AVPacket;
|
_packet = new AVPacket;
|
||||||
_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE / 2;
|
_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE / 2;
|
||||||
@ -194,7 +198,9 @@ FfmpegAudioCursor::
|
|||||||
void FfmpegAudioCursor::
|
void FfmpegAudioCursor::
|
||||||
cleanup() {
|
cleanup() {
|
||||||
if (_frame) {
|
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);
|
avcodec_free_frame(&_frame);
|
||||||
#else
|
#else
|
||||||
av_free(&_frame);
|
av_free(&_frame);
|
||||||
@ -313,8 +319,7 @@ reload_buffer() {
|
|||||||
#ifdef HAVE_SWRESAMPLE
|
#ifdef HAVE_SWRESAMPLE
|
||||||
if (_resample_ctx) {
|
if (_resample_ctx) {
|
||||||
// Resample the data to signed 16-bit sample format.
|
// Resample the data to signed 16-bit sample format.
|
||||||
uint8_t* out[SWR_CH_MAX] = {(uint8_t*) _buffer, NULL};
|
bufsize = swr_convert(_resample_ctx, (uint8_t **)&_buffer, _buffer_size / 2, (const uint8_t**)_frame->extended_data, _frame->nb_samples);
|
||||||
bufsize = swr_convert(_resample_ctx, out, _buffer_size / 2, (const uint8_t**)_frame->extended_data, _frame->nb_samples);
|
|
||||||
bufsize *= _audio_channels * 2;
|
bufsize *= _audio_channels * 2;
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
|
@ -94,8 +94,13 @@ init_from(FfmpegVideo *source) {
|
|||||||
PIX_FMT_BGR24, SWS_BILINEAR | SWS_PRINT_INFO, NULL, NULL, NULL);
|
PIX_FMT_BGR24, SWS_BILINEAR | SWS_PRINT_INFO, NULL, NULL, NULL);
|
||||||
#endif // HAVE_SWSCALE
|
#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 = avcodec_alloc_frame();
|
||||||
_frame_out = avcodec_alloc_frame();
|
_frame_out = avcodec_alloc_frame();
|
||||||
|
#endif
|
||||||
|
|
||||||
if ((_frame == 0)||(_frame_out == 0)) {
|
if ((_frame == 0)||(_frame_out == 0)) {
|
||||||
cleanup();
|
cleanup();
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
#include "pandabase.h"
|
#include "pandabase.h"
|
||||||
|
|
||||||
#include "adaptiveLru.h"
|
#include "adaptiveLru.h"
|
||||||
|
#include "simpleLru.h"
|
||||||
#include "samplerState.h"
|
#include "samplerState.h"
|
||||||
#include "savedContext.h"
|
#include "savedContext.h"
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include "namable.h"
|
#include "namable.h"
|
||||||
#include "luse.h"
|
#include "luse.h"
|
||||||
#include "numeric_types.h"
|
#include "numeric_types.h"
|
||||||
|
#include "bamReader.h"
|
||||||
#include "config_gobj.h"
|
#include "config_gobj.h"
|
||||||
|
|
||||||
class FactoryParams;
|
class FactoryParams;
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include "cullBinEnums.h"
|
#include "cullBinEnums.h"
|
||||||
#include "pointerTo.h"
|
#include "pointerTo.h"
|
||||||
#include "pvector.h"
|
#include "pvector.h"
|
||||||
|
#include "epvector.h"
|
||||||
#include "pmap.h"
|
#include "pmap.h"
|
||||||
#include "vector_int.h"
|
#include "vector_int.h"
|
||||||
#include "pStatCollector.h"
|
#include "pStatCollector.h"
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
#include "virtualFileSystem.h"
|
#include "virtualFileSystem.h"
|
||||||
#include "loader.h"
|
#include "loader.h"
|
||||||
#include "shader.h"
|
#include "shader.h"
|
||||||
|
#include "string_utils.h"
|
||||||
|
|
||||||
ShaderPool *ShaderPool::_global_ptr = (ShaderPool *)NULL;
|
ShaderPool *ShaderPool::_global_ptr = (ShaderPool *)NULL;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user