Skip to content

Commit

Permalink
VDPAU: Disable level checks in MythTV and FFmpeg
Browse files Browse the repository at this point in the history
- per the FFmpeg docs, this should be the default and it is causing
hardware acceleration to fail on older VDPAU devices.
  • Loading branch information
mark-kendall committed Jun 25, 2020
1 parent f142e85 commit 9995644
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion mythtv/libs/libmythtv/decoders/mythvdpaucontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ int MythVDPAUContext::InitialiseContext(AVCodecContext* Context)
}

auto* vdpaudevicectx = static_cast<AVVDPAUDeviceContext*>(hwdevicecontext->hwctx);
if (av_vdpau_bind_context(Context, vdpaudevicectx->device, vdpaudevicectx->get_proc_address, 0) != 0)
if (av_vdpau_bind_context(Context, vdpaudevicectx->device,
vdpaudevicectx->get_proc_address, AV_HWACCEL_FLAG_IGNORE_LEVEL) != 0)
{
LOG(VB_GENERAL, LOG_ERR, LOC + "Failed to bind VDPAU context");
av_buffer_unref(&hwdeviceref);
Expand Down
3 changes: 2 additions & 1 deletion mythtv/libs/libmythtv/decoders/mythvdpauhelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ VDPAUCodec::VDPAUCodec(MythCodecContext::CodecProfile Profile, QSize Size, uint3

bool VDPAUCodec::Supported(int Width, int Height, int Level) const
{
// Note - level checks are now ignored here and in FFmpeg
uint32_t macros = static_cast<uint32_t>(((Width + 15) & ~15) * ((Height + 15) & ~15)) / 256;
bool result = (Width <= m_maxSize.width()) && (Height <= m_maxSize.height()) &&
(macros <= m_maxMacroBlocks) && (static_cast<uint32_t>(Level) <= m_maxLevel);
(macros <= m_maxMacroBlocks) /*&& (static_cast<uint32_t>(Level) <= m_maxLevel)*/;
if (!result)
{
LOG(VB_PLAYBACK, LOG_DEBUG, LOC + QString("Not supported: Size %1x%2 > %3x%4, MBs %5 > %6, Level %7 > %8")
Expand Down

0 comments on commit 9995644

Please sign in to comment.