mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-12 09:48:37 +12:00
libav: remove deprecated option refcounted_frames
According to fe85afbf8c/doc/APIchanges (L743)
this option is deprecated and obsolete for the newer send/receive logic.
Should fix runtime exceptions with newer ffmpeg versions.
This commit is contained in:
parent
572a335c38
commit
fb27ed4deb
2 changed files with 4 additions and 13 deletions
|
@ -521,16 +521,13 @@ public:
|
||||||
//ctx = fmt->streams[0]->codec; // TODO: check data
|
//ctx = fmt->streams[0]->codec; // TODO: check data
|
||||||
|
|
||||||
opts = nullptr;
|
opts = nullptr;
|
||||||
err = av_dict_set(&opts, "refcounted_frames", "1", 0);
|
|
||||||
if (err < 0)
|
|
||||||
{
|
|
||||||
fmt::throw_exception("av_dict_set(refcounted_frames, 1) failed (err=0x%x='%s')", err, utils::av_error_to_string(err));
|
|
||||||
}
|
|
||||||
{
|
{
|
||||||
std::lock_guard lock(g_mutex_avcodec_open2);
|
std::lock_guard lock(g_mutex_avcodec_open2);
|
||||||
// not multithread-safe (???)
|
// not multithread-safe (???)
|
||||||
err = avcodec_open2(ctx, codec, &opts);
|
err = avcodec_open2(ctx, codec, &opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (err || opts)
|
if (err || opts)
|
||||||
{
|
{
|
||||||
std::string dict_content;
|
std::string dict_content;
|
||||||
|
|
|
@ -242,17 +242,11 @@ struct vdec_context final
|
||||||
fmt::throw_exception("avcodec_alloc_context3() failed (type=0x%x)", type);
|
fmt::throw_exception("avcodec_alloc_context3() failed (type=0x%x)", type);
|
||||||
}
|
}
|
||||||
|
|
||||||
AVDictionary* opts{};
|
AVDictionary* opts = nullptr;
|
||||||
int err = av_dict_set(&opts, "refcounted_frames", "1", 0);
|
|
||||||
if (err < 0)
|
|
||||||
{
|
|
||||||
avcodec_free_context(&ctx);
|
|
||||||
fmt::throw_exception("av_dict_set(refcounted_frames, 1) failed (err=0x%x='%s')", err, utils::av_error_to_string(err));
|
|
||||||
}
|
|
||||||
|
|
||||||
std::lock_guard lock(g_mutex_avcodec_open2);
|
std::lock_guard lock(g_mutex_avcodec_open2);
|
||||||
|
|
||||||
err = avcodec_open2(ctx, codec, &opts);
|
int err = avcodec_open2(ctx, codec, &opts);
|
||||||
if (err || opts)
|
if (err || opts)
|
||||||
{
|
{
|
||||||
avcodec_free_context(&ctx);
|
avcodec_free_context(&ctx);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue