mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix deprecation warnings when building with FFmpeg 4.2.
This commit is contained in:
parent
951bb22c38
commit
547251f67c
5 changed files with 7 additions and 13 deletions
|
@ -170,17 +170,10 @@ namespace ThirdParty {
|
||||||
LOG(("MTP Error: dynlock_create callback is set without dynlock_lock callback!"));
|
LOG(("MTP Error: dynlock_create callback is set without dynlock_lock callback!"));
|
||||||
}
|
}
|
||||||
|
|
||||||
av_register_all();
|
|
||||||
avcodec_register_all();
|
|
||||||
|
|
||||||
av_lockmgr_register(_ffmpegLockManager);
|
|
||||||
|
|
||||||
_sslInited = true;
|
_sslInited = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void finish() {
|
void finish() {
|
||||||
av_lockmgr_register(nullptr);
|
|
||||||
|
|
||||||
CRYPTO_cleanup_all_ex_data();
|
CRYPTO_cleanup_all_ex_data();
|
||||||
#ifndef LIBRESSL_VERSION_NUMBER
|
#ifndef LIBRESSL_VERSION_NUMBER
|
||||||
FIPS_mode_set(0);
|
FIPS_mode_set(0);
|
||||||
|
|
|
@ -174,7 +174,7 @@ CodecPointer MakeCodecPointer(not_null<AVStream*> stream) {
|
||||||
LogError(qstr("avcodec_parameters_to_context"), error);
|
LogError(qstr("avcodec_parameters_to_context"), error);
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
av_codec_set_pkt_timebase(context, stream->time_base);
|
context->pkt_timebase = stream->time_base;
|
||||||
av_opt_set(context, "threads", "auto", 0);
|
av_opt_set(context, "threads", "auto", 0);
|
||||||
av_opt_set_int(context, "refcounted_frames", 1, 0);
|
av_opt_set_int(context, "refcounted_frames", 1, 0);
|
||||||
|
|
||||||
|
|
|
@ -253,8 +253,9 @@ void Instance::Inner::start(Fn<void(Update)> updated, Fn<void()> error) {
|
||||||
d->ioContext = avio_alloc_context(d->ioBuffer, FFmpeg::kAVBlockSize, 1, static_cast<void*>(d.get()), &Private::_read_data, &Private::_write_data, &Private::_seek_data);
|
d->ioContext = avio_alloc_context(d->ioBuffer, FFmpeg::kAVBlockSize, 1, static_cast<void*>(d.get()), &Private::_read_data, &Private::_write_data, &Private::_seek_data);
|
||||||
int res = 0;
|
int res = 0;
|
||||||
char err[AV_ERROR_MAX_STRING_SIZE] = { 0 };
|
char err[AV_ERROR_MAX_STRING_SIZE] = { 0 };
|
||||||
AVOutputFormat *fmt = 0;
|
const AVOutputFormat *fmt = nullptr;
|
||||||
while ((fmt = av_oformat_next(fmt))) {
|
void *i = nullptr;
|
||||||
|
while ((fmt = av_muxer_iterate(&i))) {
|
||||||
if (fmt->name == qstr("opus")) {
|
if (fmt->name == qstr("opus")) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -265,7 +266,7 @@ void Instance::Inner::start(Fn<void(Update)> updated, Fn<void()> error) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((res = avformat_alloc_output_context2(&d->fmtContext, fmt, 0, 0)) < 0) {
|
if ((res = avformat_alloc_output_context2(&d->fmtContext, (AVOutputFormat*)fmt, 0, 0)) < 0) {
|
||||||
LOG(("Audio Error: Unable to avformat_alloc_output_context2 for capture, error %1, %2").arg(res).arg(av_make_error_string(err, sizeof(err), res)));
|
LOG(("Audio Error: Unable to avformat_alloc_output_context2 for capture, error %1, %2").arg(res).arg(av_make_error_string(err, sizeof(err), res)));
|
||||||
fail();
|
fail();
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -550,7 +550,7 @@ bool FFMpegLoader::openCodecContext() {
|
||||||
));
|
));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
av_codec_set_pkt_timebase(_codecContext, stream->time_base);
|
_codecContext->pkt_timebase = stream->time_base;
|
||||||
av_opt_set_int(_codecContext, "refcounted_frames", 1, 0);
|
av_opt_set_int(_codecContext, "refcounted_frames", 1, 0);
|
||||||
|
|
||||||
if ((res = avcodec_open2(_codecContext, codec, 0)) < 0) {
|
if ((res = avcodec_open2(_codecContext, codec, 0)) < 0) {
|
||||||
|
|
|
@ -312,7 +312,7 @@ bool FFMpegReaderImplementation::start(Mode mode, crl::time &positionMs) {
|
||||||
LOG(("Gif Error: Unable to avcodec_parameters_to_context %1, error %2, %3").arg(logData()).arg(res).arg(av_make_error_string(err, sizeof(err), res)));
|
LOG(("Gif Error: Unable to avcodec_parameters_to_context %1, error %2, %3").arg(logData()).arg(res).arg(av_make_error_string(err, sizeof(err), res)));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
av_codec_set_pkt_timebase(_codecContext, _fmtContext->streams[_streamId]->time_base);
|
_codecContext->pkt_timebase = _fmtContext->streams[_streamId]->time_base;
|
||||||
av_opt_set_int(_codecContext, "refcounted_frames", 1, 0);
|
av_opt_set_int(_codecContext, "refcounted_frames", 1, 0);
|
||||||
|
|
||||||
const auto codec = avcodec_find_decoder(_codecContext->codec_id);
|
const auto codec = avcodec_find_decoder(_codecContext->codec_id);
|
||||||
|
|
Loading…
Add table
Reference in a new issue