diff options
-rw-r--r-- | xbmc/URL.cpp | 2 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 12 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/VideoPlayer.cpp | 3 | ||||
-rw-r--r-- | xbmc/input/joysticks/KeymapHandler.cpp | 19 | ||||
-rw-r--r-- | xbmc/pvr/channels/PVRChannelGroup.cpp | 32 | ||||
-rw-r--r-- | xbmc/pvr/channels/PVRChannelGroup.h | 14 | ||||
-rw-r--r-- | xbmc/test/TestTextureUtils.cpp | 12 | ||||
-rw-r--r-- | xbmc/utils/test/TestURIUtils.cpp | 6 | ||||
-rw-r--r-- | xbmc/windows/GUIMediaWindow.cpp | 5 |
9 files changed, 52 insertions, 53 deletions
diff --git a/xbmc/URL.cpp b/xbmc/URL.cpp index 4d506d88d1..95fe914f2b 100644 --- a/xbmc/URL.cpp +++ b/xbmc/URL.cpp @@ -705,7 +705,7 @@ std::string CURL::Encode(const std::string& strURLData) if (StringUtils::isasciialphanum(kar) || kar == '-' || kar == '.' || kar == '_' || kar == '!' || kar == '(' || kar == ')') strResult.push_back(kar); else - strResult += StringUtils::Format("%%%2.2X", (unsigned int)((unsigned char)kar)); + strResult += StringUtils::Format("%%%2.2x", (unsigned int)((unsigned char)kar)); } return strResult; diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp index 4129d3d6a7..df2445d295 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp @@ -596,7 +596,12 @@ int CDVDVideoCodecFFmpeg::Decode(uint8_t* pData, int iSize, double dts, double p return VC_ERROR; if (pData) + { m_iLastKeyframe++; + // put a limit on convergence count to avoid huge mem usage on streams without keyframes + if (m_iLastKeyframe > 300) + m_iLastKeyframe = 300; + } if (m_pHardware) { @@ -703,6 +708,9 @@ int CDVDVideoCodecFFmpeg::Decode(uint8_t* pData, int iSize, double dts, double p if (!m_started) { + if (m_iLastKeyframe >= 300 && m_pDecodedFrame->pict_type == AV_PICTURE_TYPE_I) + m_started = true; + av_frame_unref(m_pDecodedFrame); return VC_BUFFER; } @@ -712,10 +720,6 @@ int CDVDVideoCodecFFmpeg::Decode(uint8_t* pData, int iSize, double dts, double p else m_interlaced = false; - // put a limit on convergence count to avoid huge mem usage on streams without keyframes - if (m_iLastKeyframe > 300) - m_iLastKeyframe = 300; - //! @todo check if this work-around is still required if(m_pCodecContext->codec_id == AV_CODEC_ID_SVQ3) m_started = true; diff --git a/xbmc/cores/VideoPlayer/VideoPlayer.cpp b/xbmc/cores/VideoPlayer/VideoPlayer.cpp index e2b77c3ddc..bd11cd8a76 100644 --- a/xbmc/cores/VideoPlayer/VideoPlayer.cpp +++ b/xbmc/cores/VideoPlayer/VideoPlayer.cpp @@ -2013,7 +2013,8 @@ void CVideoPlayer::HandlePlaySpeed() (m_CurrentAudio.packets == 0 && m_CurrentVideo.packets > threshold); if (m_CurrentAudio.syncState == IDVDStreamPlayer::SYNC_WAITSYNC && - m_CurrentAudio.avsync == CCurrentStream::AV_SYNC_CONT) + (m_CurrentAudio.avsync == CCurrentStream::AV_SYNC_CONT || + m_CurrentVideo.syncState == IDVDStreamPlayer::SYNC_INSYNC)) { m_CurrentAudio.syncState = IDVDStreamPlayer::SYNC_INSYNC; m_CurrentAudio.avsync = CCurrentStream::AV_SYNC_NONE; diff --git a/xbmc/input/joysticks/KeymapHandler.cpp b/xbmc/input/joysticks/KeymapHandler.cpp index 7d2f459893..ca14cc5da8 100644 --- a/xbmc/input/joysticks/KeymapHandler.cpp +++ b/xbmc/input/joysticks/KeymapHandler.cpp @@ -139,6 +139,25 @@ bool CKeymapHandler::SendDigitalAction(unsigned int keyId, unsigned int holdTime CAction action(CButtonTranslator::GetInstance().GetAction(g_windowManager.GetActiveWindowID(), CKey(keyId, holdTimeMs))); if (action.GetID() > 0) { + //! @todo Add "holdtime" parameter to joystick.xml. For now we MUST only + // send held actions for basic navigation commands! + if (holdTimeMs > 0) + { + switch (action.GetID()) + { + case ACTION_MOVE_LEFT: + case ACTION_MOVE_RIGHT: + case ACTION_MOVE_UP: + case ACTION_MOVE_DOWN: + case ACTION_PAGE_UP: + case ACTION_PAGE_DOWN: + break; + + default: + return true; + } + } + CInputManager::GetInstance().QueueAction(action); return true; } diff --git a/xbmc/pvr/channels/PVRChannelGroup.cpp b/xbmc/pvr/channels/PVRChannelGroup.cpp index f117f54ce2..3f2fd656a2 100644 --- a/xbmc/pvr/channels/PVRChannelGroup.cpp +++ b/xbmc/pvr/channels/PVRChannelGroup.cpp @@ -31,7 +31,6 @@ #include "settings/lib/Setting.h" #include "settings/Settings.h" #include "threads/SingleLock.h" -#include "utils/JobManager.h" #include "utils/log.h" #include "utils/StringUtils.h" @@ -266,37 +265,26 @@ bool CPVRChannelGroup::MoveChannel(unsigned int iOldChannelNumber, unsigned int void CPVRChannelGroup::SearchAndSetChannelIcons(bool bUpdateDb /* = false */) { - // searching and setting channel icons may take some time, and (more important) - // it triggers GUI which might lead to deadlocks if directly called. - PVR_CHANNEL_GROUP_MEMBERS groupMembers; - { - CSingleLock lock(m_critSection); - groupMembers = m_members; - } - - CJobManager::GetInstance().AddJob(new CPVRSearchAndSetChannelIcons(groupMembers, bUpdateDb), nullptr); -} - -bool CPVRSearchAndSetChannelIcons::DoWork() -{ std::string iconPath = CSettings::GetInstance().GetString(CSettings::SETTING_PVRMENU_ICONPATH); if (iconPath.empty()) - return true; + return; const CPVRDatabasePtr database(g_PVRManager.GetTVDatabase()); if (!database) - return false; + return; /* fetch files in icon path for fast lookup */ CFileItemList fileItemList; XFILE::CDirectory::GetDirectory(iconPath, fileItemList, ".jpg|.png|.tbn"); if (fileItemList.IsEmpty()) - return true; + return; CGUIDialogExtendedProgressBar* dlgProgress = (CGUIDialogExtendedProgressBar*)g_windowManager.GetWindow(WINDOW_DIALOG_EXT_PROGRESS); CGUIDialogProgressBarHandle* dlgProgressHandle = dlgProgress ? dlgProgress->GetHandle(g_localizeStrings.Get(19287)) : NULL; + CSingleLock lock(m_critSection); + /* create a map for fast lookup of normalized file base name */ std::map<std::string, std::string> fileItemMap; const VECFILEITEMS &items = fileItemList.GetList(); @@ -310,14 +298,14 @@ bool CPVRSearchAndSetChannelIcons::DoWork() int channelIndex = 0; CPVRChannelPtr channel; - for(const auto &groupMember : m_groupMembers) + for(PVR_CHANNEL_GROUP_MEMBERS::const_iterator it = m_members.begin(); it != m_members.end(); ++it) { - channel = groupMember.second.channel; + channel = it->second.channel; /* update progress dialog */ if (dlgProgressHandle) { - dlgProgressHandle->SetProgress(channelIndex++, m_groupMembers.size()); + dlgProgressHandle->SetProgress(channelIndex++, m_members.size()); dlgProgressHandle->SetText(channel->ChannelName()); } @@ -342,7 +330,7 @@ bool CPVRSearchAndSetChannelIcons::DoWork() channel->SetIconPath(itItem->second, g_advancedSettings.m_bPVRAutoScanIconsUserSet); } - if (m_bUpdateDb) + if (bUpdateDb) channel->Persist(); //! @todo start channel icon scraper here if nothing was found @@ -350,8 +338,6 @@ bool CPVRSearchAndSetChannelIcons::DoWork() if (dlgProgressHandle) dlgProgressHandle->MarkFinished(); - - return true; } /********** sort methods **********/ diff --git a/xbmc/pvr/channels/PVRChannelGroup.h b/xbmc/pvr/channels/PVRChannelGroup.h index 90b9ef5291..dd2ede596a 100644 --- a/xbmc/pvr/channels/PVRChannelGroup.h +++ b/xbmc/pvr/channels/PVRChannelGroup.h @@ -546,18 +546,4 @@ namespace PVR private: CPVRChannelGroupPtr m_group; }; - - class CPVRSearchAndSetChannelIcons : public CJob - { - public: - CPVRSearchAndSetChannelIcons(const PVR_CHANNEL_GROUP_MEMBERS &groupMembers, bool bUpdateDb) - : m_groupMembers(groupMembers), m_bUpdateDb(bUpdateDb) {} - virtual ~CPVRSearchAndSetChannelIcons() {} - virtual const char *GetType() const { return "pvr-channelgroup-searchandsetchannelicons"; } - - virtual bool DoWork(); - private: - PVR_CHANNEL_GROUP_MEMBERS m_groupMembers; - const bool m_bUpdateDb; - }; } diff --git a/xbmc/test/TestTextureUtils.cpp b/xbmc/test/TestTextureUtils.cpp index 917eca74ff..c9764ad1f1 100644 --- a/xbmc/test/TestTextureUtils.cpp +++ b/xbmc/test/TestTextureUtils.cpp @@ -35,12 +35,12 @@ typedef struct const char *out; } TestFiles; -const TestFiles test_files[] = {{ "/path/to/image/file.jpg", "", "", "image://%2Fpath%2Fto%2Fimage%2Ffile.jpg/" }, - { "/path/to/image/file.jpg", "", "size=thumb", "image://%2Fpath%2Fto%2Fimage%2Ffile.jpg/transform?size=thumb" }, - { "/path/to/video/file.mkv", "video", "", "image://video@%2Fpath%2Fto%2Fvideo%2Ffile.mkv/" }, - { "/path/to/music/file.mp3", "music", "", "image://music@%2Fpath%2Fto%2Fmusic%2Ffile.mp3/" }, - { "image://%2Fpath%2Fto%2Fimage%2Ffile.jpg/", "", "", "image://%2Fpath%2Fto%2Fimage%2Ffile.jpg/" }, - { "image://%2Fpath%2Fto%2Fimage%2Ffile.jpg/transform?size=thumb", "", "size=thumb", "image://%2Fpath%2Fto%2Fimage%2Ffile.jpg/transform?size=thumb" }}; +const TestFiles test_files[] = {{ "/path/to/image/file.jpg", "", "", "image://%2fpath%2fto%2fimage%2ffile.jpg/" }, + { "/path/to/image/file.jpg", "", "size=thumb", "image://%2fpath%2fto%2fimage%2ffile.jpg/transform?size=thumb" }, + { "/path/to/video/file.mkv", "video", "", "image://video@%2fpath%2fto%2fvideo%2ffile.mkv/" }, + { "/path/to/music/file.mp3", "music", "", "image://music@%2fpath%2fto%2fmusic%2ffile.mp3/" }, + { "image://%2fpath%2fto%2fimage%2ffile.jpg/", "", "", "image://%2fpath%2fto%2fimage%2ffile.jpg/" }, + { "image://%2fpath%2fto%2fimage%2ffile.jpg/transform?size=thumb", "", "size=thumb", "image://%2fpath%2fto%2fimage%2ffile.jpg/transform?size=thumb" }}; class TestTextureUtils : diff --git a/xbmc/utils/test/TestURIUtils.cpp b/xbmc/utils/test/TestURIUtils.cpp index 19ab5fe2d5..6b95a6b179 100644 --- a/xbmc/utils/test/TestURIUtils.cpp +++ b/xbmc/utils/test/TestURIUtils.cpp @@ -452,7 +452,7 @@ TEST_F(TestURIUtils, CreateArchivePath) { std::string ref, var; - ref = "zip://%2Fpath%2Fto%2F/file"; + ref = "zip://%2fpath%2fto%2f/file"; var = URIUtils::CreateArchivePath("zip", CURL("/path/to/"), "file").Get(); EXPECT_STREQ(ref.c_str(), var.c_str()); } @@ -546,8 +546,8 @@ TEST_F(TestURIUtils, GetRealPath) EXPECT_STRCASEEQ(ref.c_str(), URIUtils::GetRealPath("rar://%2fpath%2fto%2fsome%2f..%2frar/subpath/to/file").c_str()); // test rar/zip path in rar/zip path - ref ="zip://rar%3A%2F%2F%252Fpath%252Fto%252Frar%2Fpath%2Fto%2Fzip/subpath/to/file"; - EXPECT_STRCASEEQ(ref.c_str(), URIUtils::GetRealPath("zip://rar%3A%2F%2F%252Fpath%252Fto%252Fsome%252F..%252Frar%2Fpath%2Fto%2Fsome%2F..%2Fzip/subpath/to/some/../file").c_str()); + ref ="zip://rar%3a%2f%2f%252Fpath%252Fto%252Frar%2fpath%2fto%2fzip/subpath/to/file"; + EXPECT_STRCASEEQ(ref.c_str(), URIUtils::GetRealPath("zip://rar%3a%2f%2f%252Fpath%252Fto%252Fsome%252F..%252Frar%2fpath%2fto%2fsome%2f..%2fzip/subpath/to/some/../file").c_str()); } TEST_F(TestURIUtils, UpdateUrlEncoding) diff --git a/xbmc/windows/GUIMediaWindow.cpp b/xbmc/windows/GUIMediaWindow.cpp index 896102f3f6..33dc5225e7 100644 --- a/xbmc/windows/GUIMediaWindow.cpp +++ b/xbmc/windows/GUIMediaWindow.cpp @@ -503,7 +503,10 @@ bool CGUIMediaWindow::OnMessage(CGUIMessage& message) resetHistory = true; } if (resetHistory) + { + m_vecItems->RemoveDiscCache(GetID()); SetHistoryForPath(m_vecItems->GetPath()); + } } if (message.GetParam1() != WINDOW_INVALID) { // first time to this window - make sure we set the root path @@ -511,7 +514,7 @@ bool CGUIMediaWindow::OnMessage(CGUIMessage& message) } if (message.GetParam2() == PLUGIN_REFRESH_DELAY) { - Refresh(true); + Refresh(); SetInitialVisibility(); RestoreControlStates(); SetInitialVisibility(); |