Use constexpr for MovieTexture_FFMpeg constants
This commit is contained in:
@@ -535,8 +535,9 @@ RString MovieDecoder_FFMpeg::Open(RString file)
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
av_buffer_ = (unsigned char*)avcodec::av_malloc(STEPMANIA_FFMPEG_BUFFER_SIZE);
|
av_buffer_ = (unsigned char*)(avcodec::av_malloc(kFFMpegBufferSize));
|
||||||
av_io_context_ = avcodec::avio_alloc_context(av_buffer_, STEPMANIA_FFMPEG_BUFFER_SIZE, 0, f, AVIORageFile_ReadPacket, nullptr, AVIORageFile_Seek);
|
av_io_context_ = avcodec::avio_alloc_context(av_buffer_, kFFMpegBufferSize, 0, f, AVIORageFile_ReadPacket, nullptr, AVIORageFile_Seek);
|
||||||
|
|
||||||
av_format_context_->pb = av_io_context_;
|
av_format_context_->pb = av_io_context_;
|
||||||
int ret = avcodec::avformat_open_input(&av_format_context_, file.c_str(), nullptr, nullptr);
|
int ret = avcodec::avformat_open_input(&av_format_context_, file.c_str(), nullptr, nullptr);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ namespace avcodec
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#define STEPMANIA_FFMPEG_BUFFER_SIZE 4096
|
constexpr size_t kFFMpegBufferSize = 4096;
|
||||||
static const int kSwsFlags = SWS_BICUBIC; // XXX: Reasonable default?
|
constexpr int kSwsFlags = SWS_BICUBIC; // XXX: Reasonable default?
|
||||||
|
|
||||||
struct FrameHolder {
|
struct FrameHolder {
|
||||||
avcodec::AVFrame* frame = avcodec::av_frame_alloc();
|
avcodec::AVFrame* frame = avcodec::av_frame_alloc();
|
||||||
|
|||||||
Reference in New Issue
Block a user