Renames for clarity.

This commit is contained in:
casey langen 2022-02-06 14:51:20 -08:00
parent 21977bc601
commit 017b410f66
4 changed files with 8 additions and 8 deletions

View File

@ -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) {
resolved_avcodec_type* codec = nullptr;
AVCodecCompat* codec = nullptr;
if (avformat_find_stream_info(this->formatContext, nullptr) >= 0) {
this->streamId = av_find_best_stream(
this->formatContext,

View File

@ -53,9 +53,9 @@ extern "C" {
#include <stddef.h>
#if LIBAVCODEC_VERSION_MAJOR >= 59
using resolved_avcodec_type = const AVCodec;
using AVCodecCompat = const AVCodec;
#else
using resolved_avcodec_type = AVCodec;
using AVCodecCompat = AVCodec;
#endif
using namespace musik::core::sdk;

View File

@ -89,7 +89,7 @@ static void logError(const std::string& message) {
}
}
static AVSampleFormat resolveSampleFormat(resolved_avcodec_type *codec) {
static AVSampleFormat resolveSampleFormat(AVCodecCompat *codec) {
if (!codec->sample_fmts) {
return AV_SAMPLE_FMT_NONE;
}
@ -105,7 +105,7 @@ static AVSampleFormat resolveSampleFormat(resolved_avcodec_type *codec) {
return codec->sample_fmts[0];
}
static int resolveSampleRate(resolved_avcodec_type* codec, int preferredSampleRate) {
static int resolveSampleRate(AVCodecCompat* codec, int preferredSampleRate) {
const int *p;
int highestRate = 0;
if (!codec->supported_samplerates) {

View File

@ -56,9 +56,9 @@ extern "C" {
}
#if LIBAVCODEC_VERSION_MAJOR >= 59
using resolved_avcodec_type = const AVCodec;
using AVCodecCompat = const AVCodec;
#else
using resolved_avcodec_type = AVCodec;
using AVCodecCompat = AVCodec;
#endif
class FfmpegEncoder : public musik::core::sdk::IBlockingEncoder {
@ -91,7 +91,7 @@ class FfmpegEncoder : public musik::core::sdk::IBlockingEncoder {
IDataStream* out;
int readBufferSize;
AVAudioFifo* outputFifo;
resolved_avcodec_type* outputCodec;
AVCodecCompat* outputCodec;
AVCodecContext* outputContext;
AVFormatContext* outputFormatContext;
AVIOContext* ioContext;