Use constexpr for MovieTexture_FFMpeg constants

This commit is contained in:
sukibaby
2025-06-04 18:26:04 -07:00
committed by teejusb
parent 8f13335c72
commit 94d1bb9e99
2 changed files with 5 additions and 4 deletions
@@ -535,8 +535,9 @@ RString MovieDecoder_FFMpeg::Open(RString file)
return error;
}
av_buffer_ = (unsigned char*)avcodec::av_malloc(STEPMANIA_FFMPEG_BUFFER_SIZE);
av_io_context_ = avcodec::avio_alloc_context(av_buffer_, STEPMANIA_FFMPEG_BUFFER_SIZE, 0, f, AVIORageFile_ReadPacket, nullptr, AVIORageFile_Seek);
av_buffer_ = (unsigned char*)(avcodec::av_malloc(kFFMpegBufferSize));
av_io_context_ = avcodec::avio_alloc_context(av_buffer_, kFFMpegBufferSize, 0, f, AVIORageFile_ReadPacket, nullptr, AVIORageFile_Seek);
av_format_context_->pb = av_io_context_;
int ret = avcodec::avformat_open_input(&av_format_context_, file.c_str(), nullptr, nullptr);
if (ret < 0)
+2 -2
View File
@@ -22,8 +22,8 @@ namespace avcodec
}
};
#define STEPMANIA_FFMPEG_BUFFER_SIZE 4096
static const int kSwsFlags = SWS_BICUBIC; // XXX: Reasonable default?
constexpr size_t kFFMpegBufferSize = 4096;
constexpr int kSwsFlags = SWS_BICUBIC; // XXX: Reasonable default?
struct FrameHolder {
avcodec::AVFrame* frame = avcodec::av_frame_alloc();