Skip to content

Commit

Permalink
[videoplayer] Hacky scheme to enable accelerated playback as first ff…
Browse files Browse the repository at this point in the history
… step
  • Loading branch information
popcornmix authored and FernetMenta committed Jan 6, 2016
1 parent 999a251 commit 1f1c62e
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 2 deletions.
36 changes: 36 additions & 0 deletions addons/resource.language.en_gb/resources/strings.po
Expand Up @@ -18232,3 +18232,39 @@ msgstr ""
msgctxt "#38030"
msgid "This option uses frame-packing to output full resolution for 3D through HDMI.[CR]Enabling this improves quality of Multiview Video Coding (MVC) videos, but may not be supported by all displays."
msgstr ""

#. Description of setting "Videos -> Playback -> accelerated playback
#: system/settings/settings.xml
msgctxt "#38038"
msgid "Accelerated playback speed"
msgstr ""

#. Description of setting "Videos -> Playback -> accelerated playback
#: system/settings/settings.xml
msgctxt "#38031"
msgid "The first fastforward step can use accelerated playback with audio"
msgstr ""

msgctxt "#38032"
msgid "110%"
msgstr ""

msgctxt "#38033"
msgid "120%"
msgstr ""

msgctxt "#38034"
msgid "130%"
msgstr ""

msgctxt "#38035"
msgid "140%"
msgstr ""

msgctxt "#38036"
msgid "150%"
msgstr ""

msgctxt "#38037"
msgid "Disabled"
msgstr ""
15 changes: 15 additions & 0 deletions system/settings/settings.xml
Expand Up @@ -579,6 +579,21 @@
<default>false</default>
<control type="toggle" />
</setting>
<setting id="videoplayer.acceleratedplayback" type="integer" label="38030" help="38031">
<level>3</level>
<default>200</default>
<constraints>
<options>
<option label="38032">110</option> <!-- 110% -->
<option label="38033">120</option> <!-- 120% -->
<option label="38034">130</option> <!-- 130% -->
<option label="38035">140</option> <!-- 140% -->
<option label="38036">150</option> <!-- 150% -->
<option label="38037">200</option> <!-- disabled -->
</options>
</constraints>
<control type="spinner" format="string"/>
</setting>
<setting id="videoplayer.errorinaspect" type="integer" label="22021" help="36170">
<level>2</level>
<default>0</default>
Expand Down
2 changes: 1 addition & 1 deletion xbmc/ApplicationPlayer.cpp
Expand Up @@ -729,7 +729,7 @@ void CApplicationPlayer::SetPlaySpeed(int iSpeed, bool bApplicationMuted)
// if player has volume control, set it.
if (ControlsVolume())
{
if (m_iPlaySpeed == 1)
if (m_iPlaySpeed == 1 || m_iPlaySpeed == 2)
{ // restore volume
player->SetVolume(g_application.GetVolume(false));
}
Expand Down
5 changes: 4 additions & 1 deletion xbmc/cores/VideoPlayer/VideoPlayer.cpp
Expand Up @@ -3370,7 +3370,10 @@ void CVideoPlayer::ToFFRW(int iSpeed)
// can't rewind in menu as seeking isn't possible
// forward is fine
if (iSpeed < 0 && IsInMenu()) return;
SetPlaySpeed(iSpeed * DVD_PLAYSPEED_NORMAL);
int speed = iSpeed * DVD_PLAYSPEED_NORMAL;
if (iSpeed == 2)
speed = CSettings::GetInstance().GetInt(CSettings::SETTING_VIDEOPLAYER_ACCELERATEDPLAYBACK)*DVD_PLAYSPEED_NORMAL/100;
SetPlaySpeed(speed);
}

bool CVideoPlayer::OpenStream(CCurrentStream& current, int iStream, int source, bool reset)
Expand Down
1 change: 1 addition & 0 deletions xbmc/settings/Settings.cpp
Expand Up @@ -152,6 +152,7 @@ const std::string CSettings::SETTING_VIDEOPLAYER_SEEKSTEPS = "videoplayer.seekst
const std::string CSettings::SETTING_VIDEOPLAYER_SEEKDELAY = "videoplayer.seekdelay";
const std::string CSettings::SETTING_VIDEOPLAYER_ADJUSTREFRESHRATE = "videoplayer.adjustrefreshrate";
const std::string CSettings::SETTING_VIDEOPLAYER_USEDISPLAYASCLOCK = "videoplayer.usedisplayasclock";
const std::string CSettings::SETTING_VIDEOPLAYER_ACCELERATEDPLAYBACK = "videoplayer.acceleratedplayback";
const std::string CSettings::SETTING_VIDEOPLAYER_ERRORINASPECT = "videoplayer.errorinaspect";
const std::string CSettings::SETTING_VIDEOPLAYER_STRETCH43 = "videoplayer.stretch43";
const std::string CSettings::SETTING_VIDEOPLAYER_TELETEXTENABLED = "videoplayer.teletextenabled";
Expand Down
1 change: 1 addition & 0 deletions xbmc/settings/Settings.h
Expand Up @@ -108,6 +108,7 @@ class CSettings : public CSettingCreator, public CSettingControlCreator
static const std::string SETTING_VIDEOPLAYER_ADJUSTREFRESHRATE;
static const std::string SETTING_VIDEOPLAYER_PAUSEAFTERREFRESHCHANGE;
static const std::string SETTING_VIDEOPLAYER_USEDISPLAYASCLOCK;
static const std::string SETTING_VIDEOPLAYER_ACCELERATEDPLAYBACK;
static const std::string SETTING_VIDEOPLAYER_ERRORINASPECT;
static const std::string SETTING_VIDEOPLAYER_STRETCH43;
static const std::string SETTING_VIDEOPLAYER_TELETEXTENABLED;
Expand Down

0 comments on commit 1f1c62e

Please sign in to comment.