Skip to content

Instantly share code, notes, and snippets.

@semack
Last active August 29, 2015 14:13
Show Gist options
  • Save semack/b5549c5544a3cdf82637 to your computer and use it in GitHub Desktop.
Save semack/b5549c5544a3cdf82637 to your computer and use it in GitHub Desktop.
diff --git a/language/Russian/strings.po b/language/Russian/strings.po
index fd5f2a8..44feba9 100644
--- a/language/Russian/strings.po
+++ b/language/Russian/strings.po
@@ -13080,3 +13080,13 @@ msgstr "Метод открытия/воспроизведения дисков
msgctxt "#38010"
msgid "GPU accelerated"
msgstr "Ускорение при помощи видеокарты"
+
+#: system/settings/settings.xml
+msgctxt "#60001"
+msgid "Use software decoding for SD video content"
+msgstr "Использовать программное декодирование для SD видео контента"
+
+#: system/settings/settings.xml
+msgctxt "#60002"
+msgid "Use software decoding for Standard Definition video content (< 720p)"
+msgstr "Использовать программное декодирование для видео контента с разрешением < 720"
diff --git a/language/English/strings.po b/language/English/strings.po
index 4ebfbd9..30b0c73 100755
--- a/language/English/strings.po
+++ b/language/English/strings.po
@@ -16175,3 +16175,13 @@ msgstr ""
msgctxt "#38010"
msgid "GPU accelerated"
msgstr ""
+
+#: system/settings/settings.xml
+msgctxt "#60001"
+msgid "Use software decoding for SD video content"
+msgstr ""
+
+#: system/settings/settings.xml
+msgctxt "#60002"
+msgid "Use software decoding for Standard Definition video content (< 720p)"
+msgstr ""
\ No newline at end of file
diff --git a/system/settings/settings.xml b/system/settings/settings.xml
index a73dad0..546ca86 100644
--- a/system/settings/settings.xml
+++ b/system/settings/settings.xml
@@ -584,6 +584,18 @@
</updates>
<control type="toggle" />
</setting>
+ <setting id="videoplayer.useswdecodingforsd" type="boolean" label="60001" help="60002">
+ <requirement>HAVE_AMCODEC</requirement>
+ <dependencies>
+ <dependency type="enable" setting="videoplayer.decodingmethod" operator="is">1</dependency>
+ </dependencies>
+ <level>2</level>
+ <default>false</default>
+ <updates>
+ <update type="change" />
+ </updates>
+ <control type="toggle" />
+ </setting>
<setting id="videoplayer.usevdpau" type="boolean" label="13425" help="36155">
<requirement>HAVE_LIBVDPAU</requirement>
<dependencies>
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecAmlogic.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecAmlogic.cpp
index 4f3758f..27a3ec2 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecAmlogic.cpp
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecAmlogic.cpp
@@ -24,6 +24,8 @@
#include "DVDClock.h"
#include "DVDStreamInfo.h"
#include "AMLCodec.h"
+#include "settings/Settings.h"
+#include "settings/VideoSettings.h"
#include "utils/AMLUtils.h"
#include "utils/BitstreamConverter.h"
#include "utils/log.h"
@@ -61,7 +63,11 @@ CDVDVideoCodecAmlogic::~CDVDVideoCodecAmlogic()
bool CDVDVideoCodecAmlogic::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options)
{
m_hints = hints;
-
+ if ((EDECODEMETHOD)CSettings::Get().GetInt("videoplayer.decodingmethod") == VS_DECODEMETHOD_HARDWARE && CSettings::Get().GetBool("videoplayer.useswdecodingforsd") && m_hints.width < 1280)
+ {
+ CLog::Log(LOGDEBUG, "Use Software decoding for SD content");
+ return false;
+ }
switch(m_hints.codec)
{
case AV_CODEC_ID_MJPEG:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment