Add support for libav 9.
This commit is contained in:
parent
89907256eb
commit
463da8e816
|
@ -377,7 +377,11 @@ int import_ffmpeg_decode_frame(streamContext *sc, bool flushing)
|
|||
}
|
||||
|
||||
sc->m_samplefmt = sc->m_codecCtx->sample_fmt;
|
||||
#if !defined(DISABLE_DYNAMIC_LOADING_FFMPEG) || (LIBAVUTIL_VERSION_INT < AV_VERSION_INT(51, 4, 0))
|
||||
sc->m_samplesize = av_get_bits_per_sample_fmt(sc->m_samplefmt) / 8;
|
||||
#else
|
||||
sc->m_samplesize = av_get_bytes_per_sample(sc->m_samplefmt);
|
||||
#endif
|
||||
|
||||
int channels = sc->m_codecCtx->channels;
|
||||
unsigned int newsize = sc->m_samplesize * frame->nb_samples * channels;
|
||||
|
@ -927,8 +931,8 @@ bool FFmpegLibs::InitLibs(wxString libpath_format, bool WXUNUSED(showerr))
|
|||
FFMPEG_INITDYN(avutil, av_freep);
|
||||
FFMPEG_INITDYN(avutil, av_rescale_q);
|
||||
FFMPEG_INITDYN(avutil, avutil_version);
|
||||
FFMPEG_INITDYN(avutil, av_frame_alloc);
|
||||
FFMPEG_INITDYN(avutil, av_frame_free);
|
||||
FFMPEG_INITALT(avutil, av_frame_alloc, avcodec_alloc_frame);
|
||||
FFMPEG_INITALT(avutil, av_frame_free, avcodec_free_frame);
|
||||
FFMPEG_INITDYN(avutil, av_samples_get_buffer_size);
|
||||
|
||||
wxLogMessage(wxT("All symbols loaded successfully. Initializing the library."));
|
||||
|
|
|
@ -286,7 +286,11 @@ bool ExportFFmpeg::Init(const char *shortname, AudacityProject *project, Tags *m
|
|||
memcpy(mEncFormatCtx->filename, OSINPUT(mName), strlen(OSINPUT(mName))+1);
|
||||
|
||||
// At the moment Audacity can export only one audio stream
|
||||
#if !defined(DISABLE_DYNAMIC_LOADING_FFMPEG) || (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53, 10, 0))
|
||||
if ((mEncAudioStream = av_new_stream(mEncFormatCtx, 1)) == NULL)
|
||||
#else
|
||||
if ((mEncAudioStream = avformat_new_stream(mEncFormatCtx, NULL)) == NULL)
|
||||
#endif
|
||||
{
|
||||
wxLogError(wxT("FFmpeg : ERROR - Can't add audio stream to output file \"%s\"."), mName.c_str());
|
||||
return false;
|
||||
|
|
|
@ -839,8 +839,10 @@ CompatibilityEntry ExportFFmpegOptions::CompatibilityList[] =
|
|||
{ wxT("asf"), CODEC_ID_IMC },
|
||||
{ wxT("asf"), CODEC_ID_AC3 },
|
||||
{ wxT("asf"), CODEC_ID_DTS },
|
||||
#if !defined(DISABLE_DYNAMIC_LOADING_FFMPEG) || (LIBAVCODEC_VERSION_MAJOR == 53)
|
||||
{ wxT("asf"), CODEC_ID_SONIC },
|
||||
{ wxT("asf"), CODEC_ID_SONIC_LS },
|
||||
#endif
|
||||
{ wxT("asf"), CODEC_ID_FLAC },
|
||||
{ wxT("asf"), CODEC_ID_ADPCM_SWF },
|
||||
{ wxT("asf"), CODEC_ID_VORBIS },
|
||||
|
@ -875,8 +877,10 @@ CompatibilityEntry ExportFFmpegOptions::CompatibilityList[] =
|
|||
{ wxT("avi"), CODEC_ID_IMC },
|
||||
{ wxT("avi"), CODEC_ID_AC3 },
|
||||
{ wxT("avi"), CODEC_ID_DTS },
|
||||
#if !defined(DISABLE_DYNAMIC_LOADING_FFMPEG) || (LIBAVCODEC_VERSION_MAJOR == 53)
|
||||
{ wxT("avi"), CODEC_ID_SONIC },
|
||||
{ wxT("avi"), CODEC_ID_SONIC_LS },
|
||||
#endif
|
||||
{ wxT("avi"), CODEC_ID_FLAC },
|
||||
{ wxT("avi"), CODEC_ID_ADPCM_SWF },
|
||||
{ wxT("avi"), CODEC_ID_VORBIS },
|
||||
|
@ -924,8 +928,10 @@ CompatibilityEntry ExportFFmpegOptions::CompatibilityList[] =
|
|||
{ wxT("matroska"), CODEC_ID_IMC },
|
||||
{ wxT("matroska"), CODEC_ID_AC3 },
|
||||
{ wxT("matroska"), CODEC_ID_DTS },
|
||||
#if !defined(DISABLE_DYNAMIC_LOADING_FFMPEG) || (LIBAVCODEC_VERSION_MAJOR == 53)
|
||||
{ wxT("matroska"), CODEC_ID_SONIC },
|
||||
{ wxT("matroska"), CODEC_ID_SONIC_LS },
|
||||
#endif
|
||||
{ wxT("matroska"), CODEC_ID_FLAC },
|
||||
{ wxT("matroska"), CODEC_ID_ADPCM_SWF },
|
||||
{ wxT("matroska"), CODEC_ID_VORBIS },
|
||||
|
@ -1032,8 +1038,10 @@ CompatibilityEntry ExportFFmpegOptions::CompatibilityList[] =
|
|||
{ wxT("nut"), CODEC_ID_IMC },
|
||||
{ wxT("nut"), CODEC_ID_AC3 },
|
||||
{ wxT("nut"), CODEC_ID_DTS },
|
||||
#if !defined(DISABLE_DYNAMIC_LOADING_FFMPEG) || (LIBAVCODEC_VERSION_MAJOR == 53)
|
||||
{ wxT("nut"), CODEC_ID_SONIC },
|
||||
{ wxT("nut"), CODEC_ID_SONIC_LS },
|
||||
#endif
|
||||
{ wxT("nut"), CODEC_ID_FLAC },
|
||||
{ wxT("nut"), CODEC_ID_ADPCM_SWF },
|
||||
{ wxT("nut"), CODEC_ID_VORBIS },
|
||||
|
@ -1082,8 +1090,10 @@ CompatibilityEntry ExportFFmpegOptions::CompatibilityList[] =
|
|||
{ wxT("wav"), CODEC_ID_IMC },
|
||||
{ wxT("wav"), CODEC_ID_AC3 },
|
||||
{ wxT("wav"), CODEC_ID_DTS },
|
||||
#if !defined(DISABLE_DYNAMIC_LOADING_FFMPEG) || (LIBAVCODEC_VERSION_MAJOR == 53)
|
||||
{ wxT("wav"), CODEC_ID_SONIC },
|
||||
{ wxT("wav"), CODEC_ID_SONIC_LS },
|
||||
#endif
|
||||
{ wxT("wav"), CODEC_ID_FLAC },
|
||||
{ wxT("wav"), CODEC_ID_ADPCM_SWF },
|
||||
{ wxT("wav"), CODEC_ID_VORBIS },
|
||||
|
|
|
@ -369,7 +369,11 @@ bool FFmpegImportFileHandle::Init()
|
|||
return false;
|
||||
}
|
||||
|
||||
#if !defined(DISABLE_DYNAMIC_LOADING_FFMPEG) || (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53, 3, 0))
|
||||
err = av_find_stream_info(mFormatContext);
|
||||
#else
|
||||
err = avformat_find_stream_info(mFormatContext, NULL);
|
||||
#endif
|
||||
if (err < 0)
|
||||
{
|
||||
wxLogError(wxT("FFmpeg : av_find_stream_info() failed for file %s"),mName.c_str());
|
||||
|
|
Loading…
Reference in New Issue
Block a user