Skip to content

Commit

Permalink
vda: only allow ffmpeg VDA when advanced setting enable it
Browse files Browse the repository at this point in the history
It currently cause corruption during playback of some files
  • Loading branch information
elupus committed Nov 20, 2014
1 parent 5ff9780 commit cddc5c6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp
Expand Up @@ -58,6 +58,7 @@


#include "DVDStreamInfo.h"
#include "settings/AdvancedSettings.h"
#include "settings/Settings.h"
#include "utils/SystemInfo.h"
#include "utils/StringUtils.h"
Expand Down Expand Up @@ -214,7 +215,7 @@ CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodec(CDVDStreamInfo &hint, unsigne
#endif

#if defined(TARGET_DARWIN_OSX)
if (!hint.software && CSettings::Get().GetBool("videoplayer.usevda"))
if (!hint.software && CSettings::Get().GetBool("videoplayer.usevda") && !g_advancedSettings.m_useFfmpegVda)
{
if (hint.codec == AV_CODEC_ID_H264 && !hint.ptsinvalid)
{
Expand Down
Expand Up @@ -128,7 +128,7 @@ enum PixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avctx
#endif

#ifdef TARGET_DARWIN_OSX
if (*cur == AV_PIX_FMT_VDA && CSettings::Get().GetBool("videoplayer.usevda"))
if (*cur == AV_PIX_FMT_VDA && CSettings::Get().GetBool("videoplayer.usevda") && g_advancedSettings.m_useFfmpegVda)
{
VDA::CDecoder* dec = new VDA::CDecoder();
if(dec->Open(avctx, *cur, ctx->m_uSurfacesCount))
Expand Down
2 changes: 2 additions & 0 deletions xbmc/settings/AdvancedSettings.cpp
Expand Up @@ -159,6 +159,7 @@ void CAdvancedSettings::Initialize()
m_videoCaptureUseOcclusionQuery = -1; //-1 is auto detect
m_videoVDPAUtelecine = false;
m_videoVDPAUdeintSkipChromaHD = false;
m_useFfmpegVda = false;
m_DXVACheckCompatibility = false;
m_DXVACheckCompatibilityPresent = false;
m_DXVAForceProcessorRenderer = true;
Expand Down Expand Up @@ -590,6 +591,7 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file)
XMLUtils::GetInt(pElement, "useocclusionquery", m_videoCaptureUseOcclusionQuery, -1, 1);
XMLUtils::GetBoolean(pElement,"vdpauInvTelecine",m_videoVDPAUtelecine);
XMLUtils::GetBoolean(pElement,"vdpauHDdeintSkipChroma",m_videoVDPAUdeintSkipChromaHD);
XMLUtils::GetBoolean(pElement,"useffmpegvda", m_useFfmpegVda);

TiXmlElement* pStagefrightElem = pElement->FirstChildElement("stagefright");
if (pStagefrightElem)
Expand Down
1 change: 1 addition & 0 deletions xbmc/settings/AdvancedSettings.h
Expand Up @@ -177,6 +177,7 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler
int m_videoIgnoreSecondsAtStart;
float m_videoIgnorePercentAtEnd;
bool m_audioApplyDrc;
bool m_useFfmpegVda;

int m_videoVDPAUScaling;
float m_videoNonLinStretchRatio;
Expand Down

0 comments on commit cddc5c6

Please sign in to comment.