diff options
-rw-r--r-- | xbmc/cores/IPlayer.h | 1 | ||||
-rw-r--r-- | xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecCrystalHD.cpp | 8 | ||||
-rw-r--r-- | xbmc/cores/dvdplayer/DVDPlayer.cpp | 11 | ||||
-rw-r--r-- | xbmc/cores/dvdplayer/DVDPlayer.h | 1 | ||||
-rw-r--r-- | xbmc/cores/playercorefactory/PlayerSelectionRule.cpp | 2 | ||||
-rw-r--r-- | xbmc/utils/GUIInfoManager.cpp | 4 | ||||
-rw-r--r-- | xbmc/utils/StreamDetails.cpp | 10 | ||||
-rw-r--r-- | xbmc/utils/StreamDetails.h | 2 |
8 files changed, 26 insertions, 13 deletions
diff --git a/xbmc/cores/IPlayer.h b/xbmc/cores/IPlayer.h index 43ecdc899c..d7ec6172df 100644 --- a/xbmc/cores/IPlayer.h +++ b/xbmc/cores/IPlayer.h @@ -140,6 +140,7 @@ public: virtual CStdString GetAudioCodecName(){ return "";} virtual CStdString GetVideoCodecName(){ return "";} virtual int GetPictureWidth(){ return 0;} + virtual int GetPictureHeight(){ return 0;} virtual bool GetStreamDetails(CStreamDetails &details){ return false;} virtual void ToFFRW(int iSpeed = 0){}; // Skip to next track/item inside the current media (if supported). diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecCrystalHD.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecCrystalHD.cpp index 7ffc5779f5..96a904ae97 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecCrystalHD.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecCrystalHD.cpp @@ -180,12 +180,12 @@ int CDVDVideoCodecCrystalHD::Decode(BYTE *pData, int iSize, double dts, double p free(demuxer_content); } - int rtn = 0; - // TODO: queue depth is related to the number of reference frames in encoded h.264. - // so we need to buffer until we get N ref frames + 1. - if (m_Device->GetReadyCount() > 8) + // if we have more than one frame ready, just return VC_PICTURE so dvdplayervideo will + // drain them before sending another demuxer packet. + if (m_Device->GetReadyCount() > 1) return VC_PICTURE; + int rtn = 0; if (m_Device->GetReadyCount()) rtn = VC_PICTURE; diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp index 588b971c1d..a3fbc6aff5 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp @@ -3415,6 +3415,17 @@ int CDVDPlayer::GetPictureWidth() return 0; } +int CDVDPlayer::GetPictureHeight() +{ + if (m_pDemuxer && (m_CurrentVideo.id != -1)) + { + CDemuxStreamVideo* stream = static_cast<CDemuxStreamVideo*>(m_pDemuxer->GetStream(m_CurrentVideo.id)); + if (stream) + return stream->iHeight; + } + return 0; +} + bool CDVDPlayer::GetStreamDetails(CStreamDetails &details) { if (m_pDemuxer) diff --git a/xbmc/cores/dvdplayer/DVDPlayer.h b/xbmc/cores/dvdplayer/DVDPlayer.h index f0a667e1a4..7cd3b6508a 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.h +++ b/xbmc/cores/dvdplayer/DVDPlayer.h @@ -202,6 +202,7 @@ public: virtual CStdString GetAudioCodecName(); virtual CStdString GetVideoCodecName(); virtual int GetPictureWidth(); + virtual int GetPictureHeight(); virtual bool GetStreamDetails(CStreamDetails &details); virtual bool GetCurrentSubtitle(CStdString& strSubtitle); diff --git a/xbmc/cores/playercorefactory/PlayerSelectionRule.cpp b/xbmc/cores/playercorefactory/PlayerSelectionRule.cpp index 487e08f4a5..b56a9c2f23 100644 --- a/xbmc/cores/playercorefactory/PlayerSelectionRule.cpp +++ b/xbmc/cores/playercorefactory/PlayerSelectionRule.cpp @@ -130,7 +130,7 @@ void CPlayerSelectionRule::GetPlayers(const CFileItem& item, VECPLAYERCORES &vec if (CompileRegExp(m_videoCodec, regExp) && !MatchesRegExp(streamDetails.GetVideoCodec(), regExp)) return; if (CompileRegExp(m_videoResolution, regExp) && - !MatchesRegExp(CStreamDetails::VideoWidthToResolutionDescription(streamDetails.GetVideoWidth()), regExp)) return; + !MatchesRegExp(CStreamDetails::VideoDimsToResolutionDescription(streamDetails.GetVideoWidth(), streamDetails.GetVideoHeight()), regExp)) return; if (CompileRegExp(m_videoAspect, regExp) && !MatchesRegExp(CStreamDetails::VideoAspectToAspectDescription(streamDetails.GetVideoAspect()), regExp)) return; diff --git a/xbmc/utils/GUIInfoManager.cpp b/xbmc/utils/GUIInfoManager.cpp index 1ea1926d7c..7eaaea59a6 100644 --- a/xbmc/utils/GUIInfoManager.cpp +++ b/xbmc/utils/GUIInfoManager.cpp @@ -1133,7 +1133,7 @@ CStdString CGUIInfoManager::GetLabel(int info, int contextWindow) break; case VIDEOPLAYER_VIDEO_RESOLUTION: if(g_application.IsPlaying() && g_application.m_pPlayer) - return CStreamDetails::VideoWidthToResolutionDescription(g_application.m_pPlayer->GetPictureWidth()); + return CStreamDetails::VideoDimsToResolutionDescription(g_application.m_pPlayer->GetPictureWidth(), g_application.m_pPlayer->GetPictureHeight()); break; case VIDEOPLAYER_AUDIO_CODEC: if(g_application.IsPlaying() && g_application.m_pPlayer) @@ -3933,7 +3933,7 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info) const break; case LISTITEM_VIDEO_RESOLUTION: if (item->HasVideoInfoTag()) - return CStreamDetails::VideoWidthToResolutionDescription(item->GetVideoInfoTag()->m_streamDetails.GetVideoWidth()); + return CStreamDetails::VideoDimsToResolutionDescription(item->GetVideoInfoTag()->m_streamDetails.GetVideoWidth(), item->GetVideoInfoTag()->m_streamDetails.GetVideoHeight()); break; case LISTITEM_VIDEO_ASPECT: if (item->HasVideoInfoTag()) diff --git a/xbmc/utils/StreamDetails.cpp b/xbmc/utils/StreamDetails.cpp index 546dbcbc31..cfbd3533af 100644 --- a/xbmc/utils/StreamDetails.cpp +++ b/xbmc/utils/StreamDetails.cpp @@ -431,18 +431,18 @@ void CStreamDetails::DetermineBestStreams(void) const float VIDEOASPECT_EPSILON = 0.025f; -CStdString CStreamDetails::VideoWidthToResolutionDescription(int iWidth) +CStdString CStreamDetails::VideoDimsToResolutionDescription(int iWidth, int iHeight) { - if (iWidth == 0) + if (iWidth == 0 || iHeight == 0) return ""; - else if (iWidth < 721) + else if (iWidth <= 720 && iHeight <= 480) return "480"; // 960x540 - else if (iWidth < 961) + else if (iWidth <= 960 && iHeight <= 540) return "540"; // 1280x720 - else if (iWidth < 1281) + else if (iWidth <= 1280 && iHeight <= 720) return "720"; // 1920x1080 else diff --git a/xbmc/utils/StreamDetails.h b/xbmc/utils/StreamDetails.h index e50600a5d6..8c5198d1a4 100644 --- a/xbmc/utils/StreamDetails.h +++ b/xbmc/utils/StreamDetails.h @@ -91,7 +91,7 @@ public: ~CStreamDetails() { Reset(); }; CStreamDetails& operator=(const CStreamDetails &that); - static CStdString VideoWidthToResolutionDescription(int iWidth); + static CStdString VideoDimsToResolutionDescription(int iWidth, int iHeight); static CStdString VideoAspectToAspectDescription(float fAspect); bool HasItems(void) const { return m_vecItems.size() > 0; }; |