mirror of
https://github.com/clangen/musikcube.git
synced 2024-11-19 11:10:52 +00:00
More ffmpeg5 fixes.
This commit is contained in:
parent
6c1870edc3
commit
324d5e8338
@ -1,5 +1,6 @@
|
||||
0.96.10
|
||||
|
||||
* added support for ffmpeg5 libraries.
|
||||
* fixed race condition in WasapiOut that caused the app to crash.
|
||||
* fixed `-rpath` for macOS build.
|
||||
|
||||
|
@ -314,7 +314,7 @@ bool FfmpegDecoder::Open(musik::core::sdk::IDataStream *stream) {
|
||||
|
||||
if (this->formatContext->iformat) {
|
||||
if (avformat_open_input(&this->formatContext, "", nullptr, nullptr) == 0) {
|
||||
AVCodec* codec = nullptr;
|
||||
const AVCodec* codec = nullptr;
|
||||
if (avformat_find_stream_info(this->formatContext, nullptr) >= 0) {
|
||||
this->streamId = av_find_best_stream(
|
||||
this->formatContext,
|
||||
@ -576,4 +576,4 @@ AVFrame* FfmpegDecoder::AllocFrame(AVFrame* original, AVSampleFormat format, int
|
||||
}
|
||||
}
|
||||
return original;
|
||||
}
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ static void logError(const std::string& message) {
|
||||
}
|
||||
}
|
||||
|
||||
static AVSampleFormat resolveSampleFormat(AVCodec *codec) {
|
||||
static AVSampleFormat resolveSampleFormat(const AVCodec *codec) {
|
||||
if (!codec->sample_fmts) {
|
||||
return AV_SAMPLE_FMT_NONE;
|
||||
}
|
||||
@ -105,7 +105,7 @@ static AVSampleFormat resolveSampleFormat(AVCodec *codec) {
|
||||
return codec->sample_fmts[0];
|
||||
}
|
||||
|
||||
static int resolveSampleRate(AVCodec* codec, int preferredSampleRate) {
|
||||
static int resolveSampleRate(const AVCodec* codec, int preferredSampleRate) {
|
||||
const int *p;
|
||||
int highestRate = 0;
|
||||
if (!codec->supported_samplerates) {
|
||||
@ -634,4 +634,4 @@ AVFrame* FfmpegEncoder::ReallocFrame(
|
||||
return original;
|
||||
}
|
||||
|
||||
#endif // ENABLE_FFMPEG
|
||||
#endif // ENABLE_FFMPEG
|
||||
|
@ -84,7 +84,7 @@ class FfmpegEncoder : public musik::core::sdk::IBlockingEncoder {
|
||||
IDataStream* out;
|
||||
int readBufferSize;
|
||||
AVAudioFifo* outputFifo;
|
||||
AVCodec* outputCodec;
|
||||
const AVCodec* outputCodec;
|
||||
AVCodecContext* outputContext;
|
||||
AVFormatContext* outputFormatContext;
|
||||
AVIOContext* ioContext;
|
||||
@ -98,4 +98,4 @@ class FfmpegEncoder : public musik::core::sdk::IBlockingEncoder {
|
||||
int inputSampleRate;
|
||||
};
|
||||
|
||||
#endif // ENABLE_FFMPEG
|
||||
#endif // ENABLE_FFMPEG
|
||||
|
Loading…
Reference in New Issue
Block a user