From 84bd75d9bd80930531a0dac4d2df7eb4ab680401 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Tue, 9 Dec 2014 21:34:48 +0100 Subject: [PATCH] projects/RPi/patches/kodi: update RPi support patch Signed-off-by: Stephan Raue --- .../RPi/patches/kodi/kodi-001-newclock4.patch | 4510 +++++++++-------- 1 file changed, 2501 insertions(+), 2009 deletions(-) diff --git a/projects/RPi/patches/kodi/kodi-001-newclock4.patch b/projects/RPi/patches/kodi/kodi-001-newclock4.patch index 1aec683e71..b926413a75 100644 --- a/projects/RPi/patches/kodi/kodi-001-newclock4.patch +++ b/projects/RPi/patches/kodi/kodi-001-newclock4.patch @@ -1,7 +1,7 @@ -From 213fada4b79f1510b62ea5d3e0db625e3b932790 Mon Sep 17 00:00:00 2001 +From 59eaf2f7a4dffe27c05e71e2b40508eb24047afb Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 18:19:32 +0100 -Subject: [PATCH 01/95] [rbp/omxplayer] When opening a stream don't try to +Subject: [PATCH 001/102] [rbp/omxplayer] When opening a stream don't try to update gui so often --- @@ -25,10 +25,10 @@ index e7cfcdd..20b99ad 100644 g_windowManager.ProcessRenderLoop(false); if (allowCancel && dialog->IsCanceled()) -From 60937aa306d5ae25d3c1bb81d27e1505eca95151 Mon Sep 17 00:00:00 2001 +From 6c6e92d2fd71f335dd92a8c58b73fa32b56eaa3b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 29 Apr 2014 15:23:22 +0100 -Subject: [PATCH 02/95] [ffmpeg] Speed up wtv index creation +Subject: [PATCH 002/102] [ffmpeg] Speed up wtv index creation The index creation is O(N^2) with number of entries (typically thousands). On a Pi this can take more than 60 seconds to execute for a recording of a few hours. @@ -114,10 +114,10 @@ index 0000000..4ac5636 + } + } -From eeae799ba03194477ada9c0ce75eee20d3063be0 Mon Sep 17 00:00:00 2001 +From 8ff91085bd5fde57e829ff33e09b7c97d1911b2f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 2 Aug 2014 17:48:04 +0100 -Subject: [PATCH 08/95] [omx] Report decoded image name +Subject: [PATCH 003/102] [omx] Report decoded image name --- xbmc/cores/omxplayer/OMXImage.cpp | 1 + @@ -136,66 +136,10 @@ index aa413b9..22ec3f0 100644 else { -From a1eb97798fa8858a6bc0cc1732aa3b0d7d5ec400 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sat, 14 Dec 2013 16:55:05 +0000 -Subject: [PATCH 09/95] logging: Add microsecond timer to log messages - ---- - xbmc/utils/log.cpp | 17 +++++++++++++++-- - 1 file changed, 15 insertions(+), 2 deletions(-) - -diff --git a/xbmc/utils/log.cpp b/xbmc/utils/log.cpp -index 3443f12..31c4a99 100644 ---- a/xbmc/utils/log.cpp -+++ b/xbmc/utils/log.cpp -@@ -24,6 +24,7 @@ - #include "threads/Thread.h" - #include "utils/StringUtils.h" - #include "CompileInfo.h" -+#include "utils/TimeUtils.cpp" - - static const char* const levelNames[] = - {"DEBUG", "INFO", "NOTICE", "WARNING", "ERROR", "SEVERE", "FATAL", "NONE"}; -@@ -198,19 +199,31 @@ void CLog::PrintDebugString(const std::string& line) - - bool CLog::WriteLogString(int logLevel, const std::string& logString) - { -+#if defined(TARGET_LINUX) -+ static const char* prefixFormat = "%02.2d:%02.2d:%02.2d %10.6f T:%" PRIu64" %7s: "; -+#else - static const char* prefixFormat = "%02.2d:%02.2d:%02.2d T:%" PRIu64" %7s: "; -- -+#endif - std::string strData(logString); - /* fixup newline alignment, number of spaces should equal prefix length */ - StringUtils::Replace(strData, "\n", "\n "); - - int hour, minute, second; - s_globals.m_platform.GetCurrentLocalTime(hour, minute, second); -- -+ -+#if defined(TARGET_LINUX) -+ struct timespec now; -+ clock_gettime(CLOCK_MONOTONIC, &now); -+ float Now = now.tv_sec + now.tv_nsec * 1e-9; -+#endif -+ - strData = StringUtils::Format(prefixFormat, - hour, - minute, - second, -+#if defined(TARGET_LINUX) -+ Now, -+#endif - (uint64_t)CThread::GetCurrentThreadId(), - levelNames[logLevel]) + strData; - - -From 768c21bae98cf811276327b1deed1a99c1ff9e10 Mon Sep 17 00:00:00 2001 +From 2d6f53bd369d5efa4fe7b2b56add0b5b2b4bade8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 8 Mar 2014 15:36:06 +0000 -Subject: [PATCH 10/95] [hifiberry] Hack: force it to be recognised as IEC958 +Subject: [PATCH 004/102] [hifiberry] Hack: force it to be recognised as IEC958 capable to enable passthrough options --- @@ -218,11 +162,11 @@ index d30cbab..b268819 100644 info.m_displayName.substr(info.m_displayName.size()-5) == " HDMI") { -From 6a47f8901e5d6a60d3c1f2c5c8da8ad5e2ed71c7 Mon Sep 17 00:00:00 2001 +From a188bbe966e8392aeace05a56c838db713d9862c Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 11 Dec 2013 17:21:54 +0000 -Subject: [PATCH 11/95] Move the reference-counting of Begin and End calls from - DX and GL source files into GUIFontTTF.cpp. +Subject: [PATCH 005/102] Move the reference-counting of Begin and End calls + from DX and GL source files into GUIFontTTF.cpp. --- xbmc/guilib/GUIFontTTF.cpp | 21 ++++++ @@ -609,10 +553,10 @@ index c0bb53a..735fb3a 100644 protected: virtual CBaseTexture* ReallocTexture(unsigned int& newHeight); -From f29fd426eaeedfaba2308deccca580d9c567db73 Mon Sep 17 00:00:00 2001 +From 7f1c111a03120b57d2a063d35c578eb85f0667f6 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 11 Dec 2013 18:47:54 +0000 -Subject: [PATCH 12/95] Convert CGUIFontTTFBase::m_vertex to be managed as a +Subject: [PATCH 006/102] Convert CGUIFontTTFBase::m_vertex to be managed as a std::vector. Also retired CGUIFontTTFBase::m_vertex_count and @@ -792,10 +736,10 @@ index 97853fd..b76c6a5 100644 *vertices++ = m_vertex[i]; *vertices++ = m_vertex[i+1]; -From 3ce54634e23b5147b19c7790ad0d2b0e468ef272 Mon Sep 17 00:00:00 2001 +From f26008b973c46960acab0a9bdb0b1fcf23602b8a Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Mon, 16 Dec 2013 18:58:12 +0000 -Subject: [PATCH 13/95] CGUIFontTTFBase::RenderCharacter can now append to +Subject: [PATCH 007/102] CGUIFontTTFBase::RenderCharacter can now append to arbitrary vectors of vertices rather than only CGUIFontTTFBase::m_vertex --- @@ -868,10 +812,10 @@ index 5675725..a5d44f4 100644 virtual CBaseTexture* ReallocTexture(unsigned int& newHeight) = 0; -From 9094476e380fe0057c8b596cad18c44ca2436d96 Mon Sep 17 00:00:00 2001 +From 1c5163f7494f24abe1afcd955d22e819f7ec4141 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 17:18:38 +0000 -Subject: [PATCH 14/95] Add a cache of font glyph bounding box vertices. +Subject: [PATCH 008/102] Add a cache of font glyph bounding box vertices. This is implemented as a template because ultimately we will key on different parameters and store values of different types, depending upon whether we @@ -894,7 +838,7 @@ applicable transformation matrices permit the use of hardware clipping. create mode 100644 xbmc/guilib/GUIFontCache.h diff --git a/Kodi.xcodeproj/project.pbxproj b/Kodi.xcodeproj/project.pbxproj -index 5a81f22..debdf4e 100644 +index 6dd3cf2..1f04a0b 100644 --- a/Kodi.xcodeproj/project.pbxproj +++ b/Kodi.xcodeproj/project.pbxproj @@ -168,6 +168,9 @@ @@ -907,7 +851,7 @@ index 5a81f22..debdf4e 100644 32C631281423A90F00F18420 /* JpegIO.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32C631261423A90F00F18420 /* JpegIO.cpp */; }; 36A9443D15821E2800727135 /* DatabaseUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 36A9443B15821E2800727135 /* DatabaseUtils.cpp */; }; 36A9444115821E7C00727135 /* SortUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 36A9443F15821E7C00727135 /* SortUtils.cpp */; }; -@@ -4021,6 +4024,8 @@ +@@ -4018,6 +4021,8 @@ 1DAFDB7B16DFDCA7007F8C68 /* PeripheralBusCEC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PeripheralBusCEC.h; sourceTree = ""; }; 1DE0443315828F4B005DDB4D /* Exception.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Exception.cpp; path = commons/Exception.cpp; sourceTree = ""; }; 1DE0443415828F4B005DDB4D /* Exception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Exception.h; path = commons/Exception.h; sourceTree = ""; }; @@ -916,7 +860,7 @@ index 5a81f22..debdf4e 100644 32C631261423A90F00F18420 /* JpegIO.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JpegIO.cpp; sourceTree = ""; }; 32C631271423A90F00F18420 /* JpegIO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JpegIO.h; sourceTree = ""; }; 36A9443B15821E2800727135 /* DatabaseUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DatabaseUtils.cpp; sourceTree = ""; }; -@@ -6537,6 +6542,8 @@ +@@ -6532,6 +6537,8 @@ 18B7C7101294222D009E7A26 /* GUIFixedListContainer.h */, 18B7C76B1294222E009E7A26 /* GUIFont.cpp */, 18B7C7111294222D009E7A26 /* GUIFont.h */, @@ -925,7 +869,7 @@ index 5a81f22..debdf4e 100644 18B7C76C1294222E009E7A26 /* GUIFontManager.cpp */, 18B7C7121294222D009E7A26 /* GUIFontManager.h */, 18B7C76D1294222E009E7A26 /* GUIFontTTF.cpp */, -@@ -11045,6 +11052,7 @@ +@@ -11038,6 +11045,7 @@ 7C5608C70F1754930056433A /* ExternalPlayer.cpp in Sources */, F584E12E0F257C5100DB26A5 /* HTTPDirectory.cpp in Sources */, F54C51D20F1E783200D46E3C /* GUIDialogKaraokeSongSelector.cpp in Sources */, @@ -933,7 +877,7 @@ index 5a81f22..debdf4e 100644 F54C51D50F1E784800D46E3C /* karaokelyricscdg.cpp in Sources */, F54C51D80F1E785700D46E3C /* karaokelyrics.cpp in Sources */, F54C51E50F1E787700D46E3C /* karaokelyricstextkar.cpp in Sources */, -@@ -12721,6 +12729,7 @@ +@@ -12712,6 +12720,7 @@ DFF0F45B17528350002DA3A4 /* Control.cpp in Sources */, DFF0F45C17528350002DA3A4 /* Dialog.cpp in Sources */, DFF0F45D17528350002DA3A4 /* File.cpp in Sources */, @@ -941,7 +885,7 @@ index 5a81f22..debdf4e 100644 DFF0F45E17528350002DA3A4 /* InfoTagMusic.cpp in Sources */, DFF0F45F17528350002DA3A4 /* InfoTagVideo.cpp in Sources */, DFF0F46017528350002DA3A4 /* Keyboard.cpp in Sources */, -@@ -13517,6 +13526,7 @@ +@@ -13507,6 +13516,7 @@ E499131D174E5DAD00741B6D /* GUIVisualisationControl.cpp in Sources */, E499131E174E5DAD00741B6D /* GUIWindow.cpp in Sources */, E499131F174E5DAD00741B6D /* GUIWindowManager.cpp in Sources */, @@ -950,10 +894,10 @@ index 5a81f22..debdf4e 100644 E4991321174E5DAD00741B6D /* imagefactory.cpp in Sources */, E4991322174E5DAD00741B6D /* IWindowManagerCallback.cpp in Sources */, diff --git a/project/VS2010Express/XBMC.vcxproj b/project/VS2010Express/XBMC.vcxproj -index ce1b60a..d1a3703 100644 +index aca7b82..2b50d41 100644 --- a/project/VS2010Express/XBMC.vcxproj +++ b/project/VS2010Express/XBMC.vcxproj -@@ -427,6 +427,7 @@ +@@ -426,6 +426,7 @@ @@ -961,7 +905,7 @@ index ce1b60a..d1a3703 100644 -@@ -1753,6 +1754,7 @@ +@@ -1751,6 +1752,7 @@ @@ -970,7 +914,7 @@ index ce1b60a..d1a3703 100644 diff --git a/project/VS2010Express/XBMC.vcxproj.filters b/project/VS2010Express/XBMC.vcxproj.filters -index b570d6b..4990605 100644 +index 7603447..aa45adc 100644 --- a/project/VS2010Express/XBMC.vcxproj.filters +++ b/project/VS2010Express/XBMC.vcxproj.filters @@ -994,6 +994,9 @@ @@ -983,7 +927,7 @@ index b570d6b..4990605 100644 guilib -@@ -3897,6 +3900,9 @@ +@@ -3894,6 +3897,9 @@ guilib @@ -1631,10 +1575,10 @@ index f351c99..9036ba9 100644 + return !operator==(a, b); +} -From f7ea60e9475a671f697bf05495289563c693fd04 Mon Sep 17 00:00:00 2001 +From c7346c9d17417c70de8af1a3ff214f7cd3237a82 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 23 Jan 2014 22:24:17 +0000 -Subject: [PATCH 15/95] Lay the groundwork for hardware clipping. +Subject: [PATCH 009/102] Lay the groundwork for hardware clipping. For glScissor() to replace CGraphicContext::ClipRect, a necessary condition is that no shear or rotation is introduced between the coordinate systems @@ -1896,10 +1840,10 @@ index 98e398a..81ee49e 100644 virtual void ResetScissors(); -From 87cc9b25471fceebd816aff415e41afc00ce753a Mon Sep 17 00:00:00 2001 +From 803f51880911771af5a2f6bf28630fcc62c09816 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 23 Jan 2014 16:42:22 +0000 -Subject: [PATCH 16/95] Increase font cache hit rate by keying on the +Subject: [PATCH 010/102] Increase font cache hit rate by keying on the fractional part of m_originX and m_originY *after* they have been through the graphics context's transformation matrix, plus the scale/rotation elements of the matrix, rather than the origin in the original frame of reference plus @@ -2100,10 +2044,10 @@ index 3b93672..258dffa 100644 private: virtual bool FirstBegin() = 0; -From a89cd1ce9b747f997c4435bb52b951f7533a0eca Mon Sep 17 00:00:00 2001 +From 05049b298562fb7a6f48fbb8b7d4b4c6a568b3d9 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 8 Jan 2014 12:16:33 +0000 -Subject: [PATCH 17/95] Rewrite of scrolling text code. +Subject: [PATCH 011/102] Rewrite of scrolling text code. No longer shuffles the string round to minimise the number of characters before the clipping rectangle; this doesn't save much on rendering time but @@ -2419,10 +2363,10 @@ index 2cda726..fbc579e 100644 private: void Process(); -From be3d5e40bb2a239eff86d5e5d759da419f7d51e3 Mon Sep 17 00:00:00 2001 +From a6ec97a53d2c6b57d7629b0804ac91a9d79231ce Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Mon, 27 Jan 2014 23:21:10 +0000 -Subject: [PATCH 18/95] Move the application of the translation offsets into +Subject: [PATCH 012/102] Move the application of the translation offsets into the GLES code. Still all pure software at this stage. Main change is in the data types at @@ -2616,10 +2560,10 @@ index 9935ea4..18c9358 100644 memset(newTexture->GetPixels(), 0, m_textureHeight * newTexture->GetPitch()); if (m_texture) -From ba49d0cca3a1e3929265cc9a2c1f7cc709c63753 Mon Sep 17 00:00:00 2001 +From 092d63f77b6a4259871cf0cd49e2242952f1d8bd Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 15:28:06 +0000 -Subject: [PATCH 19/95] Rather than applying the translation offsets to the +Subject: [PATCH 013/102] Rather than applying the translation offsets to the vertices, now applies them to the model view matrix from the top of the matrix stack and pushes it over to OpenGL. The vertices themselves are still all held client-side. @@ -2763,10 +2707,10 @@ index 81ee49e..d2f9cd1 100644 protected: virtual void SetVSyncImpl(bool enable) = 0; -From 49a57c3871e593ea094d3c2894b57d2d2d5d86e6 Mon Sep 17 00:00:00 2001 +From 42c1c659035186f940af17b3558f16c44e71d500 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 29 Jan 2014 13:21:19 +0000 -Subject: [PATCH 20/95] Enable hardware clipping. +Subject: [PATCH 014/102] Enable hardware clipping. --- xbmc/guilib/GUIFontTTF.cpp | 4 ++-- @@ -2838,10 +2782,10 @@ index ea08bf4..b63e337 100644 glUniformMatrix4fv(modelLoc, 1, GL_FALSE, g_matrices.GetMatrix(MM_MODELVIEW)); } -From 561016657e85b290f3d9f5c072ec0e63f8912c80 Mon Sep 17 00:00:00 2001 +From 876aa1335868b8101ec340188c881eab11d1e1b9 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 15:32:51 +0000 -Subject: [PATCH 21/95] Move the vertex data across to a vertex buffer object +Subject: [PATCH 015/102] Move the vertex data across to a vertex buffer object just prior to drawing. --- @@ -2892,11 +2836,11 @@ index b63e337..b00055d 100644 // Disable the attributes used by this shader -From bbf709613e184fc8d742bfcb3a9900b8ff701ac6 Mon Sep 17 00:00:00 2001 +From 4b1bd2db78d5c421251550f061c6e5a8fbd4a819 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 16:04:04 +0000 -Subject: [PATCH 22/95] Move vertex data into an OpenGL VBO when the font cache - entry is populated. +Subject: [PATCH 016/102] Move vertex data into an OpenGL VBO when the font + cache entry is populated. The font cache now stores the "name" (handle) of the VBO, rather than a vector of vertices. @@ -3168,10 +3112,10 @@ index 735fb3a..6102c90 100644 protected: virtual CBaseTexture* ReallocTexture(unsigned int& newHeight); -From d7f9cac2aad587f3fcd98bd8e134296dc099a541 Mon Sep 17 00:00:00 2001 +From 1ba608c8a4bea61a0f5a316507400b4a686058e9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 1 Nov 2014 22:15:13 +0000 -Subject: [PATCH 23/95] Switch from glDrawArrays() to glDrawElements(). +Subject: [PATCH 017/102] Switch from glDrawArrays() to glDrawElements(). This involves setting up a static VBO containing the indexes necessary to convert from quads to triangles on the fly in the GPU. @@ -3392,10 +3336,10 @@ index d2a94c9..7b6097a 100644 if (m_display != EGL_NO_DISPLAY) -From 89c773e8269af598329f6702e59fd6ec0544e382 Mon Sep 17 00:00:00 2001 +From a22dce0d9b1859a413f2bf36b49467f3f4476575 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 1 May 2014 16:28:39 +0100 -Subject: [PATCH 24/95] Improved file buffering in CArchive +Subject: [PATCH 018/102] Improved file buffering in CArchive Even though memcpy is typically inlined by the compiler into byte/word loads and stores (at least for release builds), the frequency with which 1, 2 and 4 @@ -3455,10 +3399,10 @@ index 6ed0f8f..8506d95 100644 } else -From 7bf8d6278c57d9463e8796405c2d55be9b117704 Mon Sep 17 00:00:00 2001 +From acec891318761ae00b0741e236f2922192550a2a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 10 Sep 2014 22:07:21 +0100 -Subject: [PATCH 25/95] [mmal] Allow mmal codec for dvd stills +Subject: [PATCH 019/102] [mmal] Allow mmal codec for dvd stills --- xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp | 4 ++++ @@ -3480,20 +3424,20 @@ index 10648c5..bea5e4f 100644 { // If dvd is an mpeg2 and hint.stills -From 2b4e9b8080b62dc6161bf0edf06219159cc6a7e5 Mon Sep 17 00:00:00 2001 +From 3570851100f111e42bc797a058d51aa52a921aec Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 12 Aug 2014 00:31:36 +0100 -Subject: [PATCH 26/95] [omxcodec] Don't force software codec with dvds +Subject: [PATCH 020/102] [omxcodec] Don't force software codec with dvds --- xbmc/cores/dvdplayer/DVDPlayer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index b6bcb8d..54e8548 100644 +index a9bab4c..26d3903 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -3216,7 +3216,9 @@ bool CDVDPlayer::OpenVideoStream(CDVDStreamInfo& hint, bool reset) +@@ -3219,7 +3219,9 @@ bool CDVDPlayer::OpenVideoStream(CDVDStreamInfo& hint, bool reset) hint.aspect = aspect; hint.forced_aspect = true; } @@ -3504,11 +3448,11 @@ index b6bcb8d..54e8548 100644 CDVDInputStream::IMenus* pMenus = dynamic_cast(m_pInputStream); -From 36b061f5bb94acb0c991c4a9c0fe75a0682b20fb Mon Sep 17 00:00:00 2001 +From a002f79cec4242d9a86f1b2459d595824f45ab76 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 16 Apr 2014 21:18:06 +0100 -Subject: [PATCH 27/95] [omxplayer] Don't propagate 3d flags based on supported - 3d modes +Subject: [PATCH 021/102] [omxplayer] Don't propagate 3d flags based on + supported 3d modes --- xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 29 ++++------------------------- @@ -3560,10 +3504,10 @@ index ac838ce..605318c9 100644 unsigned int iDisplayWidth = width; unsigned int iDisplayHeight = height; -From ddd800c8fadc141149a767c87e4af04aff0f3c16 Mon Sep 17 00:00:00 2001 +From 4a2099ed5c7e06b59fbd7c7502e65d3123d92a08 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Apr 2014 13:00:52 +0100 -Subject: [PATCH 28/95] [graphics] Don't set stereo mode based on resolution +Subject: [PATCH 022/102] [graphics] Don't set stereo mode based on resolution The resolution change should follow stereo mode --- @@ -3621,10 +3565,10 @@ index 3cb5587..fe6ebf4 100644 m_iScreenWidth = info_mod.iWidth; -From 6439cc1fdac5e4c63903933b492657525c2cb6a3 Mon Sep 17 00:00:00 2001 +From 3f45ff4c9c0bbb3fd0352dc7928d66af0059012c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Apr 2014 13:01:51 +0100 -Subject: [PATCH 29/95] [graphics] Allow switching to a more suitable 3D +Subject: [PATCH 023/102] [graphics] Allow switching to a more suitable 3D resolution --- @@ -3710,10 +3654,10 @@ index 2904c1b..8d3774f 100644 void ResetOverscan(RESOLUTION_INFO &resinfo); void ResetScreenParameters(RESOLUTION res); -From 96f2b4b767b347ba9efa5fbbe9af14142e520b68 Mon Sep 17 00:00:00 2001 +From a5fa290aca27933916a6f8e564791c2e86ad1829 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Apr 2014 13:38:55 +0100 -Subject: [PATCH 30/95] [3D] Support switching to 3D resolutions +Subject: [PATCH 024/102] [3D] Support switching to 3D resolutions Include matching 3D flags (SBS/TAB) in the score of a resolution to switch to, to enable switching to 3d modes. Also remove the old code that treated 3D modes differently when assigning a score. @@ -3795,10 +3739,10 @@ index 83c3adb..8076e76 100644 return current; } -From a76122f1edaafe6d23e3acaf9e341ff94aea8231 Mon Sep 17 00:00:00 2001 +From 61fd4856d2004a5e13455d7191c2fc72ae3b33ee Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 23 Apr 2014 00:05:07 +0100 -Subject: [PATCH 31/95] [graphics] Make pixel ratio for 3d modes consistent +Subject: [PATCH 025/102] [graphics] Make pixel ratio for 3d modes consistent Note: Use the stored stereo flags from lists of resolutions. Use current stereo mode for current resolution. @@ -4001,10 +3945,1814 @@ index c58c28a..bf1e589 100644 AddUniqueResolution(res2, resolutions); -From 1e4f9e04f77530d6e96cf788693debd724f5ecc5 Mon Sep 17 00:00:00 2001 +From f7acff66fe76bf5bbd7dcf21094391c76b81f275 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 10 Aug 2014 16:45:16 +0100 +Subject: [PATCH 026/102] filesystem: Make support of browsing into archives + optional + +The ability to browse, scan and play content in archives can cause problems on low powered/low memory devices. +It's quite common to see reports of a large rar file that causes xbmc to crash with an out-of-memory error when browsing or scanning. +It also can be slow as any archive in the directory is opened and extracted. + +Add a settings option to enable this feature and default to disabled on Pi +--- + language/English/strings.po | 9 +++++++++ + system/settings/rbp.xml | 10 ++++++++++ + system/settings/settings.xml | 5 +++++ + xbmc/filesystem/FileDirectoryFactory.cpp | 4 ++++ + 4 files changed, 28 insertions(+) + +diff --git a/language/English/strings.po b/language/English/strings.po +index 15090fc..8e67be0 100755 +--- a/language/English/strings.po ++++ b/language/English/strings.po +@@ -16115,4 +16115,13 @@ msgstr "" + #: system/settings/rbp.xml + msgctxt "#38010" + msgid "GPU accelerated" ++ ++#: system/settings/settings.xml ++msgctxt "#38020" ++msgid "Support browsing into archives" ++msgstr "" ++ ++#: system/settings/settings.xml ++msgctxt "#38021" ++msgid "Allow viewing and playing files in archives (e.g. zip, rar)" + msgstr "" +diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml +index f572eed..f3c8a01 100644 +--- a/system/settings/rbp.xml ++++ b/system/settings/rbp.xml +@@ -1,5 +1,15 @@ + + ++
++ ++ ++ ++ false ++ ++ ++ ++
++ +
+ + +diff --git a/system/settings/settings.xml b/system/settings/settings.xml +index 367542d..0db66a2 100644 +--- a/system/settings/settings.xml ++++ b/system/settings/settings.xml +@@ -226,6 +226,11 @@ + false + + ++ ++ 1 ++ true ++ ++ + + + +diff --git a/xbmc/filesystem/FileDirectoryFactory.cpp b/xbmc/filesystem/FileDirectoryFactory.cpp +index 2fd8777..3b294cd 100644 +--- a/xbmc/filesystem/FileDirectoryFactory.cpp ++++ b/xbmc/filesystem/FileDirectoryFactory.cpp +@@ -46,6 +46,7 @@ + #include "Directory.h" + #include "File.h" + #include "ZipManager.h" ++#include "settings/Settings.h" + #include "settings/AdvancedSettings.h" + #include "FileItem.h" + #include "utils/StringUtils.h" +@@ -142,6 +143,8 @@ IFileDirectory* CFileDirectoryFactory::Create(const CURL& url, CFileItem* pItem, + return NULL; + } + #endif ++ if (CSettings::Get().GetBool("filelists.browsearchives")) ++ { + if (url.IsFileType("zip")) + { + CURL zipURL = URIUtils::CreateArchivePath("zip", url); +@@ -215,6 +218,7 @@ IFileDirectory* CFileDirectoryFactory::Create(const CURL& url, CFileItem* pItem, + } + return NULL; + } ++ } + if (url.IsFileType("xsp")) + { // XBMC Smart playlist - just XML renamed to XSP + // read the name of the playlist in + +From 0eafc695b274c4a0e526c7bc73ab8917bcf285ff Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 27 Oct 2014 13:06:57 +0000 +Subject: [PATCH 028/102] [rbp] Make cachemembuffersize default depend on + memory size + +--- + xbmc/linux/RBP.cpp | 5 +++++ + xbmc/settings/AdvancedSettings.cpp | 5 +++++ + 2 files changed, 10 insertions(+) + +diff --git a/xbmc/linux/RBP.cpp b/xbmc/linux/RBP.cpp +index ba1a3d0..5119949 100644 +--- a/xbmc/linux/RBP.cpp ++++ b/xbmc/linux/RBP.cpp +@@ -22,6 +22,7 @@ + #if defined(TARGET_RASPBERRY_PI) + + #include "settings/Settings.h" ++#include "settings/AdvancedSettings.h" + #include "utils/log.h" + + #include "cores/omxplayer/OMXImage.h" +@@ -84,6 +85,9 @@ bool CRBP::Initialize() + if (!m_gui_resolution_limit) + m_gui_resolution_limit = m_gpu_mem < 128 ? 720:1080; + ++ if (g_advancedSettings.m_cacheMemBufferSize == ~0U) ++ g_advancedSettings.m_cacheMemBufferSize = m_arm_mem < 256 ? 1024 * 1024 * 2 : 1024 * 1024 * 20; ++ + g_OMXImage.Initialize(); + m_omx_image_init = true; + return true; +@@ -96,6 +100,7 @@ void CRBP::LogFirmwareVerison() + response[sizeof(response) - 1] = '\0'; + CLog::Log(LOGNOTICE, "Raspberry PI firmware version: %s", response); + CLog::Log(LOGNOTICE, "ARM mem: %dMB GPU mem: %dMB MPG2:%d WVC1:%d", m_arm_mem, m_gpu_mem, m_codec_mpg2_enabled, m_codec_wvc1_enabled); ++ CLog::Log(LOGNOTICE, "cacheMemBufferSize: %dMB", g_advancedSettings.m_cacheMemBufferSize >> 20); + m_DllBcmHost->vc_gencmd(response, sizeof response, "get_config int"); + response[sizeof(response) - 1] = '\0'; + CLog::Log(LOGNOTICE, "Config:\n%s", response); +diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp +index 478d725..69b7832 100644 +--- a/xbmc/settings/AdvancedSettings.cpp ++++ b/xbmc/settings/AdvancedSettings.cpp +@@ -365,7 +365,12 @@ void CAdvancedSettings::Initialize() + m_bPVRAutoScanIconsUserSet = false; + m_iPVRNumericChannelSwitchTimeout = 1000; + ++#ifdef TARGET_RASPBERRY_PI ++ // want default to be memory dependent, but interface to gpu not available yet, so set in RBP.cpp ++ m_cacheMemBufferSize = ~0; ++#else + m_cacheMemBufferSize = 1024 * 1024 * 20; ++#endif + m_networkBufferMode = 0; // Default (buffer all internet streams/filesystems) + // the following setting determines the readRate of a player data + // as multiply of the default data read rate + + +From 2da066dff08185f2cf78940569328a5e65a0a494 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 16 Jun 2014 19:06:00 +0100 +Subject: [PATCH 030/102] [experimental] Disable quiet-noise generation + +--- + xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp +index b391ff3..463a89c 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp +@@ -873,6 +873,7 @@ void CActiveAESink::SwapInit(CSampleBuffer* samples) + + void CActiveAESink::GenerateNoise() + { ++#ifndef TARGET_RASPBERRY_PI + int nb_floats = m_sampleOfSilence.pkt->max_nb_samples; + nb_floats *= m_sampleOfSilence.pkt->config.channels; + +@@ -913,6 +914,7 @@ void CActiveAESink::GenerateNoise() + + _aligned_free(noise); + delete resampler; ++#endif + } + + void CActiveAESink::SetSilenceTimer() + +From b2affcd233124a4b00c289c77d39e1ab8788bf6c Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Fri, 30 May 2014 14:58:43 +0100 +Subject: [PATCH 031/102] [settings] Experiment: Report DESKTOP resolution in + video settings + +--- + xbmc/settings/DisplaySettings.cpp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/xbmc/settings/DisplaySettings.cpp b/xbmc/settings/DisplaySettings.cpp +index 6902f83..50c5f97 100644 +--- a/xbmc/settings/DisplaySettings.cpp ++++ b/xbmc/settings/DisplaySettings.cpp +@@ -674,6 +674,9 @@ void CDisplaySettings::SettingOptionsResolutionsFiller(const CSetting *setting, + vector resolutions = g_Windowing.ScreenResolutions(info.iScreen, info.fRefreshRate); + for (vector::const_iterator resolution = resolutions.begin(); resolution != resolutions.end(); ++resolution) + { ++if (resolution->ResInfo_Index == RES_DESKTOP) ++ list.push_back(make_pair(StringUtils::Format("DESKTOP"), resolution->ResInfo_Index)); ++else + list.push_back(make_pair( + StringUtils::Format("%dx%d%s", resolution->width, resolution->height, + ModeFlagsToString(resolution->flags, false).c_str()), + +From 5d1a93fe1d7325f35d3cb0cd43f6909a678b5950 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sat, 16 Aug 2014 21:01:42 +0100 +Subject: [PATCH 032/102] omxrender: Hacks to reduce GUI rendering rate when + playing video + +--- + language/English/strings.po | 27 +++++++++++++++++++++++++++ + system/settings/rbp.xml | 16 ++++++++++++++++ + xbmc/Application.cpp | 17 +++++++++++++++++ + 3 files changed, 60 insertions(+) + +diff --git a/language/English/strings.po b/language/English/strings.po +index 8e67be0..8acc0e9 100755 +--- a/language/English/strings.po ++++ b/language/English/strings.po +@@ -16125,3 +16125,30 @@ msgstr "" + msgctxt "#38021" + msgid "Allow viewing and playing files in archives (e.g. zip, rar)" + msgstr "" ++ ++#: system/settings/settings.xml ++msgctxt "#38000" ++msgid "Limit GUI updates when playing video" ++msgstr "" ++ ++#: system/settings/settings.xml ++msgctxt "#38001" ++msgid "This can reduce CPU when playing video by updating the overlays less often" ++msgstr "" ++ ++#: system/settings/settings.xml ++msgctxt "#38002" ++msgid "Off" ++msgstr "" ++ ++msgctxt "#38003" ++msgid "5 fps" ++msgstr "" ++ ++msgctxt "#38004" ++msgid "10 fps" ++msgstr "" ++ ++msgctxt "#38005" ++msgid "24 fps" ++msgstr "" +diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml +index f3c8a01..2996c29 100644 +--- a/system/settings/rbp.xml ++++ b/system/settings/rbp.xml +@@ -25,6 +25,22 @@ + + + ++ ++ ++ 2 ++ 10 ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + +
+ +diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp +index d3f0fde..a34b970 100644 +--- a/xbmc/Application.cpp ++++ b/xbmc/Application.cpp +@@ -2207,6 +2207,23 @@ void CApplication::Render() + if (m_bStop) + return; + ++#ifdef TARGET_RASPBERRY_PI ++ if (g_graphicsContext.IsFullScreenVideo() && !m_pPlayer->IsPausedPlayback()) ++ { ++ int fps = CSettings::Get().GetInt("videoplayer.limitguiupdate"); ++ unsigned int now = XbmcThreads::SystemClockMillis(); ++ unsigned int frameTime = now - m_lastFrameTime; ++ if (fps > 0 && frameTime * fps < 1000) ++ { ++ g_renderManager.FrameWait(100); ++ g_infoManager.UpdateFPS(); ++ g_renderManager.FrameMove(); ++ g_renderManager.FrameFinish(); ++ return; ++ } ++ } ++#endif ++ + MEASURE_FUNCTION; + + int vsync_mode = CSettings::Get().GetInt("videoscreen.vsync"); + +From f6e3c3210a1f2fdce5c723b9134d65f90ebdd45b Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 9 Sep 2014 12:04:26 +0100 +Subject: [PATCH 033/102] egl: Treat unknown display aspect ratio as square + pixel + +--- + xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +index bf1e589..a25eb86 100644 +--- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp ++++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +@@ -446,7 +446,7 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r + m_desktopRes.iScreenWidth = tv_state.display.hdmi.width; + m_desktopRes.iScreenHeight= tv_state.display.hdmi.height; + m_desktopRes.dwFlags = MAKEFLAGS(tv_state.display.hdmi.group, tv_state.display.hdmi.mode, tv_state.display.hdmi.scan_mode); +- m_desktopRes.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv_state.display.hdmi.display_options.aspect) / ((float)m_desktopRes.iScreenWidth / (float)m_desktopRes.iScreenHeight); ++ m_desktopRes.fPixelRatio = tv_state.display.hdmi.display_options.aspect == 0 ? 1.0f : get_display_aspect_ratio((HDMI_ASPECT_T)tv_state.display.hdmi.display_options.aspect) / ((float)m_desktopRes.iScreenWidth / (float)m_desktopRes.iScreenHeight); + // Also add 3D flags + if (tv_state.display.hdmi.format_3d == HDMI_3D_FORMAT_SBS_HALF) + m_desktopRes.dwFlags |= D3DPRESENTFLAG_MODE3DSBS; +@@ -467,7 +467,7 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r + m_desktopRes.iScreenHeight= tv_state.display.sdtv.height; + m_desktopRes.dwFlags = D3DPRESENTFLAG_INTERLACED; + m_desktopRes.fRefreshRate = (float)tv_state.display.sdtv.frame_rate; +- m_desktopRes.fPixelRatio = get_display_aspect_ratio((SDTV_ASPECT_T)tv_state.display.sdtv.display_options.aspect) / ((float)m_desktopRes.iScreenWidth / (float)m_desktopRes.iScreenHeight); ++ m_desktopRes.fPixelRatio = tv_state.display.hdmi.display_options.aspect == 0 ? 1.0f : get_display_aspect_ratio((SDTV_ASPECT_T)tv_state.display.sdtv.display_options.aspect) / ((float)m_desktopRes.iScreenWidth / (float)m_desktopRes.iScreenHeight); + } + + SetResolutionString(m_desktopRes); + +From dd03c26307bc504c59077eafdc4239b36399e1ac Mon Sep 17 00:00:00 2001 +From: anaconda +Date: Thu, 11 Sep 2014 21:30:43 +0200 +Subject: [PATCH 034/102] Disable textbox autoscrolling while on screensaver. + +SQUASH: only if dim or black +--- + xbmc/Application.cpp | 7 +++++++ + xbmc/Application.h | 2 ++ + xbmc/guilib/GUITextBox.cpp | 5 ++++- + 3 files changed, 13 insertions(+), 1 deletion(-) + +diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp +index a34b970..8e0ab13 100644 +--- a/xbmc/Application.cpp ++++ b/xbmc/Application.cpp +@@ -5873,3 +5873,10 @@ void CApplication::CloseNetworkShares() + CSFTPSessionManager::DisconnectAllSessions(); + #endif + } ++ ++std::string CApplication::GetScreenSaverId() ++{ ++ if (m_screenSaver) ++ return m_screenSaver->ID(); ++ return ""; ++} +diff --git a/xbmc/Application.h b/xbmc/Application.h +index 0a332ff..15efc90 100644 +--- a/xbmc/Application.h ++++ b/xbmc/Application.h +@@ -380,6 +380,8 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs + + void SetLoggingIn(bool loggingIn) { m_loggingIn = loggingIn; } + ++ std::string GetScreenSaverId(); ++ + protected: + virtual bool OnSettingsSaving() const; + +diff --git a/xbmc/guilib/GUITextBox.cpp b/xbmc/guilib/GUITextBox.cpp +index b7ef051..e149418 100644 +--- a/xbmc/guilib/GUITextBox.cpp ++++ b/xbmc/guilib/GUITextBox.cpp +@@ -23,6 +23,7 @@ + #include "utils/XBMCTinyXML.h" + #include "utils/MathUtils.h" + #include "utils/StringUtils.h" ++#include "Application.h" + + using namespace std; + +@@ -132,7 +133,9 @@ void CGUITextBox::Process(unsigned int currentTime, CDirtyRegionList &dirtyregio + // update our auto-scrolling as necessary + if (m_autoScrollTime && m_lines.size() > m_itemsPerPage) + { +- if (!m_autoScrollCondition || m_autoScrollCondition->Get()) ++ if ((!m_autoScrollCondition || m_autoScrollCondition->Get()) && !(g_application.IsInScreenSaver() && ++ (g_application.GetScreenSaverId() == "screensaver.xbmc.builtin.black" || ++ g_application.GetScreenSaverId() == "screensaver.xbmc.builtin.dim"))) + { + if (m_lastRenderTime) + m_autoScrollDelayTime += currentTime - m_lastRenderTime; + +From 4d48ee0af59436357c0309419af19edcb919217a Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Thu, 18 Sep 2014 14:24:56 +0100 +Subject: [PATCH 035/102] [omxplayer] Only enable audio clock master when A/V + sync method is set to audio clock + +--- + xbmc/cores/omxplayer/OMXAudio.cpp | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp +index 5475570..7c07b57 100644 +--- a/xbmc/cores/omxplayer/OMXAudio.cpp ++++ b/xbmc/cores/omxplayer/OMXAudio.cpp +@@ -246,7 +246,8 @@ bool COMXAudio::PortSettingsChanged() + { + // By default audio_render is the clock master, and if output samples don't fit the timestamps, it will speed up/slow down the clock. + // This tends to be better for maintaining audio sync and avoiding audio glitches, but can affect video/display sync +- if(CSettings::Get().GetBool("videoplayer.usedisplayasclock") || CSettings::Get().GetString("audiooutput.audiodevice") == "PI:Both") ++ if((CSettings::Get().GetBool("videoplayer.usedisplayasclock") && CSettings::Get().GetInt("videoplayer.synctype") == SYNC_DISCON) || ++ CSettings::Get().GetString("audiooutput.audiodevice") == "PI:Both") + { + OMX_CONFIG_BOOLEANTYPE configBool; + OMX_INIT_STRUCTURE(configBool); +@@ -272,7 +273,7 @@ bool COMXAudio::PortSettingsChanged() + { + // By default audio_render is the clock master, and if output samples don't fit the timestamps, it will speed up/slow down the clock. + // This tends to be better for maintaining audio sync and avoiding audio glitches, but can affect video/display sync +- if(CSettings::Get().GetBool("videoplayer.usedisplayasclock")) ++ if(CSettings::Get().GetBool("videoplayer.usedisplayasclock") && CSettings::Get().GetInt("videoplayer.synctype") == SYNC_DISCON) + { + OMX_CONFIG_BOOLEANTYPE configBool; + OMX_INIT_STRUCTURE(configBool); + +From 25bcd374ec4286b19ee326aa5a2afa5efcc8f891 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Fri, 19 Sep 2014 11:54:49 +0100 +Subject: [PATCH 036/102] [dvdplayer/rbp] Add pi specific option to maintain + vsync with pll adjustment + +New A/V sync option in settings/video/playback to do "Adjust PLL". +This uses video clock (so perfect video syncing) but avoids having to resample +or drop/dupe audio packets which is normally required. + +Needed updated firmware +--- + language/English/strings.po | 5 +++++ + system/settings/rbp.xml | 20 ++++++++++++++++++ + xbmc/cores/AudioEngine/Utils/AEUtil.h | 3 ++- + xbmc/cores/dvdplayer/DVDPlayerAudio.cpp | 36 +++++++++++++++++++++++++++++++-- + xbmc/cores/dvdplayer/DVDPlayerAudio.h | 1 + + xbmc/linux/RBP.cpp | 14 +++++++++++++ + xbmc/linux/RBP.h | 1 + + 7 files changed, 77 insertions(+), 3 deletions(-) + +diff --git a/language/English/strings.po b/language/English/strings.po +index 8acc0e9..a3b71e8 100755 +--- a/language/English/strings.po ++++ b/language/English/strings.po +@@ -16152,3 +16152,8 @@ msgstr "" + msgctxt "#38005" + msgid "24 fps" + msgstr "" ++ ++#: system/settings/settings.xml ++msgctxt "#38006" ++msgid "Adjust PLL" ++msgstr "" +diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml +index 2996c29..79853a8 100644 +--- a/system/settings/rbp.xml ++++ b/system/settings/rbp.xml +@@ -11,6 +11,26 @@ + + +
++ ++ ++ ++ 2 ++ 2 ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ true ++ ++ ++ ++ ++ + + + false +diff --git a/xbmc/cores/AudioEngine/Utils/AEUtil.h b/xbmc/cores/AudioEngine/Utils/AEUtil.h +index 782a9ba..3e0390c 100644 +--- a/xbmc/cores/AudioEngine/Utils/AEUtil.h ++++ b/xbmc/cores/AudioEngine/Utils/AEUtil.h +@@ -57,7 +57,8 @@ enum AVSync + { + SYNC_DISCON = 0, + SYNC_SKIPDUP, +- SYNC_RESAMPLE ++ SYNC_RESAMPLE, ++ SYNC_PLLADJUST + }; + + struct AEDelayStatus +diff --git a/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp b/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp +index f567518..5e9a6d3 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp ++++ b/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp +@@ -113,6 +113,7 @@ CDVDPlayerAudio::CDVDPlayerAudio(CDVDClock* pClock, CDVDMessageQueue& parent) + m_started = false; + m_silence = false; + m_resampleratio = 1.0; ++ m_plladjust = 1.0f; + m_synctype = SYNC_DISCON; + m_setsynctype = SYNC_DISCON; + m_prevsynctype = -1; +@@ -475,6 +476,8 @@ void CDVDPlayerAudio::UpdatePlayerInfo() + //if the resample ratio is 0.5, then we're playing twice as fast + if (m_synctype == SYNC_RESAMPLE) + s << ", rr:" << fixed << setprecision(5) << 1.0 / m_resampleratio; ++ if (m_synctype == SYNC_PLLADJUST) ++ s << ", pll:" << fixed << setprecision(5) << 1.0 / m_plladjust; + + s << ", att:" << fixed << setprecision(1) << log(GetCurrentAttenuation()) * 20.0f << " dB"; + +@@ -627,8 +630,8 @@ void CDVDPlayerAudio::SetSyncType(bool passthrough) + + if (m_synctype != m_prevsynctype) + { +- const char *synctypes[] = {"clock feedback", "skip/duplicate", "resample", "invalid"}; +- int synctype = (m_synctype >= 0 && m_synctype <= 2) ? m_synctype : 3; ++ const char *synctypes[] = {"clock feedback", "skip/duplicate", "resample", "pll adjust", "invalid"}; ++ int synctype = (m_synctype >= 0 && m_synctype <= 3) ? m_synctype : 4; + CLog::Log(LOGDEBUG, "CDVDPlayerAudio:: synctype set to %i: %s", m_synctype, synctypes[synctype]); + m_prevsynctype = m_synctype; + } +@@ -702,6 +705,31 @@ void CDVDPlayerAudio::HandleSyncError(double duration) + } + m_resampleratio = 1.0 / m_pClock->GetClockSpeed() + proportional + m_integral; + } ++ else if (m_synctype == SYNC_PLLADJUST) ++ { ++#if defined(TARGET_RASPBERRY_PI) ++ //reset the integral on big errors, failsafe ++ if (fabs(m_error) > DVD_TIME_BASE) ++ m_integral = 0; ++ else if (fabs(m_error) > DVD_MSEC_TO_TIME(5)) ++ m_integral += m_error / DVD_TIME_BASE / INTEGRAL; ++ ++ double proportional = 0.0; ++ ++ //on big errors use more proportional ++ if (fabs(m_error / DVD_TIME_BASE) > 0.0) ++ { ++ double proportionaldiv = PROPORTIONAL * (PROPREF / fabs(m_error / DVD_TIME_BASE)); ++ if (proportionaldiv < PROPDIVMIN) proportionaldiv = PROPDIVMIN; ++ else if (proportionaldiv > PROPDIVMAX) proportionaldiv = PROPDIVMAX; ++ ++ proportional = m_error / DVD_TIME_BASE / proportionaldiv; ++ } ++ m_plladjust = 1.0 / m_pClock->GetClockSpeed() + proportional + m_integral; ++ double new_adjust = g_RBP.AdjustHDMIClock(m_plladjust); ++ CLog::Log(LOGDEBUG, "CDVDPlayerAudio::%s pll:%.4f (%.4f) proportional:%.4f integral:%.4f", __FUNCTION__, m_plladjust, new_adjust, proportional, m_integral); ++#endif ++ } + } + } + +@@ -740,6 +768,10 @@ bool CDVDPlayerAudio::OutputPacket(DVDAudioFrame &audioframe) + m_dvdAudio.SetResampleRatio(m_resampleratio); + m_dvdAudio.AddPackets(audioframe); + } ++ else if (m_synctype == SYNC_PLLADJUST) ++ { ++ m_dvdAudio.AddPackets(audioframe); ++ } + + return true; + } +diff --git a/xbmc/cores/dvdplayer/DVDPlayerAudio.h b/xbmc/cores/dvdplayer/DVDPlayerAudio.h +index e8b2ab6..02c64a0 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayerAudio.h ++++ b/xbmc/cores/dvdplayer/DVDPlayerAudio.h +@@ -232,6 +232,7 @@ class CDVDPlayerAudio : public CThread, public IDVDStreamPlayerAudio + bool m_prevskipped; + double m_maxspeedadjust; + double m_resampleratio; //resample ratio when using SYNC_RESAMPLE, used for the codec info ++ double m_plladjust; // for display using SYNC_PLLADJUST + + struct SInfo + { +diff --git a/xbmc/linux/RBP.cpp b/xbmc/linux/RBP.cpp +index 5119949..ce09fce 100644 +--- a/xbmc/linux/RBP.cpp ++++ b/xbmc/linux/RBP.cpp +@@ -212,4 +212,18 @@ void CRBP::Deinitialize() + m_initialized = false; + m_omx_initialized = false; + } ++ ++double CRBP::AdjustHDMIClock(double adjust) ++{ ++ char response[80]; ++ vc_gencmd(response, sizeof response, "hdmi_adjust_clock %f", adjust); ++ float new_adjust = 1.0f; ++ char *p = strchr(response, '='); ++ if (p) ++ new_adjust = atof(p+1); ++ CLog::Log(LOGDEBUG, "CRBP::%s(%.4f) = %.4f", __func__, adjust, new_adjust); ++ return new_adjust; ++} ++ ++ + #endif +diff --git a/xbmc/linux/RBP.h b/xbmc/linux/RBP.h +index 4fd18f3..6456657 100644 +--- a/xbmc/linux/RBP.h ++++ b/xbmc/linux/RBP.h +@@ -58,6 +58,7 @@ class CRBP + unsigned char *CaptureDisplay(int width, int height, int *stride, bool swap_red_blue, bool video_only = true); + DllOMX *GetDllOMX() { return m_OMX ? m_OMX->GetDll() : NULL; } + void WaitVsync(); ++ double AdjustHDMIClock(double adjust); + + private: + DllBcmHost *m_DllBcmHost; + +From 8ba92008485e1b9f817f1bc190d4431f1a9323da Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sat, 27 Sep 2014 15:32:37 +0100 +Subject: [PATCH 037/102] [dvdplayer] exerimental: don't raise priority of + audio thread + +--- + xbmc/cores/dvdplayer/DVDPlayer.cpp | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp +index 26d3903..ea4031e 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayer.cpp ++++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp +@@ -3204,7 +3204,11 @@ bool CDVDPlayer::OpenAudioStream(CDVDStreamInfo& hint, bool reset) + m_dvdPlayerAudio->SendMessage(new CDVDMsg(CDVDMsg::PLAYER_STARTED), 1); + + /* audio normally won't consume full cpu, so let it have prio */ ++#ifdef TARGET_RASPBERRY_PI ++ m_dvdPlayerAudio->SetPriority(GetPriority()); ++#else + m_dvdPlayerAudio->SetPriority(GetPriority()+1); ++#endif + return true; + } + + +From e68155164b3b5c19077fd9cdab0c32da580e2930 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 28 Sep 2014 19:28:17 +0100 +Subject: [PATCH 038/102] [mmalcodec] Introduce a preroll period to buffer up + frames on startup + +--- + .../DVDCodecs/Video/DVDVideoCodecMMAL.cpp | 5 ++++ + .../dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h | 1 + + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 30 +++++++++++++++++----- + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 3 +++ + 4 files changed, 33 insertions(+), 6 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp +index 55b9969..262283d 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp +@@ -96,4 +96,9 @@ bool CDVDVideoCodecMMAL::GetCodecStats(double &pts, int &droppedPics) + return m_decoder->GetCodecStats(pts, droppedPics); + } + ++void CDVDVideoCodecMMAL::SetSpeed(int iSpeed) ++{ ++ m_decoder->SetSpeed(iSpeed); ++} ++ + #endif +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h +index 67aa505..a768e70 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h +@@ -42,6 +42,7 @@ class CDVDVideoCodecMMAL : public CDVDVideoCodec + virtual void SetDropState(bool bDrop); + virtual const char* GetName(void); + virtual bool GetCodecStats(double &pts, int &droppedPics); ++ virtual void SetSpeed(int iSpeed); + + protected: + MMALVideoPtr m_decoder; +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +index 098910e..6742e0e 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +@@ -128,6 +128,8 @@ CMMALVideo::CMMALVideo() + m_output_busy = 0; + m_demux_queue_length = 0; + m_es_format = mmal_format_alloc(); ++ m_preroll = true; ++ m_speed = DVD_PLAYSPEED_NORMAL; + } + + CMMALVideo::~CMMALVideo() +@@ -696,6 +698,8 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVide + + m_drop_state = false; + m_startframe = false; ++ m_preroll = !m_hints.stills; ++ m_speed = DVD_PLAYSPEED_NORMAL; + + return true; + } +@@ -904,23 +908,29 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) + break; + } + int ret = 0; +- if (!m_output_ready.empty()) ++ if (mmal_queue_length(m_dec_input_pool->queue) > 0 && !m_demux_queue_length) + { + if (g_advancedSettings.CanLogComponent(LOGVIDEO)) + CLog::Log(LOGDEBUG, "%s::%s - got space for output: demux_queue(%d) space(%d)", CLASSNAME, __func__, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size); +- ret |= VC_PICTURE; ++ ret |= VC_BUFFER; + } +- if (mmal_queue_length(m_dec_input_pool->queue) > 0 && !m_demux_queue_length) ++ else ++ m_preroll = false; ++ ++ if (m_preroll && m_output_ready.size() >= GetAllowedReferences()) ++ m_preroll = false; ++ ++ if (!m_output_ready.empty() && !m_preroll) + { + if (g_advancedSettings.CanLogComponent(LOGVIDEO)) + CLog::Log(LOGDEBUG, "%s::%s - got output picture:%d", CLASSNAME, __func__, m_output_ready.size()); +- ret |= VC_BUFFER; ++ ret |= VC_PICTURE; + } + if (!ret) + { + if (g_advancedSettings.CanLogComponent(LOGVIDEO)) +- CLog::Log(LOGDEBUG, "%s::%s - Nothing to do: dts_queue(%d) ready_queue(%d) busy_queue(%d) demux_queue(%d) space(%d)", +- CLASSNAME, __func__, m_dts_queue.size(), m_output_ready.size(), m_output_busy, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size); ++ CLog::Log(LOGDEBUG, "%s::%s - Nothing to do: dts_queue(%d) ready_queue(%d) busy_queue(%d) demux_queue(%d) space(%d) preroll(%d)", ++ CLASSNAME, __func__, m_dts_queue.size(), m_output_ready.size(), m_output_busy, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size, m_preroll); + Sleep(10); // otherwise we busy spin + } + return ret; +@@ -963,8 +973,16 @@ void CMMALVideo::Reset(void) + m_decoderPts = DVD_NOPTS_VALUE; + m_droppedPics = 0; + m_decode_frame_number = 1; ++ m_preroll = !m_hints.stills && (m_speed == DVD_PLAYSPEED_NORMAL || m_speed == DVD_PLAYSPEED_PAUSE); + } + ++void CMMALVideo::SetSpeed(int iSpeed) ++{ ++ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) ++ CLog::Log(LOGDEBUG, "%s::%s %d->%d", CLASSNAME, __func__, m_speed, iSpeed); ++ ++ m_speed = iSpeed; ++} + + void CMMALVideo::ReturnBuffer(CMMALVideoBuffer *buffer) + { +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +index b4aa571..4f81bbd 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +@@ -90,6 +90,7 @@ class CMMALVideo + virtual void SetDropState(bool bDrop); + virtual const char* GetName(void) { return (const char*)m_pFormatName; } + virtual bool GetCodecStats(double &pts, int &droppedPics); ++ virtual void SetSpeed(int iSpeed); + + // MMAL decoder callback routines. + void ReleaseBuffer(CMMALVideoBuffer *buffer); +@@ -140,6 +141,8 @@ class CMMALVideo + unsigned int m_decode_frame_number; + double m_decoderPts; + unsigned int m_droppedPics; ++ int m_speed; ++ bool m_preroll; + + MMAL_COMPONENT_T *m_dec; + MMAL_PORT_T *m_dec_input; + +From 1501701411ba05a435b5927c91c038aabb707b3d Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 24 Sep 2014 23:13:52 +0100 +Subject: [PATCH 039/102] [audio] Add settings option to boost centre channel + when downmixing + +This allows a dB volume increase to be added to centre channel. +This can help improve dialgue in the presence of background music/effects. +It can go up to 30dB for testing purposes, but value of 6 is probably more reasonable. +It is recommended to ensure "Normalise levels on downmix" is enabled when boosting by large values to avoid clipping. + +Should work with Pi Sink (dvdplayer/paplayer) and omxplayer +--- + language/English/strings.po | 15 +++++++++++++++ + system/settings/settings.xml | 12 ++++++++++++ + .../Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp | 7 +++++++ + .../AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp | 6 ++++++ + xbmc/cores/omxplayer/OMXAudio.cpp | 6 ++++++ + 5 files changed, 46 insertions(+) + +diff --git a/language/English/strings.po b/language/English/strings.po +index a3b71e8..24f9636 100755 +--- a/language/English/strings.po ++++ b/language/English/strings.po +@@ -16157,3 +16157,18 @@ msgstr "" + msgctxt "#38006" + msgid "Adjust PLL" + msgstr "" ++ ++#: system/settings/settings.xml ++msgctxt "#38007" ++msgid "Boost centre channel when downmixing" ++msgstr "" ++ ++#: system/settings/settings.xml ++msgctxt "#38008" ++msgid "Increase this value to make the dialogue louder compared to background sounds when downmixing multichannel audio" ++msgstr "" ++ ++#: system/settings/settings.xml ++msgctxt "#38009" ++msgid "%i dB" ++msgstr "" +diff --git a/system/settings/settings.xml b/system/settings/settings.xml +index 0db66a2..dbddcb6 100644 +--- a/system/settings/settings.xml ++++ b/system/settings/settings.xml +@@ -2451,6 +2451,18 @@ + true + + ++ ++ 2 ++ 0 ++ ++ 0 ++ 1 ++ 30 ++ ++ ++ 38009 ++ ++ + + HAS_AE_QUALITY_LEVELS + 2 +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp +index de188e7..449a500 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp +@@ -20,6 +20,7 @@ + + #include "cores/AudioEngine/Utils/AEUtil.h" + #include "ActiveAEResampleFFMPEG.h" ++#include "settings/Settings.h" + #include "utils/log.h" + + extern "C" { +@@ -105,6 +106,12 @@ bool CActiveAEResampleFFMPEG::Init(uint64_t dst_chan_layout, int dst_channels, i + { + av_opt_set_double(m_pContext, "rematrix_maxval", 1.0, 0); + } ++ int boost_center = CSettings::Get().GetInt("audiooutput.boostcenter"); ++ if (boost_center) ++ { ++ float gain = pow(10.0f, ((float)(-3 + boost_center))/20.0f); ++ av_opt_set_double(m_pContext, "center_mix_level", gain, 0); ++ } + + if (remapLayout) + { +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp +index 96f79b7..84505bf 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp +@@ -162,6 +162,12 @@ bool CActiveAEResamplePi::Init(uint64_t dst_chan_layout, int dst_channels, int d + { + av_opt_set_double(m_pContext, "rematrix_maxval", 1.0, 0); + } ++ int boost_center = CSettings::Get().GetInt("audiooutput.boostcenter"); ++ if (boost_center) ++ { ++ float gain = pow(10.0f, ((float)(-3 + boost_center))/20.0f); ++ av_opt_set_double(m_pContext, "center_mix_level", gain, 0); ++ } + + if (remapLayout) + { +diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp +index 7c07b57..ef4c3d4 100644 +--- a/xbmc/cores/omxplayer/OMXAudio.cpp ++++ b/xbmc/cores/omxplayer/OMXAudio.cpp +@@ -633,6 +633,12 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo + { + av_opt_set_double(m_pContext, "rematrix_maxval", 1.0, 0); + } ++ int boost_center = CSettings::Get().GetInt("audiooutput.boostcenter"); ++ if (boost_center) ++ { ++ float gain = pow(10.0f, ((float)(-3 + boost_center))/20.0f); ++ av_opt_set_double(m_pContext, "center_mix_level", gain, 0); ++ } + + // stereo upmix + if (upmix && m_src_channels == 2 && m_dst_channels > 2) + +From 6d7f91afce51b7f63e0f5e0467d63124a6805fff Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Fri, 3 Oct 2014 18:38:07 +0100 +Subject: [PATCH 040/102] [omxcore] Skip out of flush on error + +--- + xbmc/linux/OMXCore.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/xbmc/linux/OMXCore.cpp b/xbmc/linux/OMXCore.cpp +index 4ae29ba..4caa304 100644 +--- a/xbmc/linux/OMXCore.cpp ++++ b/xbmc/linux/OMXCore.cpp +@@ -419,7 +419,7 @@ void COMXCoreComponent::FlushAll() + + void COMXCoreComponent::FlushInput() + { +- if(!m_handle) ++ if(!m_handle || m_resource_error) + return; + + OMX_ERRORTYPE omx_err = OMX_ErrorNone; +@@ -436,7 +436,7 @@ void COMXCoreComponent::FlushInput() + + void COMXCoreComponent::FlushOutput() + { +- if(!m_handle) ++ if(!m_handle || m_resource_error) + return; + + OMX_ERRORTYPE omx_err = OMX_ErrorNone; + +From 673ca831338d680586ac24699789c4cac5509167 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Fri, 3 Oct 2014 18:40:06 +0100 +Subject: [PATCH 041/102] [SinkPi] Handle multichannel layout more like + OMXAudio + +--- + xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp +index 89684e4..fd9a03d 100644 +--- a/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp ++++ b/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp +@@ -92,9 +92,9 @@ static void SetAudioProps(bool stream_channels, uint32_t channel_map) + CLog::Log(LOGDEBUG, "%s:%s hdmi_stream_channels %d hdmi_channel_map %08x", CLASSNAME, __func__, stream_channels, channel_map); + } + +-static uint32_t GetChannelMap(AEAudioFormat &format, bool passthrough) ++static uint32_t GetChannelMap(const CAEChannelInfo &channelLayout, bool passthrough) + { +- unsigned int channels = format.m_channelLayout.Count(); ++ unsigned int channels = channelLayout.Count(); + uint32_t channel_map = 0; + if (passthrough) + return 0; +@@ -133,12 +133,12 @@ static uint32_t GetChannelMap(AEAudioFormat &format, bool passthrough) + // According to CEA-861-D only RL and RR are known. In case of a format having SL and SR channels + // but no BR BL channels, we use the wide map in order to open only the num of channels really + // needed. +- if (format.m_channelLayout.HasChannel(AE_CH_BL) && !format.m_channelLayout.HasChannel(AE_CH_SL)) ++ if (channelLayout.HasChannel(AE_CH_BL) && !channelLayout.HasChannel(AE_CH_SL)) + map = map_back; + + for (unsigned int i = 0; i < channels; ++i) + { +- AEChannel c = format.m_channelLayout[i]; ++ AEChannel c = channelLayout[i]; + unsigned int chan = 0; + if ((unsigned int)c < sizeof map_normal / sizeof *map_normal) + chan = map[(unsigned int)c]; +@@ -169,9 +169,9 @@ static uint32_t GetChannelMap(AEAudioFormat &format, bool passthrough) + 0xff, // 7 + 0x13, // 7.1 + }; +- uint8_t cea = format.m_channelLayout.HasChannel(AE_CH_LFE) ? cea_map_lfe[channels] : cea_map[channels]; ++ uint8_t cea = channelLayout.HasChannel(AE_CH_LFE) ? cea_map_lfe[channels] : cea_map[channels]; + if (cea == 0xff) +- CLog::Log(LOGERROR, "%s::%s - Unexpected CEA mapping %d,%d", CLASSNAME, __func__, format.m_channelLayout.HasChannel(AE_CH_LFE), channels); ++ CLog::Log(LOGERROR, "%s::%s - Unexpected CEA mapping %d,%d", CLASSNAME, __func__, channelLayout.HasChannel(AE_CH_LFE), channels); + + channel_map |= cea << 24; + +@@ -208,7 +208,7 @@ bool CAESinkPi::Initialize(AEAudioFormat &format, std::string &device) + format.m_frames = format.m_sampleRate * AUDIO_PLAYBUFFER / NUM_OMX_BUFFERS; + format.m_frameSamples = format.m_frames * channels; + +- SetAudioProps(m_passthrough, GetChannelMap(format, m_passthrough)); ++ SetAudioProps(m_passthrough, GetChannelMap(format.m_channelLayout, m_passthrough)); + + m_format = format; + m_sinkbuffer_sec_per_byte = 1.0 / (double)(m_format.m_frameSize * m_format.m_sampleRate); + +From 82f9466723d59aac6f53551b9984cac6ac7c939f Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 27 Oct 2014 15:23:51 +0000 +Subject: [PATCH 042/102] [rbp] Default extract thumbnails to false + +It can take 80 seconds for a single file on a Pi. It can cause crashes with out-of-memory errors. +It genereates a lot of support issues. Best to default to disabled and let users enable it if they must +--- + system/settings/rbp.xml | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml +index 79853a8..4c2ef41 100644 +--- a/system/settings/rbp.xml ++++ b/system/settings/rbp.xml +@@ -62,6 +62,16 @@ + + + ++ ++ ++ ++ false ++ ++ ++ false ++ ++ ++ +
+ +
+ +From dae42b2a50ac350761332b661259f8d1ecc5f70a Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 11 Nov 2014 18:14:23 +0000 +Subject: [PATCH 046/102] [resamplepi] Try to report the same numbers as ffmpeg + +--- + .../cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp +index 84505bf..2b5bef2 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp +@@ -544,9 +544,10 @@ int CActiveAEResamplePi::Resample(uint8_t **dst_buffer, int dst_samples, uint8_t + + int64_t CActiveAEResamplePi::GetDelay(int64_t base) + { +- int ret = m_dst_rate ? 1000 * GetBufferedSamples() / m_dst_rate : 0; ++ int64_t ret = av_rescale_rnd(GetBufferedSamples(), m_dst_rate, base, AV_ROUND_UP); ++ + #ifdef DEBUG_VERBOSE +- CLog::Log(LOGINFO, "%s::%s = %d", CLASSNAME, __func__, ret); ++ CLog::Log(LOGINFO, "%s::%s = %d", CLASSNAME, __func__, (int)ret); + #endif + return ret; + } +@@ -567,7 +568,7 @@ int CActiveAEResamplePi::GetBufferedSamples() + + int CActiveAEResamplePi::CalcDstSampleCount(int src_samples, int dst_rate, int src_rate) + { +- int ret = ((long long)src_samples * dst_rate + src_rate-1) / src_rate; ++ int ret = av_rescale_rnd(src_samples, dst_rate, src_rate, AV_ROUND_UP); + #ifdef DEBUG_VERBOSE + CLog::Log(LOGINFO, "%s::%s = %d", CLASSNAME, __func__, ret); + #endif +@@ -576,7 +577,7 @@ int CActiveAEResamplePi::CalcDstSampleCount(int src_samples, int dst_rate, int s + + int CActiveAEResamplePi::GetSrcBufferSize(int samples) + { +- int ret = 0; ++ int ret = av_samples_get_buffer_size(NULL, m_src_channels, samples, m_src_fmt, 1); + #ifdef DEBUG_VERBOSE + CLog::Log(LOGINFO, "%s::%s = %d", CLASSNAME, __func__, ret); + #endif +@@ -585,7 +586,7 @@ int CActiveAEResamplePi::GetSrcBufferSize(int samples) + + int CActiveAEResamplePi::GetDstBufferSize(int samples) + { +- int ret = CalcDstSampleCount(samples, m_dst_rate, m_src_rate); ++ int ret = av_samples_get_buffer_size(NULL, m_dst_channels, samples, m_dst_fmt, 1); + #ifdef DEBUG_VERBOSE + CLog::Log(LOGINFO, "%s::%s = %d", CLASSNAME, __func__, ret); + #endif + +From afb9f86c60fa6c18f248121cf1f815a045a701cd Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 11 Nov 2014 20:49:30 +0000 +Subject: [PATCH 047/102] [dvdplayer] New scheme for PLL adjustment for video + clock + +--- + xbmc/cores/dvdplayer/DVDPlayerAudio.cpp | 40 +++++++++++++-------------------- + xbmc/cores/dvdplayer/DVDPlayerAudio.h | 2 ++ + 2 files changed, 18 insertions(+), 24 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp b/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp +index 5e9a6d3..3e6d0ee 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp ++++ b/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp +@@ -113,7 +113,9 @@ CDVDPlayerAudio::CDVDPlayerAudio(CDVDClock* pClock, CDVDMessageQueue& parent) + m_started = false; + m_silence = false; + m_resampleratio = 1.0; +- m_plladjust = 1.0f; ++ m_plladjust = 1.0; ++ m_last_plladjust = 1.0; ++ m_last_error = 0.0; + m_synctype = SYNC_DISCON; + m_setsynctype = SYNC_DISCON; + m_prevsynctype = -1; +@@ -192,6 +194,8 @@ void CDVDPlayerAudio::OpenStream( CDVDStreamInfo &hints, CDVDAudioCodec* codec ) + + m_error = 0; + m_errors.Flush(); ++ m_plladjust = 1.0; ++ m_last_plladjust = 1.0; + m_integral = 0; + m_prevskipped = false; + m_syncclock = true; +@@ -234,7 +238,6 @@ void CDVDPlayerAudio::CloseStream(bool bWaitForBuffers) + + // uninit queue + m_messageQueue.End(); +- + CLog::Log(LOGNOTICE, "Deleting audio codec"); + if (m_pAudioCodec) + { +@@ -475,9 +478,11 @@ void CDVDPlayerAudio::UpdatePlayerInfo() + //print the inverse of the resample ratio, since that makes more sense + //if the resample ratio is 0.5, then we're playing twice as fast + if (m_synctype == SYNC_RESAMPLE) +- s << ", rr:" << fixed << setprecision(5) << 1.0 / m_resampleratio; ++ s << ", rr:" << fixed << setprecision(5) << 1.0 / m_resampleratio << ", err:" << fixed << setprecision(1) << m_last_error * 1e-3 << "ms"; ++ if (m_synctype == SYNC_SKIPDUP) ++ s << ", err:" << fixed << setprecision(1) << m_last_error * 1e-3 << "ms"; + if (m_synctype == SYNC_PLLADJUST) +- s << ", pll:" << fixed << setprecision(5) << 1.0 / m_plladjust; ++ s << ", pll:" << fixed << setprecision(5) << m_last_plladjust << ", err:" << fixed << setprecision(1) << m_last_error * 1e-3 << "ms"; + + s << ", att:" << fixed << setprecision(1) << log(GetCurrentAttenuation()) * 20.0f << " dB"; + +@@ -651,6 +656,7 @@ void CDVDPlayerAudio::HandleSyncError(double duration) + m_pClock->Update(clock+error, absolute, 0.0, "CDVDPlayerAudio::HandleSyncError1"); + m_errors.Flush(); + m_error = 0; ++ m_plladjust = 1.0; + m_syncclock = false; + + return; +@@ -704,32 +710,18 @@ void CDVDPlayerAudio::HandleSyncError(double duration) + proportional = m_error / DVD_TIME_BASE / proportionaldiv; + } + m_resampleratio = 1.0 / m_pClock->GetClockSpeed() + proportional + m_integral; ++ CLog::Log(LOGDEBUG, "CDVDPlayerAudio::%s rr:%.5f error:%.3fms", __FUNCTION__, m_resampleratio, m_error * 1e-3); + } + else if (m_synctype == SYNC_PLLADJUST) + { + #if defined(TARGET_RASPBERRY_PI) +- //reset the integral on big errors, failsafe +- if (fabs(m_error) > DVD_TIME_BASE) +- m_integral = 0; +- else if (fabs(m_error) > DVD_MSEC_TO_TIME(5)) +- m_integral += m_error / DVD_TIME_BASE / INTEGRAL; +- +- double proportional = 0.0; +- +- //on big errors use more proportional +- if (fabs(m_error / DVD_TIME_BASE) > 0.0) +- { +- double proportionaldiv = PROPORTIONAL * (PROPREF / fabs(m_error / DVD_TIME_BASE)); +- if (proportionaldiv < PROPDIVMIN) proportionaldiv = PROPDIVMIN; +- else if (proportionaldiv > PROPDIVMAX) proportionaldiv = PROPDIVMAX; +- +- proportional = m_error / DVD_TIME_BASE / proportionaldiv; +- } +- m_plladjust = 1.0 / m_pClock->GetClockSpeed() + proportional + m_integral; +- double new_adjust = g_RBP.AdjustHDMIClock(m_plladjust); +- CLog::Log(LOGDEBUG, "CDVDPlayerAudio::%s pll:%.4f (%.4f) proportional:%.4f integral:%.4f", __FUNCTION__, m_plladjust, new_adjust, proportional, m_integral); ++ double e = std::max(std::min(m_error, DVD_MSEC_TO_TIME(10)), -DVD_MSEC_TO_TIME(10)); ++ m_plladjust = 1.0 + e * 1.5e-8; ++ m_last_plladjust = g_RBP.AdjustHDMIClock(m_plladjust); ++ CLog::Log(LOGDEBUG, "CDVDPlayerAudio::%s pll:%.5f (%.5f) error:%.6f e:%.6f", __FUNCTION__, m_plladjust, m_last_plladjust, m_error, e * 1.5e-8 ); + #endif + } ++ m_last_error = m_error; + } + } + +diff --git a/xbmc/cores/dvdplayer/DVDPlayerAudio.h b/xbmc/cores/dvdplayer/DVDPlayerAudio.h +index 02c64a0..37bf4bd 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayerAudio.h ++++ b/xbmc/cores/dvdplayer/DVDPlayerAudio.h +@@ -233,6 +233,8 @@ class CDVDPlayerAudio : public CThread, public IDVDStreamPlayerAudio + double m_maxspeedadjust; + double m_resampleratio; //resample ratio when using SYNC_RESAMPLE, used for the codec info + double m_plladjust; // for display using SYNC_PLLADJUST ++ double m_last_error; // for display using SYNC_PLLADJUST ++ double m_last_plladjust; // for display using SYNC_PLLADJUST + + struct SInfo + { + +From 0a1f02e5fe1e152fa296b2f3d53761453e910b97 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sat, 15 Nov 2014 12:03:34 +0000 +Subject: [PATCH 048/102] [dvdplayer] Add lock for player creation + +--- + xbmc/cores/dvdplayer/DVDPlayer.cpp | 3 +++ + xbmc/cores/dvdplayer/DVDPlayer.h | 1 + + 2 files changed, 4 insertions(+) + +diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp +index ea4031e..67cdefc 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayer.cpp ++++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp +@@ -494,6 +494,7 @@ void CSelectionStreams::Update(CDVDInputStream* input, CDVDDemux* demuxer, std:: + + void CDVDPlayer::CreatePlayers() + { ++ CSingleLock lock(m_players_lock); + #ifdef HAS_OMXPLAYER + if (m_omxplayer_mode && OMXPlayerUnsuitable(m_HasVideo, m_HasAudio, m_pDemuxer, m_pInputStream, m_SelectionStreams)) + { +@@ -523,6 +524,7 @@ void CDVDPlayer::CreatePlayers() + + void CDVDPlayer::DestroyPlayers() + { ++ CSingleLock lock(m_players_lock); + if (!m_players_created) + return; + delete m_dvdPlayerVideo; +@@ -4009,6 +4011,7 @@ double CDVDPlayer::GetQueueTime() + + void CDVDPlayer::GetVideoStreamInfo(SPlayerVideoStreamInfo &info) + { ++ CSingleLock lock(m_players_lock); + info.bitrate = m_dvdPlayerVideo->GetVideoBitrate(); + + std::string retVal; +diff --git a/xbmc/cores/dvdplayer/DVDPlayer.h b/xbmc/cores/dvdplayer/DVDPlayer.h +index ef64076..7ea6ea6 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayer.h ++++ b/xbmc/cores/dvdplayer/DVDPlayer.h +@@ -554,4 +554,5 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer + // omxplayer variables + struct SOmxPlayerState m_OmxPlayerState; + bool m_omxplayer_mode; // using omxplayer acceleration ++ CCriticalSection m_players_lock; + }; + +From 25986160ddd451c08bb4d5ec437db420d97c33ed Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 19 Nov 2014 13:29:43 +0000 +Subject: [PATCH 049/102] [dvdplayeraudio] Add advancedsetting for configuring + max pll adjustment + +--- + xbmc/cores/dvdplayer/DVDPlayerAudio.cpp | 8 +++++--- + xbmc/settings/AdvancedSettings.cpp | 2 ++ + xbmc/settings/AdvancedSettings.h | 1 + + 3 files changed, 8 insertions(+), 3 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp b/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp +index 3e6d0ee..a1b6f4d 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp ++++ b/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp +@@ -25,6 +25,7 @@ + #include "DVDCodecs/DVDCodecs.h" + #include "DVDCodecs/DVDFactoryCodec.h" + #include "settings/Settings.h" ++#include "settings/AdvancedSettings.h" + #include "video/VideoReferenceClock.h" + #include "utils/log.h" + #include "utils/TimeUtils.h" +@@ -715,10 +716,11 @@ void CDVDPlayerAudio::HandleSyncError(double duration) + else if (m_synctype == SYNC_PLLADJUST) + { + #if defined(TARGET_RASPBERRY_PI) +- double e = std::max(std::min(m_error, DVD_MSEC_TO_TIME(10)), -DVD_MSEC_TO_TIME(10)); +- m_plladjust = 1.0 + e * 1.5e-8; ++ double e = std::max(std::min(m_error / DVD_MSEC_TO_TIME(10), 1.0), -1.0); ++ double adjust = g_advancedSettings.m_maxPllAdjust * 1e-6; ++ m_plladjust = 1.0 + e * adjust; + m_last_plladjust = g_RBP.AdjustHDMIClock(m_plladjust); +- CLog::Log(LOGDEBUG, "CDVDPlayerAudio::%s pll:%.5f (%.5f) error:%.6f e:%.6f", __FUNCTION__, m_plladjust, m_last_plladjust, m_error, e * 1.5e-8 ); ++ CLog::Log(LOGDEBUG, "CDVDPlayerAudio::%s pll:%.5f (%.5f) error:%.6f e:%.6f a:%f", __FUNCTION__, m_plladjust, m_last_plladjust, m_error, e * adjust, adjust ); + #endif + } + m_last_error = m_error; +diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp +index 69b7832..5eca79a 100644 +--- a/xbmc/settings/AdvancedSettings.cpp ++++ b/xbmc/settings/AdvancedSettings.cpp +@@ -108,6 +108,7 @@ void CAdvancedSettings::Initialize() + + m_audioHeadRoom = 0; + m_ac3Gain = 12.0f; ++ m_maxPllAdjust = 300; + m_audioApplyDrc = true; + m_dvdplayerIgnoreDTSinWAV = false; + +@@ -481,6 +482,7 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file) + if (pElement) + { + XMLUtils::GetFloat(pElement, "ac3downmixgain", m_ac3Gain, -96.0f, 96.0f); ++ XMLUtils::GetInt(pElement, "maxplladjust", m_maxPllAdjust, 0, 1000000); + XMLUtils::GetInt(pElement, "headroom", m_audioHeadRoom, 0, 12); + XMLUtils::GetString(pElement, "defaultplayer", m_audioDefaultPlayer); + // 101 on purpose - can be used to never automark as watched +diff --git a/xbmc/settings/AdvancedSettings.h b/xbmc/settings/AdvancedSettings.h +index ca995e3..99ed121 100644 +--- a/xbmc/settings/AdvancedSettings.h ++++ b/xbmc/settings/AdvancedSettings.h +@@ -137,6 +137,7 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler + + int m_audioHeadRoom; + float m_ac3Gain; ++ int m_maxPllAdjust; + CStdString m_audioDefaultPlayer; + float m_audioPlayCountMinimumPercent; + bool m_dvdplayerIgnoreDTSinWAV; + +From 3543dc36cd233b483cab703ff1182b291443802d Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 19 Nov 2014 17:35:44 +0000 +Subject: [PATCH 050/102] [mmalrender] Skip some log message in bypass mode + +--- + xbmc/cores/VideoRenderers/MMALRenderer.cpp | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +index 03a05de..c0ff30d 100644 +--- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp ++++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +@@ -298,6 +298,9 @@ int CMMALRenderer::GetImage(YV12Image *image, int source, bool readonly) + + void CMMALRenderer::ReleaseBuffer(int idx) + { ++ if (!m_bConfigured || m_format == RENDER_FMT_BYPASS) ++ return; ++ + #if defined(MMAL_DEBUG_VERBOSE) + CLog::Log(LOGDEBUG, "%s::%s - %d", CLASSNAME, __func__, idx); + #endif +@@ -366,13 +369,13 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) + + void CMMALRenderer::FlipPage(int source) + { ++ if (!m_bConfigured || m_format == RENDER_FMT_BYPASS) ++ return; ++ + #if defined(MMAL_DEBUG_VERBOSE) + CLog::Log(LOGDEBUG, "%s::%s - %d", CLASSNAME, __func__, source); + #endif + +- if (!m_bConfigured || m_format == RENDER_FMT_BYPASS) +- return; +- + YUVBUFFER *buffer = &m_buffers[source]; + // we only want to upload frames once + if (buffer->flipindex++) + +From b4ed1b3475d6c28d9c93798de2778a7055ab6789 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 24 Nov 2014 21:24:25 +0000 +Subject: [PATCH 051/102] [mmalcodec] Avoid deinterlace for dvd menus for now + +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +index 6742e0e..a1f11e9 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +@@ -883,7 +883,7 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) + + bool deinterlace = m_interlace_mode != MMAL_InterlaceProgressive; + +- if (deinterlace_request == VS_DEINTERLACEMODE_OFF) ++ if (m_hints.stills || deinterlace_request == VS_DEINTERLACEMODE_OFF) + deinterlace = false; + else if (deinterlace_request == VS_DEINTERLACEMODE_FORCE) + deinterlace = true; + +From a13a26898ec809d12836bc1cd9dffd01f9ea4759 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 24 Nov 2014 22:07:25 +0000 +Subject: [PATCH 052/102] [dvdplayervideo] Prod decoder when in stills mode + +An asynchronous hardware decoder doesn't only produce output pictures when new packets arrive. +In dvd stills mode give it a chance to return pictures that weren't ready when frame was decoded. +--- + xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 46 ++++++++++++++++++++------------- + 1 file changed, 28 insertions(+), 18 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +index f030e37..7a8fc10 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp ++++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +@@ -324,7 +324,8 @@ void CDVDPlayerVideo::Process() + + while (!m_bStop) + { +- int iQueueTimeOut = (int)(m_stalled ? frametime / 4 : frametime * 10) / 1000; ++ bool bPictureWaiting = m_hints.stills && (m_pVideoCodec->Decode(NULL, 0, DVD_NOPTS_VALUE, DVD_NOPTS_VALUE) & VC_PICTURE); ++ int iQueueTimeOut = (int)(bPictureWaiting ? 0 : (m_hints.stills || m_stalled) ? frametime / 4 : frametime * 10) / 1000; + int iPriority = (m_speed == DVD_PLAYSPEED_PAUSE && m_started) ? 1 : 0; + + CDVDMsg* pMsg; +@@ -341,27 +342,36 @@ void CDVDPlayerVideo::Process() + if( iPriority ) + continue; + +- //Okey, start rendering at stream fps now instead, we are likely in a stillframe +- if( !m_stalled ) ++ // check for picture waiting ++ if (bPictureWaiting) + { +- if(m_started) +- CLog::Log(LOGINFO, "CDVDPlayerVideo - Stillframe detected, switching to forced %f fps", m_fFrameRate); +- m_stalled = true; +- pts+= frametime*4; ++ // create a dummy demuxer packet to prod the decode logic ++ pMsg = new CDVDMsgDemuxerPacket(CDVDDemuxUtils::AllocateDemuxPacket(0), false); + } +- +- //Waiting timed out, output last picture +- if( picture.iFlags & DVP_FLAG_ALLOCATED ) ++ else + { +- //Remove interlaced flag before outputting +- //no need to output this as if it was interlaced +- picture.iFlags &= ~DVP_FLAG_INTERLACED; +- picture.iFlags |= DVP_FLAG_NOSKIP; +- OutputPicture(&picture, pts); +- pts+= frametime; +- } ++ //Okey, start rendering at stream fps now instead, we are likely in a stillframe ++ if( !m_stalled ) ++ { ++ if(m_started) ++ CLog::Log(LOGINFO, "CDVDPlayerVideo - Stillframe detected, switching to forced %f fps", m_fFrameRate); ++ m_stalled = true; ++ pts+= frametime*4; ++ } + +- continue; ++ //Waiting timed out, output last picture ++ if( picture.iFlags & DVP_FLAG_ALLOCATED ) ++ { ++ //Remove interlaced flag before outputting ++ //no need to output this as if it was interlaced ++ picture.iFlags &= ~DVP_FLAG_INTERLACED; ++ picture.iFlags |= DVP_FLAG_NOSKIP; ++ OutputPicture(&picture, pts); ++ pts+= frametime; ++ } ++ ++ continue; ++ } + } + + if (pMsg->IsType(CDVDMsg::GENERAL_SYNCHRONIZE)) + +From c7378dc7c1c2dafcf92a1e91136811ceda0a582a Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Thu, 27 Nov 2014 16:20:56 +0000 +Subject: [PATCH 053/102] [mmalcodec] Skip some setup that is not required when + closing + +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 27 ++++++++++++---------- + 1 file changed, 15 insertions(+), 12 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +index a1f11e9..a11fa65 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +@@ -708,11 +708,11 @@ void CMMALVideo::Dispose() + { + // we are happy to exit, but let last shared pointer being deleted trigger the destructor + bool done = false; ++ m_finished = true; + Reset(); + pthread_mutex_lock(&m_output_mutex); + if (!m_output_busy) + done = true; +- m_finished = true; + pthread_mutex_unlock(&m_output_mutex); + if (g_advancedSettings.CanLogComponent(LOGVIDEO)) + CLog::Log(LOGDEBUG, "%s::%s dts_queue(%d) ready_queue(%d) busy_queue(%d) done:%d", CLASSNAME, __func__, m_dts_queue.size(), m_output_ready.size(), m_output_busy, done); +@@ -941,19 +941,21 @@ void CMMALVideo::Reset(void) + if (g_advancedSettings.CanLogComponent(LOGVIDEO)) + CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); + +- if (m_dec_input) ++ if (m_dec_input && m_dec_input->is_enabled) + mmal_port_disable(m_dec_input); +- if (m_deint_connection) ++ if (m_deint_connection && m_deint_connection->is_enabled) + mmal_connection_disable(m_deint_connection); +- if (m_dec_output) ++ if (m_dec_output && m_dec_output->is_enabled) + mmal_port_disable(m_dec_output); +- if (m_dec_input) +- mmal_port_enable(m_dec_input, dec_input_port_cb); +- if (m_deint_connection) +- mmal_connection_enable(m_deint_connection); +- if (m_dec_output) +- mmal_port_enable(m_dec_output, dec_output_port_cb_static); +- ++ if (!m_finished) ++ { ++ if (m_dec_input) ++ mmal_port_enable(m_dec_input, dec_input_port_cb); ++ if (m_deint_connection) ++ mmal_connection_enable(m_deint_connection); ++ if (m_dec_output) ++ mmal_port_enable(m_dec_output, dec_output_port_cb_static); ++ } + // blow all ready video frames + bool old_drop_state = m_drop_state; + SetDropState(true); +@@ -967,7 +969,8 @@ void CMMALVideo::Reset(void) + if (!old_drop_state) + SetDropState(false); + +- SendCodecConfigData(); ++ if (!m_finished) ++ SendCodecConfigData(); + + m_startframe = false; + m_decoderPts = DVD_NOPTS_VALUE; + +From d4777be2e056afccdd0e602373bc6b4e513b2299 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Thu, 27 Nov 2014 16:31:56 +0000 +Subject: [PATCH 054/102] [languageinvoker] Reduce priority of python threads + +--- + xbmc/interfaces/generic/LanguageInvokerThread.cpp | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/xbmc/interfaces/generic/LanguageInvokerThread.cpp b/xbmc/interfaces/generic/LanguageInvokerThread.cpp +index 7b0d903..f92aa3e 100644 +--- a/xbmc/interfaces/generic/LanguageInvokerThread.cpp ++++ b/xbmc/interfaces/generic/LanguageInvokerThread.cpp +@@ -51,6 +51,11 @@ bool CLanguageInvokerThread::execute(const std::string &script, const std::vecto + m_args = arguments; + + Create(); ++ #ifdef TARGET_RASPBERRY_PI ++ /* low prio */ ++ SetPriority(GetPriority()-1); ++ #endif ++ + return true; + } + + +From 86af6b82c9a6382e093b63720073b78c6739172e Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Thu, 27 Nov 2014 17:53:46 +0000 +Subject: [PATCH 055/102] [mmalcodec] Try reducing number of video frames + +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 2 +- + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +index a11fa65..dd08c95 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +@@ -628,7 +628,7 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVide + if (status != MMAL_SUCCESS) + CLog::Log(LOGERROR, "%s::%s Failed to disable error concealment on %s (status=%x %s)", CLASSNAME, __func__, m_dec_input->name, status, mmal_status_to_string(status)); + +- status = mmal_port_parameter_set_uint32(m_dec_input, MMAL_PARAMETER_EXTRA_BUFFERS, NUM_BUFFERS); ++ status = mmal_port_parameter_set_uint32(m_dec_input, MMAL_PARAMETER_EXTRA_BUFFERS, GetAllowedReferences()); + if (status != MMAL_SUCCESS) + CLog::Log(LOGERROR, "%s::%s Failed to enable extra buffers on %s (status=%x %s)", CLASSNAME, __func__, m_dec_input->name, status, mmal_status_to_string(status)); + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +index 4f81bbd..79a4bfd 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +@@ -86,7 +86,7 @@ class CMMALVideo + virtual void Reset(void); + virtual bool GetPicture(DVDVideoPicture *pDvdVideoPicture); + virtual bool ClearPicture(DVDVideoPicture* pDvdVideoPicture); +- virtual unsigned GetAllowedReferences() { return NUM_BUFFERS; } ++ virtual unsigned GetAllowedReferences() { return 3; } + virtual void SetDropState(bool bDrop); + virtual const char* GetName(void) { return (const char*)m_pFormatName; } + virtual bool GetCodecStats(double &pts, int &droppedPics); + +From 552d829d7fd103de9245a758ad6dc17cd258b602 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 1 Dec 2014 17:31:00 +0000 +Subject: [PATCH 056/102] [mmalcodec] Ensure we have requested number of + buffers in non-accelerated case + +--- + xbmc/cores/VideoRenderers/MMALRenderer.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +index c0ff30d..6d461bd 100644 +--- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp ++++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +@@ -100,7 +100,7 @@ bool CMMALRenderer::init_vout(MMAL_ES_FORMAT_T *format) + return false; + } + +- m_vout_input->buffer_num = m_vout_input->buffer_num_recommended; ++ m_vout_input->buffer_num = std::max(m_vout_input->buffer_num_recommended, (uint32_t)m_NumYV12Buffers); + m_vout_input->buffer_size = m_vout_input->buffer_size_recommended; + + status = mmal_port_enable(m_vout_input, vout_input_port_cb_static); + +From aa6e916e07acf80afeeac38783e8adb38d27aa81 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 3 Dec 2014 21:17:53 +0000 +Subject: [PATCH 057/102] [omxplayer] Add some info about hdmi sync to codec + overlay + +--- + xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 8 +++++++- + xbmc/cores/omxplayer/OMXVideo.cpp | 24 ++++++++++++++++++++++++ + xbmc/cores/omxplayer/OMXVideo.h | 1 + + 3 files changed, 32 insertions(+), 1 deletion(-) + +diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +index 605318c9..77b9461 100644 +--- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp ++++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +@@ -618,12 +618,18 @@ void OMXPlayerVideo::SetSpeed(int speed) + + std::string OMXPlayerVideo::GetPlayerInfo() + { ++ double match = 0.0f, phase = 0.0f, pll = 0.0f; + std::ostringstream s; + s << "fr:" << fixed << setprecision(3) << m_fFrameRate; + s << ", vq:" << setw(2) << min(99,GetLevel()) << "%"; + s << ", dc:" << m_codecname; + s << ", Mb/s:" << fixed << setprecision(2) << (double)GetVideoBitrate() / (1024.0*1024.0); +- ++ if (m_omxVideo.GetPlayerInfo(match, phase, pll)) ++ { ++ s << ", match:" << fixed << setprecision(2) << match; ++ s << ", phase:" << fixed << setprecision(2) << phase; ++ s << ", pll:" << fixed << setprecision(5) << pll; ++ } + return s.str(); + } + +diff --git a/xbmc/cores/omxplayer/OMXVideo.cpp b/xbmc/cores/omxplayer/OMXVideo.cpp +index 99bb7eb..dea0e11 100644 +--- a/xbmc/cores/omxplayer/OMXVideo.cpp ++++ b/xbmc/cores/omxplayer/OMXVideo.cpp +@@ -759,6 +759,30 @@ unsigned int COMXVideo::GetSize() + return m_omx_decoder.GetInputBufferSize(); + } + ++bool COMXVideo::GetPlayerInfo(double &match, double &phase, double &pll) ++{ ++ CSingleLock lock (m_critSection); ++ OMX_ERRORTYPE omx_err; ++ OMX_CONFIG_BRCMRENDERSTATSTYPE renderstats; ++ ++ if (!m_hdmi_clock_sync || !m_omx_render.IsInitialized()) ++ return false; ++ OMX_INIT_STRUCTURE(renderstats); ++ renderstats.nPortIndex = m_omx_render.GetInputPort(); ++ ++ omx_err = m_omx_render.GetParameter(OMX_IndexConfigBrcmRenderStats, &renderstats); ++ if(omx_err != OMX_ErrorNone) ++ { ++ CLog::Log(LOGERROR, "COMXVideo::GetPlayerInfo error GetParameter OMX_IndexParamPortDefinition omx_err(0x%08x)\n", omx_err); ++ return false; ++ } ++ match = renderstats.nMatch * 1e-6; ++ phase = (double)renderstats.nPhase / (double)renderstats.nPeriod; ++ pll = (double)renderstats.nPixelClock / (double)renderstats.nPixelClockNominal; ++ return true; ++} ++ ++ + int COMXVideo::Decode(uint8_t *pData, int iSize, double pts) + { + CSingleLock lock (m_critSection); +diff --git a/xbmc/cores/omxplayer/OMXVideo.h b/xbmc/cores/omxplayer/OMXVideo.h +index c8fd5fb..9f26427 100644 +--- a/xbmc/cores/omxplayer/OMXVideo.h ++++ b/xbmc/cores/omxplayer/OMXVideo.h +@@ -61,6 +61,7 @@ class COMXVideo + std::string GetDecoderName() { return m_video_codec_name; }; + void SetVideoRect(const CRect& SrcRect, const CRect& DestRect, RENDER_STEREO_MODE video_mode, RENDER_STEREO_MODE display_mode); + int GetInputBufferSize(); ++ bool GetPlayerInfo(double &match, double &phase, double &pll); + void SubmitEOS(); + bool IsEOS(); + bool SubmittedEOS() const { return m_submitted_eos; } + +From 3c8b1966fd0c5432c187efd935609491c90e4689 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sat, 14 Dec 2013 16:55:05 +0000 +Subject: [PATCH 063/102] logging: Add microsecond timer to log messages + +--- + xbmc/utils/log.cpp | 17 +++++++++++++++-- + 1 file changed, 15 insertions(+), 2 deletions(-) + +diff --git a/xbmc/utils/log.cpp b/xbmc/utils/log.cpp +index 3443f12..31c4a99 100644 +--- a/xbmc/utils/log.cpp ++++ b/xbmc/utils/log.cpp +@@ -24,6 +24,7 @@ + #include "threads/Thread.h" + #include "utils/StringUtils.h" + #include "CompileInfo.h" ++#include "utils/TimeUtils.cpp" + + static const char* const levelNames[] = + {"DEBUG", "INFO", "NOTICE", "WARNING", "ERROR", "SEVERE", "FATAL", "NONE"}; +@@ -198,19 +199,31 @@ void CLog::PrintDebugString(const std::string& line) + + bool CLog::WriteLogString(int logLevel, const std::string& logString) + { ++#if defined(TARGET_LINUX) ++ static const char* prefixFormat = "%02.2d:%02.2d:%02.2d %10.6f T:%" PRIu64" %7s: "; ++#else + static const char* prefixFormat = "%02.2d:%02.2d:%02.2d T:%" PRIu64" %7s: "; +- ++#endif + std::string strData(logString); + /* fixup newline alignment, number of spaces should equal prefix length */ + StringUtils::Replace(strData, "\n", "\n "); + + int hour, minute, second; + s_globals.m_platform.GetCurrentLocalTime(hour, minute, second); +- ++ ++#if defined(TARGET_LINUX) ++ struct timespec now; ++ clock_gettime(CLOCK_MONOTONIC, &now); ++ float Now = now.tv_sec + now.tv_nsec * 1e-9; ++#endif ++ + strData = StringUtils::Format(prefixFormat, + hour, + minute, + second, ++#if defined(TARGET_LINUX) ++ Now, ++#endif + (uint64_t)CThread::GetCurrentThreadId(), + levelNames[logLevel]) + strData; + + +From 1e05813251c2003cabef228decd70efdbc83f1aa Mon Sep 17 00:00:00 2001 From: da-anda Date: Sun, 17 Aug 2014 21:09:59 +0200 -Subject: [PATCH 32/95] handle stereoscopic mode of videos in mixed playlists +Subject: [PATCH 064/102] handle stereoscopic mode of videos in mixed playlists --- language/English/strings.po | 2 +- @@ -4012,7 +5760,7 @@ Subject: [PATCH 32/95] handle stereoscopic mode of videos in mixed playlists 2 files changed, 49 insertions(+), 29 deletions(-) diff --git a/language/English/strings.po b/language/English/strings.po -index 3b51f49..1eb9205 100755 +index 219db23..daa5446 100755 --- a/language/English/strings.po +++ b/language/English/strings.po @@ -15784,7 +15784,7 @@ msgstr "" @@ -4172,10 +5920,10 @@ index 35ba597..b013942 100644 case 2: // Mono SetStereoMode( RENDER_STEREO_MODE_MONO ); -From e78ee3d8dd03e53393af7fa4e04924679cb33e73 Mon Sep 17 00:00:00 2001 +From dc34c5c38ab1983a40e1dc57799cf08962a4ee1d Mon Sep 17 00:00:00 2001 From: da-anda Date: Sat, 16 Aug 2014 11:20:54 +0200 -Subject: [PATCH 33/95] remember user selected 3D modes between videos until +Subject: [PATCH 065/102] remember user selected 3D modes between videos until playback ended --- @@ -4392,226 +6140,10 @@ index c1dfb93..cb54bd0 100644 -From d2d0dbdd647d4429aee2472dac3507da86bf5bbe Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sun, 10 Aug 2014 16:45:16 +0100 -Subject: [PATCH 34/95] filesystem: Make support of browsing into archives - optional - -The ability to browse, scan and play content in archives can cause problems on low powered/low memory devices. -It's quite common to see reports of a large rar file that causes xbmc to crash with an out-of-memory error when browsing or scanning. -It also can be slow as any archive in the directory is opened and extracted. - -Add a settings option to enable this feature and default to disabled on Pi ---- - language/English/strings.po | 9 +++++++++ - system/settings/rbp.xml | 10 ++++++++++ - system/settings/settings.xml | 5 +++++ - xbmc/filesystem/FileDirectoryFactory.cpp | 4 ++++ - 4 files changed, 28 insertions(+) - -diff --git a/language/English/strings.po b/language/English/strings.po -index 1eb9205..d8ce7f7 100755 ---- a/language/English/strings.po -+++ b/language/English/strings.po -@@ -16115,4 +16115,13 @@ msgstr "" - #: system/settings/rbp.xml - msgctxt "#38010" - msgid "GPU accelerated" -+ -+#: system/settings/settings.xml -+msgctxt "#38020" -+msgid "Support browsing into archives" -+msgstr "" -+ -+#: system/settings/settings.xml -+msgctxt "#38021" -+msgid "Allow viewing and playing files in archives (e.g. zip, rar)" - msgstr "" -diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml -index f572eed..f3c8a01 100644 ---- a/system/settings/rbp.xml -+++ b/system/settings/rbp.xml -@@ -1,5 +1,15 @@ - - -+
-+ -+ -+ -+ false -+ -+ -+ -+
-+ -
- - -diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index 367542d..0db66a2 100644 ---- a/system/settings/settings.xml -+++ b/system/settings/settings.xml -@@ -226,6 +226,11 @@ - false - - -+ -+ 1 -+ true -+ -+ - - - -diff --git a/xbmc/filesystem/FileDirectoryFactory.cpp b/xbmc/filesystem/FileDirectoryFactory.cpp -index 2fd8777..3b294cd 100644 ---- a/xbmc/filesystem/FileDirectoryFactory.cpp -+++ b/xbmc/filesystem/FileDirectoryFactory.cpp -@@ -46,6 +46,7 @@ - #include "Directory.h" - #include "File.h" - #include "ZipManager.h" -+#include "settings/Settings.h" - #include "settings/AdvancedSettings.h" - #include "FileItem.h" - #include "utils/StringUtils.h" -@@ -142,6 +143,8 @@ IFileDirectory* CFileDirectoryFactory::Create(const CURL& url, CFileItem* pItem, - return NULL; - } - #endif -+ if (CSettings::Get().GetBool("filelists.browsearchives")) -+ { - if (url.IsFileType("zip")) - { - CURL zipURL = URIUtils::CreateArchivePath("zip", url); -@@ -215,6 +218,7 @@ IFileDirectory* CFileDirectoryFactory::Create(const CURL& url, CFileItem* pItem, - } - return NULL; - } -+ } - if (url.IsFileType("xsp")) - { // XBMC Smart playlist - just XML renamed to XSP - // read the name of the playlist in - -From 66b72684b7f1eabe5f5e3e0a52fdf00be178f03a Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Mon, 27 Oct 2014 13:06:57 +0000 -Subject: [PATCH 36/95] [rbp] Make cachemembuffersize default depend on memory - size - ---- - xbmc/linux/RBP.cpp | 5 +++++ - xbmc/settings/AdvancedSettings.cpp | 5 +++++ - 2 files changed, 10 insertions(+) - -diff --git a/xbmc/linux/RBP.cpp b/xbmc/linux/RBP.cpp -index ba1a3d0..5119949 100644 ---- a/xbmc/linux/RBP.cpp -+++ b/xbmc/linux/RBP.cpp -@@ -22,6 +22,7 @@ - #if defined(TARGET_RASPBERRY_PI) - - #include "settings/Settings.h" -+#include "settings/AdvancedSettings.h" - #include "utils/log.h" - - #include "cores/omxplayer/OMXImage.h" -@@ -84,6 +85,9 @@ bool CRBP::Initialize() - if (!m_gui_resolution_limit) - m_gui_resolution_limit = m_gpu_mem < 128 ? 720:1080; - -+ if (g_advancedSettings.m_cacheMemBufferSize == ~0U) -+ g_advancedSettings.m_cacheMemBufferSize = m_arm_mem < 256 ? 1024 * 1024 * 2 : 1024 * 1024 * 20; -+ - g_OMXImage.Initialize(); - m_omx_image_init = true; - return true; -@@ -96,6 +100,7 @@ void CRBP::LogFirmwareVerison() - response[sizeof(response) - 1] = '\0'; - CLog::Log(LOGNOTICE, "Raspberry PI firmware version: %s", response); - CLog::Log(LOGNOTICE, "ARM mem: %dMB GPU mem: %dMB MPG2:%d WVC1:%d", m_arm_mem, m_gpu_mem, m_codec_mpg2_enabled, m_codec_wvc1_enabled); -+ CLog::Log(LOGNOTICE, "cacheMemBufferSize: %dMB", g_advancedSettings.m_cacheMemBufferSize >> 20); - m_DllBcmHost->vc_gencmd(response, sizeof response, "get_config int"); - response[sizeof(response) - 1] = '\0'; - CLog::Log(LOGNOTICE, "Config:\n%s", response); -diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index e6d58b3..bc8598e 100644 ---- a/xbmc/settings/AdvancedSettings.cpp -+++ b/xbmc/settings/AdvancedSettings.cpp -@@ -364,7 +364,12 @@ void CAdvancedSettings::Initialize() - m_bPVRAutoScanIconsUserSet = false; - m_iPVRNumericChannelSwitchTimeout = 1000; - -+#ifdef TARGET_RASPBERRY_PI -+ // want default to be memory dependent, but interface to gpu not available yet, so set in RBP.cpp -+ m_cacheMemBufferSize = ~0; -+#else - m_cacheMemBufferSize = 1024 * 1024 * 20; -+#endif - m_networkBufferMode = 0; // Default (buffer all internet streams/filesystems) - // the following setting determines the readRate of a player data - // as multiply of the default data read rate - -From b67b4b5859782d413c9de2a9e9967c1d2a7cf7ab Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Mon, 16 Jun 2014 19:06:00 +0100 -Subject: [PATCH 38/95] [experimental] Disable quiet-noise generation - ---- - xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp -index b391ff3..463a89c 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp -@@ -873,6 +873,7 @@ void CActiveAESink::SwapInit(CSampleBuffer* samples) - - void CActiveAESink::GenerateNoise() - { -+#ifndef TARGET_RASPBERRY_PI - int nb_floats = m_sampleOfSilence.pkt->max_nb_samples; - nb_floats *= m_sampleOfSilence.pkt->config.channels; - -@@ -913,6 +914,7 @@ void CActiveAESink::GenerateNoise() - - _aligned_free(noise); - delete resampler; -+#endif - } - - void CActiveAESink::SetSilenceTimer() - -From 6da66ad13beb343bc62eb3fb9b5796c0d7e6f956 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Fri, 30 May 2014 14:58:43 +0100 -Subject: [PATCH 39/95] [settings] Experiment: Report DESKTOP resolution in - video settings - ---- - xbmc/settings/DisplaySettings.cpp | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/xbmc/settings/DisplaySettings.cpp b/xbmc/settings/DisplaySettings.cpp -index 6902f83..50c5f97 100644 ---- a/xbmc/settings/DisplaySettings.cpp -+++ b/xbmc/settings/DisplaySettings.cpp -@@ -674,6 +674,9 @@ void CDisplaySettings::SettingOptionsResolutionsFiller(const CSetting *setting, - vector resolutions = g_Windowing.ScreenResolutions(info.iScreen, info.fRefreshRate); - for (vector::const_iterator resolution = resolutions.begin(); resolution != resolutions.end(); ++resolution) - { -+if (resolution->ResInfo_Index == RES_DESKTOP) -+ list.push_back(make_pair(StringUtils::Format("DESKTOP"), resolution->ResInfo_Index)); -+else - list.push_back(make_pair( - StringUtils::Format("%dx%d%s", resolution->width, resolution->height, - ModeFlagsToString(resolution->flags, false).c_str()), - -From 0b8568b0277516f3bfd2a3d7a6589cc4d5c002fb Mon Sep 17 00:00:00 2001 +From f78e8f6d0f47d47ac76a32b1b8055cf624573425 Mon Sep 17 00:00:00 2001 From: macrule Date: Thu, 11 Apr 2013 18:24:42 +0200 -Subject: [PATCH 40/95] Added some vc_tv_* functions that were missing in +Subject: [PATCH 066/102] Added some vc_tv_* functions that were missing in DllBCM. --- @@ -4646,10 +6178,10 @@ index b92fdb8..9c7e293 100644 HDMI_INTERLACED_T scan_mode, EDID_MODE_MATCH_FLAG_T match_flags) { return ::vc_tv_hdmi_power_on_best(width, height, frame_rate, scan_mode, match_flags); }; -From 68e90441d0ef973faa0583f1165a1167516867d4 Mon Sep 17 00:00:00 2001 +From 0ffcfe736dc3dc0d381d9b0505aa8e0c8481d68b Mon Sep 17 00:00:00 2001 From: macrule Date: Thu, 11 Apr 2013 18:29:03 +0200 -Subject: [PATCH 41/95] Added private utility function to map a float display +Subject: [PATCH 067/102] Added private utility function to map a float display aspect, to the respective SDTV_ASPECT_* enum value. --- @@ -4657,7 +6189,7 @@ Subject: [PATCH 41/95] Added private utility function to map a float display 1 file changed, 19 insertions(+) diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -index bf1e589..518a87d 100644 +index a25eb86..5fbfa6f 100644 --- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp @@ -411,6 +411,25 @@ static void SetResolutionString(RESOLUTION_INFO &res) @@ -4687,10 +6219,10 @@ index bf1e589..518a87d 100644 bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &resolutions) -From a43160514d52390fafed37bb90d74210ed546dd5 Mon Sep 17 00:00:00 2001 +From 70bf1bc05dd77f5e152c8ae7eab39e811506d48e Mon Sep 17 00:00:00 2001 From: macrule Date: Thu, 11 Apr 2013 19:50:58 +0200 -Subject: [PATCH 42/95] Changed SDTV resolutions to be treated similarly to +Subject: [PATCH 068/102] Changed SDTV resolutions to be treated similarly to HDMI resolutions in SetNativeResolution. This means that the SDTV interface is powered up and set to the right mode. @@ -4700,7 +6232,7 @@ Subject: [PATCH 42/95] Changed SDTV resolutions to be treated similarly to 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -index 518a87d..9dc39d5 100644 +index 5fbfa6f..a36b12c 100644 --- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp @@ -221,7 +221,7 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res) @@ -4762,7 +6294,7 @@ index 518a87d..9dc39d5 100644 - m_desktopRes.dwFlags = D3DPRESENTFLAG_INTERLACED; + m_desktopRes.dwFlags = MAKEFLAGS(HDMI_RES_GROUP_INVALID, tv_state.display.sdtv.mode, 1); m_desktopRes.fRefreshRate = (float)tv_state.display.sdtv.frame_rate; - m_desktopRes.fPixelRatio = get_display_aspect_ratio((SDTV_ASPECT_T)tv_state.display.sdtv.display_options.aspect) / ((float)m_desktopRes.iScreenWidth / (float)m_desktopRes.iScreenHeight); + m_desktopRes.fPixelRatio = tv_state.display.hdmi.display_options.aspect == 0 ? 1.0f : get_display_aspect_ratio((SDTV_ASPECT_T)tv_state.display.sdtv.display_options.aspect) / ((float)m_desktopRes.iScreenWidth / (float)m_desktopRes.iScreenHeight); } @@ -507,9 +532,6 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r CLog::Log(LOGDEBUG, "EGL probe resolution %s:%x\n", m_desktopRes.strMode.c_str(), m_desktopRes.dwFlags); @@ -4787,28 +6319,27 @@ index 59401f5..a0acb1a 100644 int m_width; int m_height; -From 41f146be012efc6f5226e29a26a7eb2616650ba0 Mon Sep 17 00:00:00 2001 +From b92488ba6456efd01517bb040eb63b0c8a70036d Mon Sep 17 00:00:00 2001 From: macrule Date: Thu, 11 Apr 2013 19:54:59 +0200 -Subject: [PATCH 43/95] Added methods SuspendVideoOutput() and +Subject: [PATCH 069/102] Added methods SuspendVideoOutput() and ResumeVideoOutput() to CRBP class, which can be used to power down the Raspberry PI's video interface, and restore it at a later point. --- - xbmc/linux/RBP.cpp | 15 +++++++++++++++ + xbmc/linux/RBP.cpp | 13 +++++++++++++ xbmc/linux/RBP.h | 3 +++ xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 3 +++ - 3 files changed, 21 insertions(+) + 3 files changed, 19 insertions(+) diff --git a/xbmc/linux/RBP.cpp b/xbmc/linux/RBP.cpp -index 5119949..cb87b77 100644 +index ce09fce..a18aa49 100644 --- a/xbmc/linux/RBP.cpp +++ b/xbmc/linux/RBP.cpp -@@ -212,4 +212,19 @@ void CRBP::Deinitialize() - m_initialized = false; - m_omx_initialized = false; +@@ -225,5 +225,18 @@ double CRBP::AdjustHDMIClock(double adjust) + return new_adjust; } -+ + +void CRBP::SuspendVideoOutput() +{ + CLog::Log(LOGDEBUG, "Raspberry PI suspending video output\n"); @@ -4822,15 +6353,15 @@ index 5119949..cb87b77 100644 + m_DllBcmHost->vc_gencmd(response, sizeof response, "display_power 1"); + CLog::Log(LOGDEBUG, "Raspberry PI resuming video output\n"); +} -+ + #endif diff --git a/xbmc/linux/RBP.h b/xbmc/linux/RBP.h -index 4fd18f3..f947acc 100644 +index 6456657..606c24f 100644 --- a/xbmc/linux/RBP.h +++ b/xbmc/linux/RBP.h -@@ -59,6 +59,9 @@ class CRBP - DllOMX *GetDllOMX() { return m_OMX ? m_OMX->GetDll() : NULL; } +@@ -60,6 +60,9 @@ class CRBP void WaitVsync(); + double AdjustHDMIClock(double adjust); + void SuspendVideoOutput(); + void ResumeVideoOutput(); @@ -4839,7 +6370,7 @@ index 4fd18f3..f947acc 100644 DllBcmHost *m_DllBcmHost; bool m_initialized; diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -index 9dc39d5..ca36082 100644 +index a36b12c..1529045 100644 --- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp @@ -59,7 +59,10 @@ @@ -4854,12 +6385,12 @@ index 9dc39d5..ca36082 100644 CEGLNativeTypeRaspberryPI::CEGLNativeTypeRaspberryPI() { -From 089c63ede9cf341db6d46be7f3bdea095b742a39 Mon Sep 17 00:00:00 2001 +From 1776970a4c6b35ba194fe71bbd9d6411420ae3cf Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 11 Aug 2013 15:03:36 +0100 -Subject: [PATCH 44/95] PowerManager (and its IPowerSyscall instance) now gets - called from CApplication::OnKey() and can process and suppress key presses. - This is a requirement to implement a virtual sleep state. +Subject: [PATCH 070/102] PowerManager (and its IPowerSyscall instance) now + gets called from CApplication::OnKey() and can process and suppress key + presses. This is a requirement to implement a virtual sleep state. --- xbmc/Application.cpp | 7 +++++++ @@ -4869,10 +6400,10 @@ Subject: [PATCH 44/95] PowerManager (and its IPowerSyscall instance) now gets 4 files changed, 23 insertions(+) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index 9162708..b39c419 100644 +index 8e0ab13..9e4be48 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp -@@ -2360,6 +2360,13 @@ bool CApplication::OnKey(const CKey& key) +@@ -2377,6 +2377,13 @@ bool CApplication::OnKey(const CKey& key) // special handling if the screensaver is active CAction action = CButtonTranslator::GetInstance().GetAction(iWin, key); @@ -4950,12 +6481,12 @@ index 0b1f10a..e42b143 100644 void OnSleep(); void OnWake(); -From 5b0d58710c39a6a53a57645f06961b603f235d62 Mon Sep 17 00:00:00 2001 +From 1419471698c6691ff9fbc59bca24ac4a41848efb Mon Sep 17 00:00:00 2001 From: macrule Date: Wed, 17 Apr 2013 13:23:01 +0200 -Subject: [PATCH 45/95] Added CPowerSyscallVirtualSleep class, which acts as a - base class for devices that have no native standby mode, and need to fake it - in some way. +Subject: [PATCH 071/102] Added CPowerSyscallVirtualSleep class, which acts as + a base class for devices that have no native standby mode, and need to fake + it in some way. --- xbmc/powermanagement/Makefile | 1 + @@ -5129,10 +6660,10 @@ index 0000000..ef6e682 + +#endif // _POWER_SYSCALL_VIRTUAL_SLEEP_H_ -From 63f94f0b4a969849844fa530b1d6768b0d12b49d Mon Sep 17 00:00:00 2001 +From 90a6b3b7634a8cd0681316b7fce6b3cf518b3747 Mon Sep 17 00:00:00 2001 From: macrule Date: Wed, 17 Apr 2013 13:24:22 +0200 -Subject: [PATCH 46/95] Added power management support for the Raspberry Pi. +Subject: [PATCH 072/102] Added power management support for the Raspberry Pi. Since it doesn't support true standby, we fake it by turning video on or off, and ignoring remote inputs during the standby phase. @@ -5278,10 +6809,10 @@ index 0000000..fd1d67c + +#endif // _RASPBERRY_PI_POWER_SYSCALL_H_ -From f4ed184f2b55c1944ae00cb1f44615caebe4e534 Mon Sep 17 00:00:00 2001 +From 9793e66c04489c13f0715e57ec0a88b08e10faab Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Mar 2014 16:16:29 +0000 -Subject: [PATCH 47/95] [power] hack - don't kill lirc or cec +Subject: [PATCH 073/102] [power] hack - don't kill lirc or cec --- xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 37 +++++++++++++++++++++++ @@ -5289,7 +6820,7 @@ Subject: [PATCH 47/95] [power] hack - don't kill lirc or cec 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp -index e80feb1..b0058ce 100644 +index da0ccb4..bfdcd06 100644 --- a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp +++ b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp @@ -183,12 +183,49 @@ void CPeripheralCecAdapter::Announce(AnnouncementFlag flag, const char *sender, @@ -5365,10 +6896,10 @@ index 2d8c750..901f449 100644 CBuiltins::Execute("LIRC.Start"); #endif -From 766ac6c506a1636dc6265c4feaa47d07b08a8c9b Mon Sep 17 00:00:00 2001 +From 9a33bfbc331b9c5c6d9e229f82a1d7a7e7e4c18a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Mar 2014 16:47:54 +0000 -Subject: [PATCH 48/95] [power] hack - wake on any action +Subject: [PATCH 074/102] [power] hack - wake on any action --- xbmc/powermanagement/PowerSyscallVirtualSleep.cpp | 6 +++--- @@ -5397,10 +6928,10 @@ index 6a1e47b..a717a09 100644 if(VirtualWake()) { -From ae7da7ac1e66c3b20f0ff3c631040d81e207b385 Mon Sep 17 00:00:00 2001 +From 7d8c65d6d9da39884ed27c80862df7c5c07cad96 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Mar 2014 17:30:07 +0000 -Subject: [PATCH 49/95] [power] hack - Make suspend toggle suspend state +Subject: [PATCH 075/102] [power] hack - Make suspend toggle suspend state --- xbmc/powermanagement/PowerSyscallVirtualSleep.cpp | 5 +++++ @@ -5423,10 +6954,10 @@ index a717a09..d39c3ed 100644 return false; } -From 1d9f8ecb8f52ff1370016f869e6c8144eddb2adb Mon Sep 17 00:00:00 2001 +From e9efddb09861be15e18121a41064654e56f5e70e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 4 Mar 2014 19:33:44 +0000 -Subject: [PATCH 50/95] [power] Add back in powerdown and reboot +Subject: [PATCH 076/102] [power] Add back in powerdown and reboot --- .../linux/RaspberryPIPowerSyscall.cpp | 34 ++++++++++++++++++++++ @@ -5504,18 +7035,18 @@ index fd1d67c..062132e 100644 virtual bool CanReboot() { return true; } -From c3eb8e92222e2f1d7fdb54dae559585f59fe555d Mon Sep 17 00:00:00 2001 +From 9c5c7ff030d22ddeb025d9b9882d79134894f207 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 26 Apr 2014 17:27:52 +0100 -Subject: [PATCH 51/95] [cec] Don't suspend pi on tv switch off - it can't wake - up +Subject: [PATCH 077/102] [cec] Don't suspend pi on tv switch off - it can't + wake up --- system/peripherals.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/peripherals.xml b/system/peripherals.xml -index a67dc2f..680863e 100644 +index 094a3c1..0b89ee8 100644 --- a/system/peripherals.xml +++ b/system/peripherals.xml @@ -16,7 +16,7 @@ @@ -5528,17 +7059,17 @@ index a67dc2f..680863e 100644 -From c21c0a2731f0d6fde8fc61142b4f913d3389350b Mon Sep 17 00:00:00 2001 +From fd75f0ded14b978c508d62aab5846117a36b4ac4 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 27 Jun 2014 00:01:05 +0100 -Subject: [PATCH 52/95] [rbp] Resume video output on startup +Subject: [PATCH 078/102] [rbp] Resume video output on startup --- xbmc/linux/RBP.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xbmc/linux/RBP.cpp b/xbmc/linux/RBP.cpp -index cb87b77..34866f6 100644 +index a18aa49..6514c2d 100644 --- a/xbmc/linux/RBP.cpp +++ b/xbmc/linux/RBP.cpp @@ -88,6 +88,9 @@ bool CRBP::Initialize() @@ -5552,607 +7083,10 @@ index cb87b77..34866f6 100644 m_omx_image_init = true; return true; -From 22b642e55cdfdaf77e727e2991835dc79212b0d0 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sat, 16 Aug 2014 21:01:42 +0100 -Subject: [PATCH 53/95] omxrender: Hacks to reduce GUI rendering rate when - playing video - ---- - language/English/strings.po | 27 +++++++++++++++++++++++++++ - system/settings/rbp.xml | 16 ++++++++++++++++ - xbmc/Application.cpp | 17 +++++++++++++++++ - 3 files changed, 60 insertions(+) - -diff --git a/language/English/strings.po b/language/English/strings.po -index d8ce7f7..5f09e86 100755 ---- a/language/English/strings.po -+++ b/language/English/strings.po -@@ -16125,3 +16125,30 @@ msgstr "" - msgctxt "#38021" - msgid "Allow viewing and playing files in archives (e.g. zip, rar)" - msgstr "" -+ -+#: system/settings/settings.xml -+msgctxt "#38000" -+msgid "Limit GUI updates when playing video" -+msgstr "" -+ -+#: system/settings/settings.xml -+msgctxt "#38001" -+msgid "This can reduce CPU when playing video by updating the overlays less often" -+msgstr "" -+ -+#: system/settings/settings.xml -+msgctxt "#38002" -+msgid "Off" -+msgstr "" -+ -+msgctxt "#38003" -+msgid "5 fps" -+msgstr "" -+ -+msgctxt "#38004" -+msgid "10 fps" -+msgstr "" -+ -+msgctxt "#38005" -+msgid "24 fps" -+msgstr "" -diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml -index f3c8a01..2996c29 100644 ---- a/system/settings/rbp.xml -+++ b/system/settings/rbp.xml -@@ -25,6 +25,22 @@ - - - -+ -+ -+ 2 -+ 10 -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - -
- -diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index b39c419..33dc9a5 100644 ---- a/xbmc/Application.cpp -+++ b/xbmc/Application.cpp -@@ -2207,6 +2207,23 @@ void CApplication::Render() - if (m_bStop) - return; - -+#ifdef TARGET_RASPBERRY_PI -+ if (g_graphicsContext.IsFullScreenVideo() && !m_pPlayer->IsPausedPlayback()) -+ { -+ int fps = CSettings::Get().GetInt("videoplayer.limitguiupdate"); -+ unsigned int now = XbmcThreads::SystemClockMillis(); -+ unsigned int frameTime = now - m_lastFrameTime; -+ if (fps > 0 && frameTime * fps < 1000) -+ { -+ g_renderManager.FrameWait(100); -+ g_infoManager.UpdateFPS(); -+ g_renderManager.FrameMove(); -+ g_renderManager.FrameFinish(); -+ return; -+ } -+ } -+#endif -+ - MEASURE_FUNCTION; - - int vsync_mode = CSettings::Get().GetInt("videoscreen.vsync"); - -From 08e4c76f0a4893f56a844d83fb428fb73af59af3 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Tue, 9 Sep 2014 12:04:26 +0100 -Subject: [PATCH 54/95] egl: Treat unknown display aspect ratio as square pixel - ---- - xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -index ca36082..1529045 100644 ---- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -+++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -@@ -493,7 +493,7 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r - m_desktopRes.iScreenWidth = tv_state.display.hdmi.width; - m_desktopRes.iScreenHeight= tv_state.display.hdmi.height; - m_desktopRes.dwFlags = MAKEFLAGS(tv_state.display.hdmi.group, tv_state.display.hdmi.mode, tv_state.display.hdmi.scan_mode); -- m_desktopRes.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv_state.display.hdmi.display_options.aspect) / ((float)m_desktopRes.iScreenWidth / (float)m_desktopRes.iScreenHeight); -+ m_desktopRes.fPixelRatio = tv_state.display.hdmi.display_options.aspect == 0 ? 1.0f : get_display_aspect_ratio((HDMI_ASPECT_T)tv_state.display.hdmi.display_options.aspect) / ((float)m_desktopRes.iScreenWidth / (float)m_desktopRes.iScreenHeight); - // Also add 3D flags - if (tv_state.display.hdmi.format_3d == HDMI_3D_FORMAT_SBS_HALF) - m_desktopRes.dwFlags |= D3DPRESENTFLAG_MODE3DSBS; -@@ -514,7 +514,7 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r - m_desktopRes.iScreenHeight= tv_state.display.sdtv.height; - m_desktopRes.dwFlags = MAKEFLAGS(HDMI_RES_GROUP_INVALID, tv_state.display.sdtv.mode, 1); - m_desktopRes.fRefreshRate = (float)tv_state.display.sdtv.frame_rate; -- m_desktopRes.fPixelRatio = get_display_aspect_ratio((SDTV_ASPECT_T)tv_state.display.sdtv.display_options.aspect) / ((float)m_desktopRes.iScreenWidth / (float)m_desktopRes.iScreenHeight); -+ m_desktopRes.fPixelRatio = tv_state.display.hdmi.display_options.aspect == 0 ? 1.0f : get_display_aspect_ratio((SDTV_ASPECT_T)tv_state.display.sdtv.display_options.aspect) / ((float)m_desktopRes.iScreenWidth / (float)m_desktopRes.iScreenHeight); - } - - SetResolutionString(m_desktopRes); - -From e0073b33259cb3304ae2da0d081e7c156fc8d897 Mon Sep 17 00:00:00 2001 -From: anaconda -Date: Thu, 11 Sep 2014 21:30:43 +0200 -Subject: [PATCH 55/95] Disable textbox autoscrolling while on screensaver. - -SQUASH: only if dim or black ---- - xbmc/Application.cpp | 7 +++++++ - xbmc/Application.h | 2 ++ - xbmc/guilib/GUITextBox.cpp | 5 ++++- - 3 files changed, 13 insertions(+), 1 deletion(-) - -diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index 33dc9a5..4984718 100644 ---- a/xbmc/Application.cpp -+++ b/xbmc/Application.cpp -@@ -5880,3 +5880,10 @@ void CApplication::CloseNetworkShares() - CSFTPSessionManager::DisconnectAllSessions(); - #endif - } -+ -+std::string CApplication::GetScreenSaverId() -+{ -+ if (m_screenSaver) -+ return m_screenSaver->ID(); -+ return ""; -+} -diff --git a/xbmc/Application.h b/xbmc/Application.h -index 0a332ff..15efc90 100644 ---- a/xbmc/Application.h -+++ b/xbmc/Application.h -@@ -380,6 +380,8 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs - - void SetLoggingIn(bool loggingIn) { m_loggingIn = loggingIn; } - -+ std::string GetScreenSaverId(); -+ - protected: - virtual bool OnSettingsSaving() const; - -diff --git a/xbmc/guilib/GUITextBox.cpp b/xbmc/guilib/GUITextBox.cpp -index b7ef051..e149418 100644 ---- a/xbmc/guilib/GUITextBox.cpp -+++ b/xbmc/guilib/GUITextBox.cpp -@@ -23,6 +23,7 @@ - #include "utils/XBMCTinyXML.h" - #include "utils/MathUtils.h" - #include "utils/StringUtils.h" -+#include "Application.h" - - using namespace std; - -@@ -132,7 +133,9 @@ void CGUITextBox::Process(unsigned int currentTime, CDirtyRegionList &dirtyregio - // update our auto-scrolling as necessary - if (m_autoScrollTime && m_lines.size() > m_itemsPerPage) - { -- if (!m_autoScrollCondition || m_autoScrollCondition->Get()) -+ if ((!m_autoScrollCondition || m_autoScrollCondition->Get()) && !(g_application.IsInScreenSaver() && -+ (g_application.GetScreenSaverId() == "screensaver.xbmc.builtin.black" || -+ g_application.GetScreenSaverId() == "screensaver.xbmc.builtin.dim"))) - { - if (m_lastRenderTime) - m_autoScrollDelayTime += currentTime - m_lastRenderTime; - -From 98a77af308a8ea585513e0e16bce4701622660bd Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 18 Sep 2014 14:24:56 +0100 -Subject: [PATCH 56/95] [omxplayer] Only enable audio clock master when A/V - sync method is set to audio clock - ---- - xbmc/cores/omxplayer/OMXAudio.cpp | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp -index 5475570..7c07b57 100644 ---- a/xbmc/cores/omxplayer/OMXAudio.cpp -+++ b/xbmc/cores/omxplayer/OMXAudio.cpp -@@ -246,7 +246,8 @@ bool COMXAudio::PortSettingsChanged() - { - // By default audio_render is the clock master, and if output samples don't fit the timestamps, it will speed up/slow down the clock. - // This tends to be better for maintaining audio sync and avoiding audio glitches, but can affect video/display sync -- if(CSettings::Get().GetBool("videoplayer.usedisplayasclock") || CSettings::Get().GetString("audiooutput.audiodevice") == "PI:Both") -+ if((CSettings::Get().GetBool("videoplayer.usedisplayasclock") && CSettings::Get().GetInt("videoplayer.synctype") == SYNC_DISCON) || -+ CSettings::Get().GetString("audiooutput.audiodevice") == "PI:Both") - { - OMX_CONFIG_BOOLEANTYPE configBool; - OMX_INIT_STRUCTURE(configBool); -@@ -272,7 +273,7 @@ bool COMXAudio::PortSettingsChanged() - { - // By default audio_render is the clock master, and if output samples don't fit the timestamps, it will speed up/slow down the clock. - // This tends to be better for maintaining audio sync and avoiding audio glitches, but can affect video/display sync -- if(CSettings::Get().GetBool("videoplayer.usedisplayasclock")) -+ if(CSettings::Get().GetBool("videoplayer.usedisplayasclock") && CSettings::Get().GetInt("videoplayer.synctype") == SYNC_DISCON) - { - OMX_CONFIG_BOOLEANTYPE configBool; - OMX_INIT_STRUCTURE(configBool); - -From b745b4f1b843957be0a0c3806cc4188e872725cb Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Fri, 19 Sep 2014 11:54:49 +0100 -Subject: [PATCH 57/95] [dvdplayer/rbp] Add pi specific option to maintain - vsync with pll adjustment - -New A/V sync option in settings/video/playback to do "Adjust PLL". -This uses video clock (so perfect video syncing) but avoids having to resample -or drop/dupe audio packets which is normally required. - -Needed updated firmware ---- - language/English/strings.po | 5 +++++ - system/settings/rbp.xml | 20 ++++++++++++++++++ - xbmc/cores/AudioEngine/Utils/AEUtil.h | 3 ++- - xbmc/cores/dvdplayer/DVDPlayerAudio.cpp | 36 +++++++++++++++++++++++++++++++-- - xbmc/cores/dvdplayer/DVDPlayerAudio.h | 1 + - xbmc/linux/RBP.cpp | 13 ++++++++++++ - xbmc/linux/RBP.h | 1 + - 7 files changed, 76 insertions(+), 3 deletions(-) - -diff --git a/language/English/strings.po b/language/English/strings.po -index 5f09e86..77ad249 100755 ---- a/language/English/strings.po -+++ b/language/English/strings.po -@@ -16152,3 +16152,8 @@ msgstr "" - msgctxt "#38005" - msgid "24 fps" - msgstr "" -+ -+#: system/settings/settings.xml -+msgctxt "#38006" -+msgid "Adjust PLL" -+msgstr "" -diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml -index 2996c29..79853a8 100644 ---- a/system/settings/rbp.xml -+++ b/system/settings/rbp.xml -@@ -11,6 +11,26 @@ -
- -
-+ -+ -+ -+ 2 -+ 2 -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ true -+ -+ -+ -+ -+ - - - false -diff --git a/xbmc/cores/AudioEngine/Utils/AEUtil.h b/xbmc/cores/AudioEngine/Utils/AEUtil.h -index 782a9ba..3e0390c 100644 ---- a/xbmc/cores/AudioEngine/Utils/AEUtil.h -+++ b/xbmc/cores/AudioEngine/Utils/AEUtil.h -@@ -57,7 +57,8 @@ enum AVSync - { - SYNC_DISCON = 0, - SYNC_SKIPDUP, -- SYNC_RESAMPLE -+ SYNC_RESAMPLE, -+ SYNC_PLLADJUST - }; - - struct AEDelayStatus -diff --git a/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp b/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp -index f567518..5e9a6d3 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp -+++ b/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp -@@ -113,6 +113,7 @@ CDVDPlayerAudio::CDVDPlayerAudio(CDVDClock* pClock, CDVDMessageQueue& parent) - m_started = false; - m_silence = false; - m_resampleratio = 1.0; -+ m_plladjust = 1.0f; - m_synctype = SYNC_DISCON; - m_setsynctype = SYNC_DISCON; - m_prevsynctype = -1; -@@ -475,6 +476,8 @@ void CDVDPlayerAudio::UpdatePlayerInfo() - //if the resample ratio is 0.5, then we're playing twice as fast - if (m_synctype == SYNC_RESAMPLE) - s << ", rr:" << fixed << setprecision(5) << 1.0 / m_resampleratio; -+ if (m_synctype == SYNC_PLLADJUST) -+ s << ", pll:" << fixed << setprecision(5) << 1.0 / m_plladjust; - - s << ", att:" << fixed << setprecision(1) << log(GetCurrentAttenuation()) * 20.0f << " dB"; - -@@ -627,8 +630,8 @@ void CDVDPlayerAudio::SetSyncType(bool passthrough) - - if (m_synctype != m_prevsynctype) - { -- const char *synctypes[] = {"clock feedback", "skip/duplicate", "resample", "invalid"}; -- int synctype = (m_synctype >= 0 && m_synctype <= 2) ? m_synctype : 3; -+ const char *synctypes[] = {"clock feedback", "skip/duplicate", "resample", "pll adjust", "invalid"}; -+ int synctype = (m_synctype >= 0 && m_synctype <= 3) ? m_synctype : 4; - CLog::Log(LOGDEBUG, "CDVDPlayerAudio:: synctype set to %i: %s", m_synctype, synctypes[synctype]); - m_prevsynctype = m_synctype; - } -@@ -702,6 +705,31 @@ void CDVDPlayerAudio::HandleSyncError(double duration) - } - m_resampleratio = 1.0 / m_pClock->GetClockSpeed() + proportional + m_integral; - } -+ else if (m_synctype == SYNC_PLLADJUST) -+ { -+#if defined(TARGET_RASPBERRY_PI) -+ //reset the integral on big errors, failsafe -+ if (fabs(m_error) > DVD_TIME_BASE) -+ m_integral = 0; -+ else if (fabs(m_error) > DVD_MSEC_TO_TIME(5)) -+ m_integral += m_error / DVD_TIME_BASE / INTEGRAL; -+ -+ double proportional = 0.0; -+ -+ //on big errors use more proportional -+ if (fabs(m_error / DVD_TIME_BASE) > 0.0) -+ { -+ double proportionaldiv = PROPORTIONAL * (PROPREF / fabs(m_error / DVD_TIME_BASE)); -+ if (proportionaldiv < PROPDIVMIN) proportionaldiv = PROPDIVMIN; -+ else if (proportionaldiv > PROPDIVMAX) proportionaldiv = PROPDIVMAX; -+ -+ proportional = m_error / DVD_TIME_BASE / proportionaldiv; -+ } -+ m_plladjust = 1.0 / m_pClock->GetClockSpeed() + proportional + m_integral; -+ double new_adjust = g_RBP.AdjustHDMIClock(m_plladjust); -+ CLog::Log(LOGDEBUG, "CDVDPlayerAudio::%s pll:%.4f (%.4f) proportional:%.4f integral:%.4f", __FUNCTION__, m_plladjust, new_adjust, proportional, m_integral); -+#endif -+ } - } - } - -@@ -740,6 +768,10 @@ bool CDVDPlayerAudio::OutputPacket(DVDAudioFrame &audioframe) - m_dvdAudio.SetResampleRatio(m_resampleratio); - m_dvdAudio.AddPackets(audioframe); - } -+ else if (m_synctype == SYNC_PLLADJUST) -+ { -+ m_dvdAudio.AddPackets(audioframe); -+ } - - return true; - } -diff --git a/xbmc/cores/dvdplayer/DVDPlayerAudio.h b/xbmc/cores/dvdplayer/DVDPlayerAudio.h -index e8b2ab6..02c64a0 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayerAudio.h -+++ b/xbmc/cores/dvdplayer/DVDPlayerAudio.h -@@ -232,6 +232,7 @@ class CDVDPlayerAudio : public CThread, public IDVDStreamPlayerAudio - bool m_prevskipped; - double m_maxspeedadjust; - double m_resampleratio; //resample ratio when using SYNC_RESAMPLE, used for the codec info -+ double m_plladjust; // for display using SYNC_PLLADJUST - - struct SInfo - { -diff --git a/xbmc/linux/RBP.cpp b/xbmc/linux/RBP.cpp -index 34866f6..95d82dc 100644 ---- a/xbmc/linux/RBP.cpp -+++ b/xbmc/linux/RBP.cpp -@@ -230,4 +230,17 @@ void CRBP::ResumeVideoOutput() - CLog::Log(LOGDEBUG, "Raspberry PI resuming video output\n"); - } - -+double CRBP::AdjustHDMIClock(double adjust) -+{ -+ char response[80]; -+ vc_gencmd(response, sizeof response, "hdmi_adjust_clock %f", adjust); -+ float new_adjust = 1.0f; -+ char *p = strchr(response, '='); -+ if (p) -+ new_adjust = atof(p+1); -+ CLog::Log(LOGDEBUG, "CRBP::%s(%.4f) = %.4f", __func__, adjust, new_adjust); -+ return new_adjust; -+} -+ -+ - #endif -diff --git a/xbmc/linux/RBP.h b/xbmc/linux/RBP.h -index f947acc..606c24f 100644 ---- a/xbmc/linux/RBP.h -+++ b/xbmc/linux/RBP.h -@@ -58,6 +58,7 @@ class CRBP - unsigned char *CaptureDisplay(int width, int height, int *stride, bool swap_red_blue, bool video_only = true); - DllOMX *GetDllOMX() { return m_OMX ? m_OMX->GetDll() : NULL; } - void WaitVsync(); -+ double AdjustHDMIClock(double adjust); - - void SuspendVideoOutput(); - void ResumeVideoOutput(); - -From aa32c326459a47802c5788cf057911a23a3be48c Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sat, 27 Sep 2014 15:32:37 +0100 -Subject: [PATCH 58/95] [dvdplayer] exerimental: don't raise priority of audio - thread - ---- - xbmc/cores/dvdplayer/DVDPlayer.cpp | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index 54e8548..8ed49c7 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayer.cpp -+++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -3201,7 +3201,11 @@ bool CDVDPlayer::OpenAudioStream(CDVDStreamInfo& hint, bool reset) - m_dvdPlayerAudio->SendMessage(new CDVDMsg(CDVDMsg::PLAYER_STARTED), 1); - - /* audio normally won't consume full cpu, so let it have prio */ -+#ifdef TARGET_RASPBERRY_PI -+ m_dvdPlayerAudio->SetPriority(GetPriority()); -+#else - m_dvdPlayerAudio->SetPriority(GetPriority()+1); -+#endif - return true; - } - - -From fa1b9f67ce0c75de4641a1baa7a3d127ec769906 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sun, 28 Sep 2014 19:28:17 +0100 -Subject: [PATCH 59/95] [mmalcodec] Introduce a preroll period to buffer up - frames on startup - ---- - .../DVDCodecs/Video/DVDVideoCodecMMAL.cpp | 5 ++++ - .../dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h | 1 + - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 30 +++++++++++++++++----- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 3 +++ - 4 files changed, 33 insertions(+), 6 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp -index 55b9969..262283d 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp -@@ -96,4 +96,9 @@ bool CDVDVideoCodecMMAL::GetCodecStats(double &pts, int &droppedPics) - return m_decoder->GetCodecStats(pts, droppedPics); - } - -+void CDVDVideoCodecMMAL::SetSpeed(int iSpeed) -+{ -+ m_decoder->SetSpeed(iSpeed); -+} -+ - #endif -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h -index 67aa505..a768e70 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h -@@ -42,6 +42,7 @@ class CDVDVideoCodecMMAL : public CDVDVideoCodec - virtual void SetDropState(bool bDrop); - virtual const char* GetName(void); - virtual bool GetCodecStats(double &pts, int &droppedPics); -+ virtual void SetSpeed(int iSpeed); - - protected: - MMALVideoPtr m_decoder; -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index 098910e..6742e0e 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -128,6 +128,8 @@ CMMALVideo::CMMALVideo() - m_output_busy = 0; - m_demux_queue_length = 0; - m_es_format = mmal_format_alloc(); -+ m_preroll = true; -+ m_speed = DVD_PLAYSPEED_NORMAL; - } - - CMMALVideo::~CMMALVideo() -@@ -696,6 +698,8 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVide - - m_drop_state = false; - m_startframe = false; -+ m_preroll = !m_hints.stills; -+ m_speed = DVD_PLAYSPEED_NORMAL; - - return true; - } -@@ -904,23 +908,29 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - break; - } - int ret = 0; -- if (!m_output_ready.empty()) -+ if (mmal_queue_length(m_dec_input_pool->queue) > 0 && !m_demux_queue_length) - { - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s - got space for output: demux_queue(%d) space(%d)", CLASSNAME, __func__, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size); -- ret |= VC_PICTURE; -+ ret |= VC_BUFFER; - } -- if (mmal_queue_length(m_dec_input_pool->queue) > 0 && !m_demux_queue_length) -+ else -+ m_preroll = false; -+ -+ if (m_preroll && m_output_ready.size() >= GetAllowedReferences()) -+ m_preroll = false; -+ -+ if (!m_output_ready.empty() && !m_preroll) - { - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s - got output picture:%d", CLASSNAME, __func__, m_output_ready.size()); -- ret |= VC_BUFFER; -+ ret |= VC_PICTURE; - } - if (!ret) - { - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s - Nothing to do: dts_queue(%d) ready_queue(%d) busy_queue(%d) demux_queue(%d) space(%d)", -- CLASSNAME, __func__, m_dts_queue.size(), m_output_ready.size(), m_output_busy, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size); -+ CLog::Log(LOGDEBUG, "%s::%s - Nothing to do: dts_queue(%d) ready_queue(%d) busy_queue(%d) demux_queue(%d) space(%d) preroll(%d)", -+ CLASSNAME, __func__, m_dts_queue.size(), m_output_ready.size(), m_output_busy, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size, m_preroll); - Sleep(10); // otherwise we busy spin - } - return ret; -@@ -963,8 +973,16 @@ void CMMALVideo::Reset(void) - m_decoderPts = DVD_NOPTS_VALUE; - m_droppedPics = 0; - m_decode_frame_number = 1; -+ m_preroll = !m_hints.stills && (m_speed == DVD_PLAYSPEED_NORMAL || m_speed == DVD_PLAYSPEED_PAUSE); - } - -+void CMMALVideo::SetSpeed(int iSpeed) -+{ -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s %d->%d", CLASSNAME, __func__, m_speed, iSpeed); -+ -+ m_speed = iSpeed; -+} - - void CMMALVideo::ReturnBuffer(CMMALVideoBuffer *buffer) - { -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -index b4aa571..4f81bbd 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -90,6 +90,7 @@ class CMMALVideo - virtual void SetDropState(bool bDrop); - virtual const char* GetName(void) { return (const char*)m_pFormatName; } - virtual bool GetCodecStats(double &pts, int &droppedPics); -+ virtual void SetSpeed(int iSpeed); - - // MMAL decoder callback routines. - void ReleaseBuffer(CMMALVideoBuffer *buffer); -@@ -140,6 +141,8 @@ class CMMALVideo - unsigned int m_decode_frame_number; - double m_decoderPts; - unsigned int m_droppedPics; -+ int m_speed; -+ bool m_preroll; - - MMAL_COMPONENT_T *m_dec; - MMAL_PORT_T *m_dec_input; - -From 63a48acfb32f6ec8a964d2cc95703737ac280c3c Mon Sep 17 00:00:00 2001 +From 01365a1a153af5fd844c25156923d61845993413 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 11 Apr 2014 16:12:27 +0100 -Subject: [PATCH 60/95] [omxplayer] Add ability to log more timestamp info in +Subject: [PATCH 079/102] [omxplayer] Add ability to log more timestamp info in extra debug settings --- @@ -6165,7 +7099,7 @@ Subject: [PATCH 60/95] [omxplayer] Add ability to log more timestamp info in 6 files changed, 25 insertions(+), 13 deletions(-) diff --git a/language/English/strings.po b/language/English/strings.po -index 77ad249..a4f02e5 100755 +index daa5446..71b3ebf 100755 --- a/language/English/strings.po +++ b/language/English/strings.po @@ -2892,6 +2892,11 @@ msgctxt "#680" @@ -6262,7 +7196,7 @@ index 66014d4..d305a07 100644 { // we are not running until something is cached in output device diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index 605318c9..783ac20 100644 +index 77b9461..9336ae5 100644 --- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp @@ -42,6 +42,7 @@ @@ -6289,10 +7223,10 @@ index 605318c9..783ac20 100644 || m_speed < 0) { diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index bc8598e..bd90dfe 100644 +index 5eca79a..f1d4be3 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp -@@ -1386,6 +1386,9 @@ void CAdvancedSettings::SettingOptionsLoggingComponentsFiller(const CSetting *se +@@ -1392,6 +1392,9 @@ void CAdvancedSettings::SettingOptionsLoggingComponentsFiller(const CSetting *se #ifdef HAVE_LIBCEC list.push_back(std::make_pair(g_localizeStrings.Get(679), LOGCEC)); #endif @@ -6303,10 +7237,10 @@ index bc8598e..bd90dfe 100644 void CAdvancedSettings::setExtraLogLevel(const std::vector &components) -From b94f1de5ca54f5e04bcf411118ad0019e800ebee Mon Sep 17 00:00:00 2001 +From 74febb4684abcbe0dcb1dbd06c22db4978c4252b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 23:13:55 +0100 -Subject: [PATCH 61/95] [omxplayer] Add ability to dump out audio/video data +Subject: [PATCH 080/102] [omxplayer] Add ability to dump out audio/video data for later debugging --- @@ -6318,7 +7252,7 @@ Subject: [PATCH 61/95] [omxplayer] Add ability to dump out audio/video data 5 files changed, 112 insertions(+) diff --git a/language/English/strings.po b/language/English/strings.po -index a4f02e5..86c0957 100755 +index 71b3ebf..83179a5 100755 --- a/language/English/strings.po +++ b/language/English/strings.po @@ -2897,6 +2897,16 @@ msgctxt "#697" @@ -6352,7 +7286,7 @@ index a3b6ba6..f01c83b 100644 #include "utils/params_check_macros.h" diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp -index 7c07b57..db03668 100644 +index ef4c3d4..6be2b76 100644 --- a/xbmc/cores/omxplayer/OMXAudio.cpp +++ b/xbmc/cores/omxplayer/OMXAudio.cpp @@ -55,6 +55,49 @@ using namespace std; @@ -6405,7 +7339,7 @@ index 7c07b57..db03668 100644 ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// -@@ -861,6 +904,7 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo +@@ -867,6 +910,7 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo memcpy((unsigned char *)omx_buffer->pBuffer, &m_wave_header, omx_buffer->nFilledLen); omx_buffer->nFlags = OMX_BUFFERFLAG_CODECCONFIG | OMX_BUFFERFLAG_ENDOFFRAME; @@ -6413,7 +7347,7 @@ index 7c07b57..db03668 100644 omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); if (omx_err != OMX_ErrorNone) { -@@ -893,6 +937,7 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo +@@ -899,6 +943,7 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo memcpy((unsigned char *)omx_buffer->pBuffer, m_extradata, omx_buffer->nFilledLen); omx_buffer->nFlags = OMX_BUFFERFLAG_CODECCONFIG | OMX_BUFFERFLAG_ENDOFFRAME; @@ -6421,7 +7355,7 @@ index 7c07b57..db03668 100644 omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); if (omx_err != OMX_ErrorNone) { -@@ -929,6 +974,8 @@ bool COMXAudio::Deinitialize() +@@ -935,6 +980,8 @@ bool COMXAudio::Deinitialize() { CSingleLock lock (m_critSection); @@ -6430,7 +7364,7 @@ index 7c07b57..db03668 100644 if ( m_omx_tunnel_clock_analog.IsInitialized() ) m_omx_tunnel_clock_analog.Deestablish(); if ( m_omx_tunnel_clock_hdmi.IsInitialized() ) -@@ -1217,6 +1264,7 @@ unsigned int COMXAudio::AddPackets(const void* data, unsigned int len, double dt +@@ -1223,6 +1270,7 @@ unsigned int COMXAudio::AddPackets(const void* data, unsigned int len, double dt int nRetry = 0; while(true) { @@ -6438,7 +7372,7 @@ index 7c07b57..db03668 100644 omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); if (omx_err == OMX_ErrorNone) { -@@ -1464,6 +1512,7 @@ void COMXAudio::SubmitEOS() +@@ -1470,6 +1518,7 @@ void COMXAudio::SubmitEOS() omx_buffer->nFlags = OMX_BUFFERFLAG_ENDOFFRAME | OMX_BUFFERFLAG_EOS | OMX_BUFFERFLAG_TIME_UNKNOWN; @@ -6447,7 +7381,7 @@ index 7c07b57..db03668 100644 if (omx_err != OMX_ErrorNone) { diff --git a/xbmc/cores/omxplayer/OMXVideo.cpp b/xbmc/cores/omxplayer/OMXVideo.cpp -index 45e942f..b483829 100644 +index dea0e11..b6bc525 100644 --- a/xbmc/cores/omxplayer/OMXVideo.cpp +++ b/xbmc/cores/omxplayer/OMXVideo.cpp @@ -65,6 +65,49 @@ @@ -6516,7 +7450,7 @@ index 45e942f..b483829 100644 m_omx_tunnel_clock.Deestablish(); m_omx_tunnel_decoder.Deestablish(); if(m_deinterlace) -@@ -807,6 +852,7 @@ int COMXVideo::Decode(uint8_t *pData, int iSize, double pts) +@@ -831,6 +876,7 @@ int COMXVideo::Decode(uint8_t *pData, int iSize, double pts) int nRetry = 0; while(true) { @@ -6524,7 +7458,7 @@ index 45e942f..b483829 100644 omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); if (omx_err == OMX_ErrorNone) { -@@ -937,6 +983,7 @@ void COMXVideo::SubmitEOS() +@@ -961,6 +1007,7 @@ void COMXVideo::SubmitEOS() omx_buffer->nFlags = OMX_BUFFERFLAG_ENDOFFRAME | OMX_BUFFERFLAG_EOS | OMX_BUFFERFLAG_TIME_UNKNOWN; @@ -6533,10 +7467,10 @@ index 45e942f..b483829 100644 if (omx_err != OMX_ErrorNone) { diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index bd90dfe..23e1df8 100644 +index f1d4be3..dc7835a 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp -@@ -1389,6 +1389,10 @@ void CAdvancedSettings::SettingOptionsLoggingComponentsFiller(const CSetting *se +@@ -1395,6 +1395,10 @@ void CAdvancedSettings::SettingOptionsLoggingComponentsFiller(const CSetting *se #ifdef TARGET_RASPBERRY_PI list.push_back(std::make_pair(g_localizeStrings.Get(697), LOGOMXPLAYER)); #endif @@ -6548,360 +7482,10 @@ index bd90dfe..23e1df8 100644 void CAdvancedSettings::setExtraLogLevel(const std::vector &components) -From 2f8d86a237eb3b293d2ddde98e10db6401ef2981 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 24 Sep 2014 23:13:52 +0100 -Subject: [PATCH 62/95] [audio] Add settings option to boost centre channel - when downmixing - -This allows a dB volume increase to be added to centre channel. -This can help improve dialgue in the presence of background music/effects. -It can go up to 30dB for testing purposes, but value of 6 is probably more reasonable. -It is recommended to ensure "Normalise levels on downmix" is enabled when boosting by large values to avoid clipping. - -Should work with Pi Sink (dvdplayer/paplayer) and omxplayer ---- - language/English/strings.po | 14 ++++++++++++++ - system/settings/settings.xml | 12 ++++++++++++ - .../Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp | 7 +++++++ - .../AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp | 6 ++++++ - xbmc/cores/omxplayer/OMXAudio.cpp | 6 ++++++ - 5 files changed, 45 insertions(+) - -diff --git a/language/English/strings.po b/language/English/strings.po -index 86c0957..6c9af9d 100755 ---- a/language/English/strings.po -+++ b/language/English/strings.po -@@ -16172,3 +16172,17 @@ msgstr "" - msgctxt "#38006" - msgid "Adjust PLL" - msgstr "" -+ -+#: system/settings/settings.xml -+msgctxt "#38007" -+msgid "Boost centre channel when downmixing" -+msgstr "" -+ -+#: system/settings/settings.xml -+msgctxt "#38008" -+msgid "Increase this value to make the dialogue louder compared to background sounds when downmixing multichannel audio" -+msgstr "" -+ -+#: system/settings/settings.xml -+msgctxt "#38009" -+msgid "%i dB" -diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index 0db66a2..dbddcb6 100644 ---- a/system/settings/settings.xml -+++ b/system/settings/settings.xml -@@ -2451,6 +2451,18 @@ - true - - -+ -+ 2 -+ 0 -+ -+ 0 -+ 1 -+ 30 -+ -+ -+ 38009 -+ -+ - - HAS_AE_QUALITY_LEVELS - 2 -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp -index de188e7..449a500 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp -@@ -20,6 +20,7 @@ - - #include "cores/AudioEngine/Utils/AEUtil.h" - #include "ActiveAEResampleFFMPEG.h" -+#include "settings/Settings.h" - #include "utils/log.h" - - extern "C" { -@@ -105,6 +106,12 @@ bool CActiveAEResampleFFMPEG::Init(uint64_t dst_chan_layout, int dst_channels, i - { - av_opt_set_double(m_pContext, "rematrix_maxval", 1.0, 0); - } -+ int boost_center = CSettings::Get().GetInt("audiooutput.boostcenter"); -+ if (boost_center) -+ { -+ float gain = pow(10.0f, ((float)(-3 + boost_center))/20.0f); -+ av_opt_set_double(m_pContext, "center_mix_level", gain, 0); -+ } - - if (remapLayout) - { -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp -index 96f79b7..84505bf 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp -@@ -162,6 +162,12 @@ bool CActiveAEResamplePi::Init(uint64_t dst_chan_layout, int dst_channels, int d - { - av_opt_set_double(m_pContext, "rematrix_maxval", 1.0, 0); - } -+ int boost_center = CSettings::Get().GetInt("audiooutput.boostcenter"); -+ if (boost_center) -+ { -+ float gain = pow(10.0f, ((float)(-3 + boost_center))/20.0f); -+ av_opt_set_double(m_pContext, "center_mix_level", gain, 0); -+ } - - if (remapLayout) - { -diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp -index db03668..6be2b76 100644 ---- a/xbmc/cores/omxplayer/OMXAudio.cpp -+++ b/xbmc/cores/omxplayer/OMXAudio.cpp -@@ -676,6 +676,12 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo - { - av_opt_set_double(m_pContext, "rematrix_maxval", 1.0, 0); - } -+ int boost_center = CSettings::Get().GetInt("audiooutput.boostcenter"); -+ if (boost_center) -+ { -+ float gain = pow(10.0f, ((float)(-3 + boost_center))/20.0f); -+ av_opt_set_double(m_pContext, "center_mix_level", gain, 0); -+ } - - // stereo upmix - if (upmix && m_src_channels == 2 && m_dst_channels > 2) - -From d9425a9f9292fe2522df60096771e058abe86649 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Fri, 3 Oct 2014 18:38:07 +0100 -Subject: [PATCH 63/95] [omxcore] Skip out of flush on error - ---- - xbmc/linux/OMXCore.cpp | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/xbmc/linux/OMXCore.cpp b/xbmc/linux/OMXCore.cpp -index 4ae29ba..4caa304 100644 ---- a/xbmc/linux/OMXCore.cpp -+++ b/xbmc/linux/OMXCore.cpp -@@ -419,7 +419,7 @@ void COMXCoreComponent::FlushAll() - - void COMXCoreComponent::FlushInput() - { -- if(!m_handle) -+ if(!m_handle || m_resource_error) - return; - - OMX_ERRORTYPE omx_err = OMX_ErrorNone; -@@ -436,7 +436,7 @@ void COMXCoreComponent::FlushInput() - - void COMXCoreComponent::FlushOutput() - { -- if(!m_handle) -+ if(!m_handle || m_resource_error) - return; - - OMX_ERRORTYPE omx_err = OMX_ErrorNone; - -From 3eebf317d49caadf15049ff2c65574b32ae5eead Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Fri, 3 Oct 2014 18:40:06 +0100 -Subject: [PATCH 64/95] [SinkPi] Handle multichannel layout more like OMXAudio - ---- - xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp -index 89684e4..fd9a03d 100644 ---- a/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp -+++ b/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp -@@ -92,9 +92,9 @@ static void SetAudioProps(bool stream_channels, uint32_t channel_map) - CLog::Log(LOGDEBUG, "%s:%s hdmi_stream_channels %d hdmi_channel_map %08x", CLASSNAME, __func__, stream_channels, channel_map); - } - --static uint32_t GetChannelMap(AEAudioFormat &format, bool passthrough) -+static uint32_t GetChannelMap(const CAEChannelInfo &channelLayout, bool passthrough) - { -- unsigned int channels = format.m_channelLayout.Count(); -+ unsigned int channels = channelLayout.Count(); - uint32_t channel_map = 0; - if (passthrough) - return 0; -@@ -133,12 +133,12 @@ static uint32_t GetChannelMap(AEAudioFormat &format, bool passthrough) - // According to CEA-861-D only RL and RR are known. In case of a format having SL and SR channels - // but no BR BL channels, we use the wide map in order to open only the num of channels really - // needed. -- if (format.m_channelLayout.HasChannel(AE_CH_BL) && !format.m_channelLayout.HasChannel(AE_CH_SL)) -+ if (channelLayout.HasChannel(AE_CH_BL) && !channelLayout.HasChannel(AE_CH_SL)) - map = map_back; - - for (unsigned int i = 0; i < channels; ++i) - { -- AEChannel c = format.m_channelLayout[i]; -+ AEChannel c = channelLayout[i]; - unsigned int chan = 0; - if ((unsigned int)c < sizeof map_normal / sizeof *map_normal) - chan = map[(unsigned int)c]; -@@ -169,9 +169,9 @@ static uint32_t GetChannelMap(AEAudioFormat &format, bool passthrough) - 0xff, // 7 - 0x13, // 7.1 - }; -- uint8_t cea = format.m_channelLayout.HasChannel(AE_CH_LFE) ? cea_map_lfe[channels] : cea_map[channels]; -+ uint8_t cea = channelLayout.HasChannel(AE_CH_LFE) ? cea_map_lfe[channels] : cea_map[channels]; - if (cea == 0xff) -- CLog::Log(LOGERROR, "%s::%s - Unexpected CEA mapping %d,%d", CLASSNAME, __func__, format.m_channelLayout.HasChannel(AE_CH_LFE), channels); -+ CLog::Log(LOGERROR, "%s::%s - Unexpected CEA mapping %d,%d", CLASSNAME, __func__, channelLayout.HasChannel(AE_CH_LFE), channels); - - channel_map |= cea << 24; - -@@ -208,7 +208,7 @@ bool CAESinkPi::Initialize(AEAudioFormat &format, std::string &device) - format.m_frames = format.m_sampleRate * AUDIO_PLAYBUFFER / NUM_OMX_BUFFERS; - format.m_frameSamples = format.m_frames * channels; - -- SetAudioProps(m_passthrough, GetChannelMap(format, m_passthrough)); -+ SetAudioProps(m_passthrough, GetChannelMap(format.m_channelLayout, m_passthrough)); - - m_format = format; - m_sinkbuffer_sec_per_byte = 1.0 / (double)(m_format.m_frameSize * m_format.m_sampleRate); - -From d240471c59f05186691621424ceb3e6fa15e322b Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sun, 5 Oct 2014 14:05:25 +0100 -Subject: [PATCH 65/95] [PiSink] Allow audio output latency to be set in - settings - ---- - language/English/strings.po | 15 +++++++++++++++ - system/settings/rbp.xml | 12 ++++++++++++ - xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp | 13 ++++++++----- - xbmc/cores/AudioEngine/Sinks/AESinkPi.h | 1 + - 4 files changed, 36 insertions(+), 5 deletions(-) - -diff --git a/language/English/strings.po b/language/English/strings.po -index 6c9af9d..2ef84d7 100755 ---- a/language/English/strings.po -+++ b/language/English/strings.po -@@ -16186,3 +16186,18 @@ msgstr "" - #: system/settings/settings.xml - msgctxt "#38009" - msgid "%i dB" -+ -+#: system/settings/rbp.xml -+msgctxt "#38012" -+msgid "Audio output latency" -+msgstr "" -+ -+#: system/settings/rbp.xml -+msgctxt "#38013" -+msgid "Increase this to protect against underruns, reduce to have lower latency gui sounds" -+msgstr "" -+ -+#: system/settings/rbp.xml -+msgctxt "#38014" -+msgid "%i ms" -+msgstr "" -diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml -index 79853a8..b8e6e59 100644 ---- a/system/settings/rbp.xml -+++ b/system/settings/rbp.xml -@@ -103,6 +103,18 @@ - - 101 - -+ -+ 3 -+ 100 -+ -+ 50 -+ 50 -+ 300 -+ -+ -+ 38014 -+ -+ - - - -diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp -index fd9a03d..484ce14 100644 ---- a/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp -+++ b/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp -@@ -34,7 +34,6 @@ - #define CLASSNAME "CAESinkPi" - - #define NUM_OMX_BUFFERS 2 --#define AUDIO_PLAYBUFFER (0.1) // 100ms - - static const unsigned int PassthroughSampleRates[] = { 8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000, 88200, 96000, 176400, 192000 }; - -@@ -42,6 +41,7 @@ CAEDeviceInfo CAESinkPi::m_info; - - CAESinkPi::CAESinkPi() : - m_sinkbuffer_sec_per_byte(0), -+ m_latency(0), - m_Initialized(false), - m_submitted(0), - m_omx_output(NULL) -@@ -189,6 +189,9 @@ bool CAESinkPi::Initialize(AEAudioFormat &format, std::string &device) - m_initDevice = device; - m_initFormat = format; - -+ m_latency = CSettings::Get().GetInt("audiooutput.latency") * 1e-3; -+ m_latency = std::max(m_latency, 50e-3); -+ - // analogue only supports stereo - if (CSettings::Get().GetString("audiooutput.audiodevice") == "PI:Analogue" || CSettings::Get().GetString("audiooutput.audiodevice") == "PI:Both") - { -@@ -205,7 +208,7 @@ bool CAESinkPi::Initialize(AEAudioFormat &format, std::string &device) - unsigned int sample_size = CAEUtil::DataFormatToBits(format.m_dataFormat) >> 3; - format.m_frameSize = sample_size * channels; - format.m_sampleRate = std::max(8000U, std::min(192000U, format.m_sampleRate)); -- format.m_frames = format.m_sampleRate * AUDIO_PLAYBUFFER / NUM_OMX_BUFFERS; -+ format.m_frames = format.m_sampleRate * m_latency / NUM_OMX_BUFFERS; - format.m_frameSamples = format.m_frames * channels; - - SetAudioProps(m_passthrough, GetChannelMap(format.m_channelLayout, m_passthrough)); -@@ -420,7 +423,7 @@ void CAESinkPi::GetDelay(AEDelayStatus& status) - - double CAESinkPi::GetCacheTotal() - { -- return AUDIO_PLAYBUFFER; -+ return m_latency; - } - - unsigned int CAESinkPi::AddPackets(uint8_t **data, unsigned int frames, unsigned int offset) -@@ -468,8 +471,8 @@ unsigned int CAESinkPi::AddPackets(uint8_t **data, unsigned int frames, unsigned - m_submitted++; - GetDelay(status); - delay = status.GetDelay(); -- if (delay > AUDIO_PLAYBUFFER) -- Sleep((int)(1000.0f * (delay - AUDIO_PLAYBUFFER))); -+ if (delay > m_latency) -+ Sleep((int)(1000.0f * (delay - m_latency))); - return frames; - } - -diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkPi.h b/xbmc/cores/AudioEngine/Sinks/AESinkPi.h -index 5c57999..cac5051 100644 ---- a/xbmc/cores/AudioEngine/Sinks/AESinkPi.h -+++ b/xbmc/cores/AudioEngine/Sinks/AESinkPi.h -@@ -53,6 +53,7 @@ class CAESinkPi : public IAESink - AEAudioFormat m_initFormat; - AEAudioFormat m_format; - double m_sinkbuffer_sec_per_byte; -+ double m_latency; - static CAEDeviceInfo m_info; - bool m_Initialized; - uint32_t m_submitted; - -From f371f28b5cf94aee7ce175743aaafcb740fe91df Mon Sep 17 00:00:00 2001 +From 999cf02013dade3b8839e0f682d9329f03c137d9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 18 Aug 2014 19:09:32 +0100 -Subject: [PATCH 66/95] rbp: Use new dispmanx function for vsync callbacks +Subject: [PATCH 081/102] rbp: Use new dispmanx function for vsync callbacks --- xbmc/linux/RBP.cpp | 85 ++++++++++++++----------- @@ -6910,7 +7494,7 @@ Subject: [PATCH 66/95] rbp: Use new dispmanx function for vsync callbacks 3 files changed, 52 insertions(+), 42 deletions(-) diff --git a/xbmc/linux/RBP.cpp b/xbmc/linux/RBP.cpp -index 95d82dc..8f46077 100644 +index 6514c2d..5ce7b0d 100644 --- a/xbmc/linux/RBP.cpp +++ b/xbmc/linux/RBP.cpp @@ -33,7 +33,7 @@ CRBP::CRBP() @@ -7113,10 +7697,10 @@ index 1529045..b6bf1fc 100644 } DLOG("CEGLNativeTypeRaspberryPI::DestroyDispmaxWindow\n"); -From 53dbd9f946f38a66265717ffedc35570cfa73faf Mon Sep 17 00:00:00 2001 +From d84f17ccadd74f3a6ba5bc9bc3edaa7967d8474f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 19 Aug 2014 17:56:45 +0100 -Subject: [PATCH 67/95] Revert "rbp: Use new dispmanx function for vsync +Subject: [PATCH 082/102] Revert "rbp: Use new dispmanx function for vsync callbacks" This reverts commit afbf8fbceaa6649fb4a6bbd9a1cee6087590412b. @@ -7127,7 +7711,7 @@ This reverts commit afbf8fbceaa6649fb4a6bbd9a1cee6087590412b. 3 files changed, 42 insertions(+), 52 deletions(-) diff --git a/xbmc/linux/RBP.cpp b/xbmc/linux/RBP.cpp -index 8f46077..f650662 100644 +index 5ce7b0d..602b4b1 100644 --- a/xbmc/linux/RBP.cpp +++ b/xbmc/linux/RBP.cpp @@ -33,7 +33,7 @@ CRBP::CRBP() @@ -7330,44 +7914,11 @@ index b6bf1fc..1529045 100644 } DLOG("CEGLNativeTypeRaspberryPI::DestroyDispmaxWindow\n"); -From 69a799899cba30325504daf18da175dbed49e48a Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Mon, 27 Oct 2014 15:23:51 +0000 -Subject: [PATCH 68/95] [rbp] Default extract thumbnails to false - -It can take 80 seconds for a single file on a Pi. It can cause crashes with out-of-memory errors. -It genereates a lot of support issues. Best to default to disabled and let users enable it if they must ---- - system/settings/rbp.xml | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml -index b8e6e59..40be71e 100644 ---- a/system/settings/rbp.xml -+++ b/system/settings/rbp.xml -@@ -62,6 +62,16 @@ - - - -+ -+ -+ -+ false -+ -+ -+ false -+ -+ -+ -
- -
- -From 46c0be1300c04391383e18d7d75d6712bd6ed3d4 Mon Sep 17 00:00:00 2001 +From 58902550684363c65d6c50b8cf958b1d19f283f8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Nov 2014 17:16:54 +0000 -Subject: [PATCH 70/95] Revert "[omxplayer] Add ability to dump out audio/video - data for later debugging" +Subject: [PATCH 083/102] Revert "[omxplayer] Add ability to dump out + audio/video data for later debugging" This reverts commit 417416bd29d00f1b42c77488d06e9e6840b8c4f4. --- @@ -7379,7 +7930,7 @@ This reverts commit 417416bd29d00f1b42c77488d06e9e6840b8c4f4. 5 files changed, 112 deletions(-) diff --git a/language/English/strings.po b/language/English/strings.po -index 022fc14..c3d8d64 100755 +index 83179a5..71b3ebf 100755 --- a/language/English/strings.po +++ b/language/English/strings.po @@ -2897,16 +2897,6 @@ msgctxt "#697" @@ -7508,7 +8059,7 @@ index 6be2b76..ef4c3d4 100644 if (omx_err != OMX_ErrorNone) { diff --git a/xbmc/cores/omxplayer/OMXVideo.cpp b/xbmc/cores/omxplayer/OMXVideo.cpp -index b483829..45e942f 100644 +index b6bc525..dea0e11 100644 --- a/xbmc/cores/omxplayer/OMXVideo.cpp +++ b/xbmc/cores/omxplayer/OMXVideo.cpp @@ -65,49 +65,6 @@ @@ -7577,7 +8128,7 @@ index b483829..45e942f 100644 m_omx_tunnel_clock.Deestablish(); m_omx_tunnel_decoder.Deestablish(); if(m_deinterlace) -@@ -852,7 +807,6 @@ int COMXVideo::Decode(uint8_t *pData, int iSize, double pts) +@@ -876,7 +831,6 @@ int COMXVideo::Decode(uint8_t *pData, int iSize, double pts) int nRetry = 0; while(true) { @@ -7585,7 +8136,7 @@ index b483829..45e942f 100644 omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); if (omx_err == OMX_ErrorNone) { -@@ -983,7 +937,6 @@ void COMXVideo::SubmitEOS() +@@ -1007,7 +961,6 @@ void COMXVideo::SubmitEOS() omx_buffer->nFlags = OMX_BUFFERFLAG_ENDOFFRAME | OMX_BUFFERFLAG_EOS | OMX_BUFFERFLAG_TIME_UNKNOWN; @@ -7594,10 +8145,10 @@ index b483829..45e942f 100644 if (omx_err != OMX_ErrorNone) { diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index 23e1df8..bd90dfe 100644 +index dc7835a..f1d4be3 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp -@@ -1389,10 +1389,6 @@ void CAdvancedSettings::SettingOptionsLoggingComponentsFiller(const CSetting *se +@@ -1395,10 +1395,6 @@ void CAdvancedSettings::SettingOptionsLoggingComponentsFiller(const CSetting *se #ifdef TARGET_RASPBERRY_PI list.push_back(std::make_pair(g_localizeStrings.Get(697), LOGOMXPLAYER)); #endif @@ -7609,10 +8160,10 @@ index 23e1df8..bd90dfe 100644 void CAdvancedSettings::setExtraLogLevel(const std::vector &components) -From e855fdc74db315478758c8bf42a2652215b848c3 Mon Sep 17 00:00:00 2001 +From e379a7e8f08661a5a02ca1aa1af6a0128b6075e1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 23:13:55 +0100 -Subject: [PATCH 71/95] [omxplayer] Add ability to dump out audio/video data +Subject: [PATCH 084/102] [omxplayer] Add ability to dump out audio/video data for later debugging --- @@ -7623,7 +8174,7 @@ Subject: [PATCH 71/95] [omxplayer] Add ability to dump out audio/video data 4 files changed, 79 insertions(+) diff --git a/language/English/strings.po b/language/English/strings.po -index c3d8d64..022fc14 100755 +index 71b3ebf..83179a5 100755 --- a/language/English/strings.po +++ b/language/English/strings.po @@ -2897,6 +2897,16 @@ msgctxt "#697" @@ -7657,7 +8208,7 @@ index a3b6ba6..f01c83b 100644 #include "utils/params_check_macros.h" diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index 8ed49c7..171e3d2 100644 +index 67cdefc..7662730 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp @@ -95,6 +95,61 @@ @@ -7722,7 +8273,7 @@ index 8ed49c7..171e3d2 100644 void CSelectionStreams::Clear(StreamType type, StreamSource source) { CSingleLock lock(m_section); -@@ -936,6 +991,12 @@ bool CDVDPlayer::ReadPacket(DemuxPacket*& packet, CDemuxStream*& stream) +@@ -938,6 +993,12 @@ bool CDVDPlayer::ReadPacket(DemuxPacket*& packet, CDemuxStream*& stream) return true; } @@ -7735,7 +8286,7 @@ index 8ed49c7..171e3d2 100644 UpdateCorrection(packet, m_offset_pts); if(packet->iStreamId < 0) -@@ -3319,6 +3380,8 @@ bool CDVDPlayer::CloseStream(CCurrentStream& current, bool bWaitForBuffers) +@@ -3324,6 +3385,8 @@ bool CDVDPlayer::CloseStream(CCurrentStream& current, bool bWaitForBuffers) if(bWaitForBuffers) SetCaching(CACHESTATE_DONE); @@ -7745,10 +8296,10 @@ index 8ed49c7..171e3d2 100644 if(player) player->CloseStream(bWaitForBuffers); diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index bd90dfe..23e1df8 100644 +index f1d4be3..dc7835a 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp -@@ -1389,6 +1389,10 @@ void CAdvancedSettings::SettingOptionsLoggingComponentsFiller(const CSetting *se +@@ -1395,6 +1395,10 @@ void CAdvancedSettings::SettingOptionsLoggingComponentsFiller(const CSetting *se #ifdef TARGET_RASPBERRY_PI list.push_back(std::make_pair(g_localizeStrings.Get(697), LOGOMXPLAYER)); #endif @@ -7760,303 +8311,10 @@ index bd90dfe..23e1df8 100644 void CAdvancedSettings::setExtraLogLevel(const std::vector &components) -From a2655a880b12c5b67ec22041dfcf877a1d89f914 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Tue, 11 Nov 2014 18:14:23 +0000 -Subject: [PATCH 74/95] [resamplepi] Try to report the same numbers as ffmpeg - ---- - .../cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp | 11 ++++++----- - 1 file changed, 6 insertions(+), 5 deletions(-) - -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp -index 84505bf..2b5bef2 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp -@@ -544,9 +544,10 @@ int CActiveAEResamplePi::Resample(uint8_t **dst_buffer, int dst_samples, uint8_t - - int64_t CActiveAEResamplePi::GetDelay(int64_t base) - { -- int ret = m_dst_rate ? 1000 * GetBufferedSamples() / m_dst_rate : 0; -+ int64_t ret = av_rescale_rnd(GetBufferedSamples(), m_dst_rate, base, AV_ROUND_UP); -+ - #ifdef DEBUG_VERBOSE -- CLog::Log(LOGINFO, "%s::%s = %d", CLASSNAME, __func__, ret); -+ CLog::Log(LOGINFO, "%s::%s = %d", CLASSNAME, __func__, (int)ret); - #endif - return ret; - } -@@ -567,7 +568,7 @@ int CActiveAEResamplePi::GetBufferedSamples() - - int CActiveAEResamplePi::CalcDstSampleCount(int src_samples, int dst_rate, int src_rate) - { -- int ret = ((long long)src_samples * dst_rate + src_rate-1) / src_rate; -+ int ret = av_rescale_rnd(src_samples, dst_rate, src_rate, AV_ROUND_UP); - #ifdef DEBUG_VERBOSE - CLog::Log(LOGINFO, "%s::%s = %d", CLASSNAME, __func__, ret); - #endif -@@ -576,7 +577,7 @@ int CActiveAEResamplePi::CalcDstSampleCount(int src_samples, int dst_rate, int s - - int CActiveAEResamplePi::GetSrcBufferSize(int samples) - { -- int ret = 0; -+ int ret = av_samples_get_buffer_size(NULL, m_src_channels, samples, m_src_fmt, 1); - #ifdef DEBUG_VERBOSE - CLog::Log(LOGINFO, "%s::%s = %d", CLASSNAME, __func__, ret); - #endif -@@ -585,7 +586,7 @@ int CActiveAEResamplePi::GetSrcBufferSize(int samples) - - int CActiveAEResamplePi::GetDstBufferSize(int samples) - { -- int ret = CalcDstSampleCount(samples, m_dst_rate, m_src_rate); -+ int ret = av_samples_get_buffer_size(NULL, m_dst_channels, samples, m_dst_fmt, 1); - #ifdef DEBUG_VERBOSE - CLog::Log(LOGINFO, "%s::%s = %d", CLASSNAME, __func__, ret); - #endif - -From 7d92f48231fbc4c741b1ffe5f329f8c67914d9a7 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Tue, 11 Nov 2014 20:49:30 +0000 -Subject: [PATCH 75/95] [dvdplayer] New scheme for PLL adjustment for video - clock - ---- - xbmc/cores/dvdplayer/DVDPlayerAudio.cpp | 40 +++++++++++++-------------------- - xbmc/cores/dvdplayer/DVDPlayerAudio.h | 2 ++ - 2 files changed, 18 insertions(+), 24 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp b/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp -index 5e9a6d3..3e6d0ee 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp -+++ b/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp -@@ -113,7 +113,9 @@ CDVDPlayerAudio::CDVDPlayerAudio(CDVDClock* pClock, CDVDMessageQueue& parent) - m_started = false; - m_silence = false; - m_resampleratio = 1.0; -- m_plladjust = 1.0f; -+ m_plladjust = 1.0; -+ m_last_plladjust = 1.0; -+ m_last_error = 0.0; - m_synctype = SYNC_DISCON; - m_setsynctype = SYNC_DISCON; - m_prevsynctype = -1; -@@ -192,6 +194,8 @@ void CDVDPlayerAudio::OpenStream( CDVDStreamInfo &hints, CDVDAudioCodec* codec ) - - m_error = 0; - m_errors.Flush(); -+ m_plladjust = 1.0; -+ m_last_plladjust = 1.0; - m_integral = 0; - m_prevskipped = false; - m_syncclock = true; -@@ -234,7 +238,6 @@ void CDVDPlayerAudio::CloseStream(bool bWaitForBuffers) - - // uninit queue - m_messageQueue.End(); -- - CLog::Log(LOGNOTICE, "Deleting audio codec"); - if (m_pAudioCodec) - { -@@ -475,9 +478,11 @@ void CDVDPlayerAudio::UpdatePlayerInfo() - //print the inverse of the resample ratio, since that makes more sense - //if the resample ratio is 0.5, then we're playing twice as fast - if (m_synctype == SYNC_RESAMPLE) -- s << ", rr:" << fixed << setprecision(5) << 1.0 / m_resampleratio; -+ s << ", rr:" << fixed << setprecision(5) << 1.0 / m_resampleratio << ", err:" << fixed << setprecision(1) << m_last_error * 1e-3 << "ms"; -+ if (m_synctype == SYNC_SKIPDUP) -+ s << ", err:" << fixed << setprecision(1) << m_last_error * 1e-3 << "ms"; - if (m_synctype == SYNC_PLLADJUST) -- s << ", pll:" << fixed << setprecision(5) << 1.0 / m_plladjust; -+ s << ", pll:" << fixed << setprecision(5) << m_last_plladjust << ", err:" << fixed << setprecision(1) << m_last_error * 1e-3 << "ms"; - - s << ", att:" << fixed << setprecision(1) << log(GetCurrentAttenuation()) * 20.0f << " dB"; - -@@ -651,6 +656,7 @@ void CDVDPlayerAudio::HandleSyncError(double duration) - m_pClock->Update(clock+error, absolute, 0.0, "CDVDPlayerAudio::HandleSyncError1"); - m_errors.Flush(); - m_error = 0; -+ m_plladjust = 1.0; - m_syncclock = false; - - return; -@@ -704,32 +710,18 @@ void CDVDPlayerAudio::HandleSyncError(double duration) - proportional = m_error / DVD_TIME_BASE / proportionaldiv; - } - m_resampleratio = 1.0 / m_pClock->GetClockSpeed() + proportional + m_integral; -+ CLog::Log(LOGDEBUG, "CDVDPlayerAudio::%s rr:%.5f error:%.3fms", __FUNCTION__, m_resampleratio, m_error * 1e-3); - } - else if (m_synctype == SYNC_PLLADJUST) - { - #if defined(TARGET_RASPBERRY_PI) -- //reset the integral on big errors, failsafe -- if (fabs(m_error) > DVD_TIME_BASE) -- m_integral = 0; -- else if (fabs(m_error) > DVD_MSEC_TO_TIME(5)) -- m_integral += m_error / DVD_TIME_BASE / INTEGRAL; -- -- double proportional = 0.0; -- -- //on big errors use more proportional -- if (fabs(m_error / DVD_TIME_BASE) > 0.0) -- { -- double proportionaldiv = PROPORTIONAL * (PROPREF / fabs(m_error / DVD_TIME_BASE)); -- if (proportionaldiv < PROPDIVMIN) proportionaldiv = PROPDIVMIN; -- else if (proportionaldiv > PROPDIVMAX) proportionaldiv = PROPDIVMAX; -- -- proportional = m_error / DVD_TIME_BASE / proportionaldiv; -- } -- m_plladjust = 1.0 / m_pClock->GetClockSpeed() + proportional + m_integral; -- double new_adjust = g_RBP.AdjustHDMIClock(m_plladjust); -- CLog::Log(LOGDEBUG, "CDVDPlayerAudio::%s pll:%.4f (%.4f) proportional:%.4f integral:%.4f", __FUNCTION__, m_plladjust, new_adjust, proportional, m_integral); -+ double e = std::max(std::min(m_error, DVD_MSEC_TO_TIME(10)), -DVD_MSEC_TO_TIME(10)); -+ m_plladjust = 1.0 + e * 1.5e-8; -+ m_last_plladjust = g_RBP.AdjustHDMIClock(m_plladjust); -+ CLog::Log(LOGDEBUG, "CDVDPlayerAudio::%s pll:%.5f (%.5f) error:%.6f e:%.6f", __FUNCTION__, m_plladjust, m_last_plladjust, m_error, e * 1.5e-8 ); - #endif - } -+ m_last_error = m_error; - } - } - -diff --git a/xbmc/cores/dvdplayer/DVDPlayerAudio.h b/xbmc/cores/dvdplayer/DVDPlayerAudio.h -index 02c64a0..37bf4bd 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayerAudio.h -+++ b/xbmc/cores/dvdplayer/DVDPlayerAudio.h -@@ -233,6 +233,8 @@ class CDVDPlayerAudio : public CThread, public IDVDStreamPlayerAudio - double m_maxspeedadjust; - double m_resampleratio; //resample ratio when using SYNC_RESAMPLE, used for the codec info - double m_plladjust; // for display using SYNC_PLLADJUST -+ double m_last_error; // for display using SYNC_PLLADJUST -+ double m_last_plladjust; // for display using SYNC_PLLADJUST - - struct SInfo - { - -From 2c88cf7b74a5f16a3451fa9bcc7e8349b5809117 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sat, 15 Nov 2014 12:03:34 +0000 -Subject: [PATCH 76/95] [dvdplayer] Add lock for player creation - ---- - xbmc/cores/dvdplayer/DVDPlayer.cpp | 3 +++ - xbmc/cores/dvdplayer/DVDPlayer.h | 1 + - 2 files changed, 4 insertions(+) - -diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index 171e3d2..cc54480 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayer.cpp -+++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -549,6 +549,7 @@ void CSelectionStreams::Update(CDVDInputStream* input, CDVDDemux* demuxer, std:: - - void CDVDPlayer::CreatePlayers() - { -+ CSingleLock lock(m_players_lock); - #ifdef HAS_OMXPLAYER - if (m_omxplayer_mode && OMXPlayerUnsuitable(m_HasVideo, m_HasAudio, m_pDemuxer, m_pInputStream, m_SelectionStreams)) - { -@@ -578,6 +579,7 @@ void CDVDPlayer::CreatePlayers() - - void CDVDPlayer::DestroyPlayers() - { -+ CSingleLock lock(m_players_lock); - if (!m_players_created) - return; - delete m_dvdPlayerVideo; -@@ -4069,6 +4071,7 @@ double CDVDPlayer::GetQueueTime() - - void CDVDPlayer::GetVideoStreamInfo(SPlayerVideoStreamInfo &info) - { -+ CSingleLock lock(m_players_lock); - info.bitrate = m_dvdPlayerVideo->GetVideoBitrate(); - - std::string retVal; -diff --git a/xbmc/cores/dvdplayer/DVDPlayer.h b/xbmc/cores/dvdplayer/DVDPlayer.h -index ef64076..7ea6ea6 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayer.h -+++ b/xbmc/cores/dvdplayer/DVDPlayer.h -@@ -554,4 +554,5 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer - // omxplayer variables - struct SOmxPlayerState m_OmxPlayerState; - bool m_omxplayer_mode; // using omxplayer acceleration -+ CCriticalSection m_players_lock; - }; - -From c8b1d486cfa7613dca166949c35f071adc89fe5a Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 19 Nov 2014 13:29:43 +0000 -Subject: [PATCH 77/95] [dvdplayeraudio] Add advancedsetting for configuring - max pll adjustment - ---- - xbmc/cores/dvdplayer/DVDPlayerAudio.cpp | 8 +++++--- - xbmc/settings/AdvancedSettings.cpp | 2 ++ - xbmc/settings/AdvancedSettings.h | 1 + - 3 files changed, 8 insertions(+), 3 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp b/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp -index 3e6d0ee..a1b6f4d 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp -+++ b/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp -@@ -25,6 +25,7 @@ - #include "DVDCodecs/DVDCodecs.h" - #include "DVDCodecs/DVDFactoryCodec.h" - #include "settings/Settings.h" -+#include "settings/AdvancedSettings.h" - #include "video/VideoReferenceClock.h" - #include "utils/log.h" - #include "utils/TimeUtils.h" -@@ -715,10 +716,11 @@ void CDVDPlayerAudio::HandleSyncError(double duration) - else if (m_synctype == SYNC_PLLADJUST) - { - #if defined(TARGET_RASPBERRY_PI) -- double e = std::max(std::min(m_error, DVD_MSEC_TO_TIME(10)), -DVD_MSEC_TO_TIME(10)); -- m_plladjust = 1.0 + e * 1.5e-8; -+ double e = std::max(std::min(m_error / DVD_MSEC_TO_TIME(10), 1.0), -1.0); -+ double adjust = g_advancedSettings.m_maxPllAdjust * 1e-6; -+ m_plladjust = 1.0 + e * adjust; - m_last_plladjust = g_RBP.AdjustHDMIClock(m_plladjust); -- CLog::Log(LOGDEBUG, "CDVDPlayerAudio::%s pll:%.5f (%.5f) error:%.6f e:%.6f", __FUNCTION__, m_plladjust, m_last_plladjust, m_error, e * 1.5e-8 ); -+ CLog::Log(LOGDEBUG, "CDVDPlayerAudio::%s pll:%.5f (%.5f) error:%.6f e:%.6f a:%f", __FUNCTION__, m_plladjust, m_last_plladjust, m_error, e * adjust, adjust ); - #endif - } - m_last_error = m_error; -diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index 23e1df8..f7668e3 100644 ---- a/xbmc/settings/AdvancedSettings.cpp -+++ b/xbmc/settings/AdvancedSettings.cpp -@@ -108,6 +108,7 @@ void CAdvancedSettings::Initialize() - - m_audioHeadRoom = 0; - m_ac3Gain = 12.0f; -+ m_maxPllAdjust = 300; - m_audioApplyDrc = true; - m_dvdplayerIgnoreDTSinWAV = false; - -@@ -480,6 +481,7 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file) - if (pElement) - { - XMLUtils::GetFloat(pElement, "ac3downmixgain", m_ac3Gain, -96.0f, 96.0f); -+ XMLUtils::GetInt(pElement, "maxplladjust", m_maxPllAdjust, 0, 1000000); - XMLUtils::GetInt(pElement, "headroom", m_audioHeadRoom, 0, 12); - XMLUtils::GetString(pElement, "defaultplayer", m_audioDefaultPlayer); - // 101 on purpose - can be used to never automark as watched -diff --git a/xbmc/settings/AdvancedSettings.h b/xbmc/settings/AdvancedSettings.h -index fb5a837..0b2666f 100644 ---- a/xbmc/settings/AdvancedSettings.h -+++ b/xbmc/settings/AdvancedSettings.h -@@ -137,6 +137,7 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler - - int m_audioHeadRoom; - float m_ac3Gain; -+ int m_maxPllAdjust; - CStdString m_audioDefaultPlayer; - float m_audioPlayCountMinimumPercent; - bool m_dvdplayerIgnoreDTSinWAV; - -From 9581b206f8a06621a965f6c899a691edae294ee6 Mon Sep 17 00:00:00 2001 +From 5004d81176b3f5ae1d24d17bf6ab32089301883b Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Wed, 19 Nov 2014 14:22:01 +0100 -Subject: [PATCH 78/95] dvdplayer: fix audio error at beginning of playback +Subject: [PATCH 085/102] dvdplayer: fix audio error at beginning of playback --- xbmc/cores/dvdplayer/DVDAudio.cpp | 90 ++++++--------------------------- @@ -8271,51 +8529,10 @@ index 37bf4bd..f9f19bc 100644 double GetCurrentPts() { CSingleLock lock(m_info_section); return m_info.pts; } -From a78fb25af9532625f2beedd947b2a5e106a8898e Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 19 Nov 2014 17:35:44 +0000 -Subject: [PATCH 79/95] [mmalrender] Skip some log message in bypass mode - ---- - xbmc/cores/VideoRenderers/MMALRenderer.cpp | 9 ++++++--- - 1 file changed, 6 insertions(+), 3 deletions(-) - -diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -index 03a05de..c0ff30d 100644 ---- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp -+++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -@@ -298,6 +298,9 @@ int CMMALRenderer::GetImage(YV12Image *image, int source, bool readonly) - - void CMMALRenderer::ReleaseBuffer(int idx) - { -+ if (!m_bConfigured || m_format == RENDER_FMT_BYPASS) -+ return; -+ - #if defined(MMAL_DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, "%s::%s - %d", CLASSNAME, __func__, idx); - #endif -@@ -366,13 +369,13 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha) - - void CMMALRenderer::FlipPage(int source) - { -+ if (!m_bConfigured || m_format == RENDER_FMT_BYPASS) -+ return; -+ - #if defined(MMAL_DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, "%s::%s - %d", CLASSNAME, __func__, source); - #endif - -- if (!m_bConfigured || m_format == RENDER_FMT_BYPASS) -- return; -- - YUVBUFFER *buffer = &m_buffers[source]; - // we only want to upload frames once - if (buffer->flipindex++) - -From 168bde3461bb125e78e458787bf86200252b58b6 Mon Sep 17 00:00:00 2001 +From 368a98bdc365a6f805cf979bfda14ad373d378ae Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 19 Nov 2014 20:57:10 +0000 -Subject: [PATCH 80/95] [dvdplayeraudio] Remove logging message +Subject: [PATCH 086/102] [dvdplayeraudio] Remove logging message --- xbmc/cores/dvdplayer/DVDPlayerAudio.cpp | 2 +- @@ -8335,10 +8552,10 @@ index 36f70e8..fcd2e88 100644 if( (fabs(error) > DVD_MSEC_TO_TIME(100) || m_syncclock) && (master == MASTER_CLOCK_AUDIO -From 2696d06068fed149a9c115130b7e063b6992e318 Mon Sep 17 00:00:00 2001 +From 8c2f3632e5f2a0fbe3670219b61f8ab342a4c0ad Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Mon, 30 Jun 2014 00:19:21 +0200 -Subject: [PATCH 81/95] gl: avoid grabbing viewport on each render +Subject: [PATCH 087/102] gl: avoid grabbing viewport on each render Same as 518556b45b61de06a0bc810147cd1a6347497461 but for GL --- @@ -8421,10 +8638,10 @@ index 58840c4..c01f129 100644 void CRenderSystemGL::SetScissors(const CRect &rect) -From e7fa7da305fb00c089126afb4d4ff22c47234342 Mon Sep 17 00:00:00 2001 +From bc38e82b95d88a7f84a46bdc9fe188da6068556d Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Fri, 21 Nov 2014 00:15:49 +0100 -Subject: [PATCH 82/95] GL: switch to CPU based matrix caculations to match +Subject: [PATCH 088/102] GL: switch to CPU based matrix caculations to match GLES This drops use of glGet which causes a performance hit on some systems since @@ -8804,10 +9021,10 @@ index 28d4b78..624ddef 100644 }; -From d99b67182e53e84a36b9c34ac89c6b4b1cf6c479 Mon Sep 17 00:00:00 2001 +From cdd93978bd6310bbd21319608b4a65bba65a3009 Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Fri, 21 Nov 2014 01:47:07 +0100 -Subject: [PATCH 83/95] GL(ES): Simplify matrix stack handling +Subject: [PATCH 089/102] GL(ES): Simplify matrix stack handling --- xbmc/cores/VideoRenderers/LinuxRendererGL.cpp | 47 ++++------ @@ -9739,10 +9956,10 @@ index d2f9cd1..de5ab64 100644 }; -From 1188cd52006540a993317e3bdb6ac376fe02ed3e Mon Sep 17 00:00:00 2001 +From 56cb54bce7ae1d50a107a4b8b627d7c5e375b764 Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Fri, 21 Nov 2014 17:10:00 +0100 -Subject: [PATCH 84/95] fixup! GL(ES): Simplify matrix stack handling +Subject: [PATCH 090/102] fixup! GL(ES): Simplify matrix stack handling --- xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp | 4 ++-- @@ -9766,10 +9983,10 @@ index d1b46a3..0bec937 100644 CRect viewport(0, 0, m_sourceWidth, m_sourceHeight); -From 4431908db68ea4f9b3a88120df55677b2ffd6285 Mon Sep 17 00:00:00 2001 +From 9bb85930187edfd949dfd7aaec35a6e089368d96 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 21 Nov 2014 19:17:25 +0000 -Subject: [PATCH 85/95] squash: Fixup build after glGet +Subject: [PATCH 091/102] squash: Fixup build after glGet --- xbmc/guilib/GUIFontTTFGL.cpp | 11 +++++------ @@ -9809,11 +10026,11 @@ index 812662c..39c6936 100644 glBindBuffer(GL_ARRAY_BUFFER, 0); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); -From 01e4af29076a10199c33dc621ce14f44fc4821ea Mon Sep 17 00:00:00 2001 +From afcb8601120ce5d21abbd4545a9b91a6027dfd9f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 24 Nov 2014 16:06:54 +0000 -Subject: [PATCH 86/95] [MMALCoded] Call port settings changed from callback to - avoid thread unsafe code +Subject: [PATCH 092/102] [MMALCoded] Call port settings changed from callback + to avoid thread unsafe code --- xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 26 +++++----------------- @@ -9821,7 +10038,7 @@ Subject: [PATCH 86/95] [MMALCoded] Call port settings changed from callback to 2 files changed, 6 insertions(+), 23 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index 6742e0e..ac7a263 100644 +index dd08c95..6ce648c 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp @@ -57,7 +57,6 @@ CMMALVideoBuffer::CMMALVideoBuffer(CMMALVideo *omv) @@ -9905,7 +10122,7 @@ index 6742e0e..ac7a263 100644 EINTERLACEMETHOD interlace_method = g_renderManager.AutoInterlaceMethod(CMediaSettings::Get().GetCurrentVideoSettings().m_InterlaceMethod); diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -index 4f81bbd..2eaea95 100644 +index 79a4bfd..ea64276 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h @@ -57,7 +57,6 @@ class CMMALVideoBuffer @@ -9926,18 +10143,18 @@ index 4f81bbd..2eaea95 100644 protected: void QueryCodec(void); -From ca03d92b00991335b1f9c8d1a5d9b6eadbb371a8 Mon Sep 17 00:00:00 2001 +From aeeeed2928477d6e1ad8b57d5bf5abc7302cf171 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 24 Nov 2014 21:24:25 +0000 -Subject: [PATCH 87/95] [mmalcodec] Avoid double framerate deinterlace for dvd - menus for now +Subject: [PATCH 093/102] [mmalcodec] Avoid double framerate deinterlace for + dvd menus for now --- xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index ac7a263..1894782 100644 +index 6ce648c..995c2f8 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp @@ -361,7 +361,7 @@ bool CMMALVideo::CreateDeinterlace(EINTERLACEMETHOD interlace_method) @@ -9950,90 +10167,10 @@ index ac7a263..1894782 100644 if (status != MMAL_SUCCESS) { -From a906703777dc206e2688af1ad6865096d5a068eb Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Mon, 24 Nov 2014 22:07:25 +0000 -Subject: [PATCH 88/95] [dvdplayervideo] Prod decoder when in stills mode - -An asynchronous hardware decoder doesn't only produce output pictures when new packets arrive. -In dvd stills mode give it a chance to return pictures that weren't ready when frame was decoded. ---- - xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 46 ++++++++++++++++++++------------- - 1 file changed, 28 insertions(+), 18 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index f030e37..7a8fc10 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -+++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -324,7 +324,8 @@ void CDVDPlayerVideo::Process() - - while (!m_bStop) - { -- int iQueueTimeOut = (int)(m_stalled ? frametime / 4 : frametime * 10) / 1000; -+ bool bPictureWaiting = m_hints.stills && (m_pVideoCodec->Decode(NULL, 0, DVD_NOPTS_VALUE, DVD_NOPTS_VALUE) & VC_PICTURE); -+ int iQueueTimeOut = (int)(bPictureWaiting ? 0 : (m_hints.stills || m_stalled) ? frametime / 4 : frametime * 10) / 1000; - int iPriority = (m_speed == DVD_PLAYSPEED_PAUSE && m_started) ? 1 : 0; - - CDVDMsg* pMsg; -@@ -341,27 +342,36 @@ void CDVDPlayerVideo::Process() - if( iPriority ) - continue; - -- //Okey, start rendering at stream fps now instead, we are likely in a stillframe -- if( !m_stalled ) -+ // check for picture waiting -+ if (bPictureWaiting) - { -- if(m_started) -- CLog::Log(LOGINFO, "CDVDPlayerVideo - Stillframe detected, switching to forced %f fps", m_fFrameRate); -- m_stalled = true; -- pts+= frametime*4; -+ // create a dummy demuxer packet to prod the decode logic -+ pMsg = new CDVDMsgDemuxerPacket(CDVDDemuxUtils::AllocateDemuxPacket(0), false); - } -- -- //Waiting timed out, output last picture -- if( picture.iFlags & DVP_FLAG_ALLOCATED ) -+ else - { -- //Remove interlaced flag before outputting -- //no need to output this as if it was interlaced -- picture.iFlags &= ~DVP_FLAG_INTERLACED; -- picture.iFlags |= DVP_FLAG_NOSKIP; -- OutputPicture(&picture, pts); -- pts+= frametime; -- } -+ //Okey, start rendering at stream fps now instead, we are likely in a stillframe -+ if( !m_stalled ) -+ { -+ if(m_started) -+ CLog::Log(LOGINFO, "CDVDPlayerVideo - Stillframe detected, switching to forced %f fps", m_fFrameRate); -+ m_stalled = true; -+ pts+= frametime*4; -+ } - -- continue; -+ //Waiting timed out, output last picture -+ if( picture.iFlags & DVP_FLAG_ALLOCATED ) -+ { -+ //Remove interlaced flag before outputting -+ //no need to output this as if it was interlaced -+ picture.iFlags &= ~DVP_FLAG_INTERLACED; -+ picture.iFlags |= DVP_FLAG_NOSKIP; -+ OutputPicture(&picture, pts); -+ pts+= frametime; -+ } -+ -+ continue; -+ } - } - - if (pMsg->IsType(CDVDMsg::GENERAL_SYNCHRONIZE)) - -From fba2c1ad6bd4243245fa715622832912bc9c3b88 Mon Sep 17 00:00:00 2001 +From 960c3de27fbe55e9c0ef3ea3dc2ce54a51d956d4 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 25 Nov 2014 17:03:36 +0100 -Subject: [PATCH 89/95] fixed: it's stereo samples.. +Subject: [PATCH 094/102] fixed: it's stereo samples.. --- xbmc/addons/Visualisation.cpp | 4 ++-- @@ -10062,18 +10199,18 @@ index 810e5b2..7f17849 100644 // FFT the data twochanwithwindow(m_fFreq, AUDIO_BUFFER_SIZE); -From d4702ba72c712d48342d83ea4d4308b99b96dd85 Mon Sep 17 00:00:00 2001 +From 3689ca2c13e7f79fdd5cfe9c7d427579bc298c92 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 27 Nov 2014 14:46:22 +0000 -Subject: [PATCH 90/95] [mmalcodec] squash: Avoid deinterlace for dvd menus for - now +Subject: [PATCH 095/102] [mmalcodec] squash: Avoid deinterlace for dvd menus + for now --- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index 1894782..abd3f63 100644 +index 995c2f8..6ce648c 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp @@ -361,7 +361,7 @@ bool CMMALVideo::CreateDeinterlace(EINTERLACEMETHOD interlace_method) @@ -10085,153 +10222,11 @@ index 1894782..abd3f63 100644 status = mmal_port_parameter_set(m_deint->output[0], &imfx_param.hdr); if (status != MMAL_SUCCESS) { -@@ -869,7 +869,7 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - - bool deinterlace = m_interlace_mode != MMAL_InterlaceProgressive; - -- if (deinterlace_request == VS_DEINTERLACEMODE_OFF) -+ if (m_hints.stills || deinterlace_request == VS_DEINTERLACEMODE_OFF) - deinterlace = false; - else if (deinterlace_request == VS_DEINTERLACEMODE_FORCE) - deinterlace = true; -From f266a4429c5eef88a8abc8db361874d523ed86da Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 27 Nov 2014 16:20:56 +0000 -Subject: [PATCH 91/95] [mmalcodec] Skip some setup that is not required when - closing - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 27 ++++++++++++---------- - 1 file changed, 15 insertions(+), 12 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index abd3f63..e491b8f 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -705,11 +705,11 @@ void CMMALVideo::Dispose() - { - // we are happy to exit, but let last shared pointer being deleted trigger the destructor - bool done = false; -+ m_finished = true; - Reset(); - pthread_mutex_lock(&m_output_mutex); - if (!m_output_busy) - done = true; -- m_finished = true; - pthread_mutex_unlock(&m_output_mutex); - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s dts_queue(%d) ready_queue(%d) busy_queue(%d) done:%d", CLASSNAME, __func__, m_dts_queue.size(), m_output_ready.size(), m_output_busy, done); -@@ -927,19 +927,21 @@ void CMMALVideo::Reset(void) - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); - -- if (m_dec_input) -+ if (m_dec_input && m_dec_input->is_enabled) - mmal_port_disable(m_dec_input); -- if (m_deint_connection) -+ if (m_deint_connection && m_deint_connection->is_enabled) - mmal_connection_disable(m_deint_connection); -- if (m_dec_output) -+ if (m_dec_output && m_dec_output->is_enabled) - mmal_port_disable(m_dec_output); -- if (m_dec_input) -- mmal_port_enable(m_dec_input, dec_input_port_cb); -- if (m_deint_connection) -- mmal_connection_enable(m_deint_connection); -- if (m_dec_output) -- mmal_port_enable(m_dec_output, dec_output_port_cb_static); -- -+ if (!m_finished) -+ { -+ if (m_dec_input) -+ mmal_port_enable(m_dec_input, dec_input_port_cb); -+ if (m_deint_connection) -+ mmal_connection_enable(m_deint_connection); -+ if (m_dec_output) -+ mmal_port_enable(m_dec_output, dec_output_port_cb_static); -+ } - // blow all ready video frames - bool old_drop_state = m_drop_state; - SetDropState(true); -@@ -953,7 +955,8 @@ void CMMALVideo::Reset(void) - if (!old_drop_state) - SetDropState(false); - -- SendCodecConfigData(); -+ if (!m_finished) -+ SendCodecConfigData(); - - m_startframe = false; - m_decoderPts = DVD_NOPTS_VALUE; - -From e6c815d6c039e0c2cfb36309ce7f3eb7a69147c9 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 27 Nov 2014 16:31:56 +0000 -Subject: [PATCH 92/95] [languageinvoker] Reduce priority of python threads - ---- - xbmc/interfaces/generic/LanguageInvokerThread.cpp | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/xbmc/interfaces/generic/LanguageInvokerThread.cpp b/xbmc/interfaces/generic/LanguageInvokerThread.cpp -index 7b0d903..f92aa3e 100644 ---- a/xbmc/interfaces/generic/LanguageInvokerThread.cpp -+++ b/xbmc/interfaces/generic/LanguageInvokerThread.cpp -@@ -51,6 +51,11 @@ bool CLanguageInvokerThread::execute(const std::string &script, const std::vecto - m_args = arguments; - - Create(); -+ #ifdef TARGET_RASPBERRY_PI -+ /* low prio */ -+ SetPriority(GetPriority()-1); -+ #endif -+ - return true; - } - - -From 13d6b3ff4f79c3822df697a19184f9db43a7d257 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 27 Nov 2014 17:53:46 +0000 -Subject: [PATCH 93/95] [mmalcodec] Try reducing number of video frames - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 2 +- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index e491b8f..6ce648c 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -625,7 +625,7 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVide - if (status != MMAL_SUCCESS) - CLog::Log(LOGERROR, "%s::%s Failed to disable error concealment on %s (status=%x %s)", CLASSNAME, __func__, m_dec_input->name, status, mmal_status_to_string(status)); - -- status = mmal_port_parameter_set_uint32(m_dec_input, MMAL_PARAMETER_EXTRA_BUFFERS, NUM_BUFFERS); -+ status = mmal_port_parameter_set_uint32(m_dec_input, MMAL_PARAMETER_EXTRA_BUFFERS, GetAllowedReferences()); - if (status != MMAL_SUCCESS) - CLog::Log(LOGERROR, "%s::%s Failed to enable extra buffers on %s (status=%x %s)", CLASSNAME, __func__, m_dec_input->name, status, mmal_status_to_string(status)); - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -index 2eaea95..ea64276 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -85,7 +85,7 @@ class CMMALVideo - virtual void Reset(void); - virtual bool GetPicture(DVDVideoPicture *pDvdVideoPicture); - virtual bool ClearPicture(DVDVideoPicture* pDvdVideoPicture); -- virtual unsigned GetAllowedReferences() { return NUM_BUFFERS; } -+ virtual unsigned GetAllowedReferences() { return 3; } - virtual void SetDropState(bool bDrop); - virtual const char* GetName(void) { return (const char*)m_pFormatName; } - virtual bool GetCodecStats(double &pts, int &droppedPics); - -From 1c5fef94f15c0da61f0a5b5071f90eedb39150bf Mon Sep 17 00:00:00 2001 +From 03b46b6f234c55e69f25d6b2923d308378c7f3ab Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 28 Nov 2014 13:48:22 +0000 -Subject: [PATCH 94/95] Revert "[MMALCoded] Call port settings changed from +Subject: [PATCH 096/102] Revert "[MMALCoded] Call port settings changed from callback to avoid thread unsafe code" This reverts commit 371044f39f4ccf5207146efb96ea4859b9f704f0. @@ -10346,11 +10341,11 @@ index ea64276..79a4bfd 100644 protected: void QueryCodec(void); -From 12f38ebb16476b4803d489a1cf72ed2d8a97ff4b Mon Sep 17 00:00:00 2001 +From 4f2191434edd878a6e63f0561726201ac6d3317c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 29 Nov 2014 15:25:16 +0000 -Subject: [PATCH 95/95] [rbp] hack: wait for splash to complete before changing - hdmi mode +Subject: [PATCH 097/102] [rbp] hack: wait for splash to complete before + changing hdmi mode --- xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 49 +++++++++++++++++++++++++ @@ -10422,3 +10417,500 @@ index 1529045..977ad3e 100644 DestroyDispmaxWindow(); if(GETFLAGS_GROUP(res.dwFlags) && GETFLAGS_MODE(res.dwFlags)) + +From b071b4e935f6067d1a869a9a4a7886192af6ac25 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 1 Dec 2014 16:02:49 +0000 +Subject: [PATCH 098/102] [mmalcodec] Report when support is compiled in + +--- + xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp +index bea5e4f..eb73da8 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp +@@ -192,6 +192,11 @@ CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodec(CDVDStreamInfo &hint, unsigne + #else + hwSupport += "iMXVPU:no "; + #endif ++#if defined(HAS_MMAL) ++ hwSupport += "MMAL:yes "; ++#else ++ hwSupport += "MMAL:no "; ++#endif + CLog::Log(LOGDEBUG, "CDVDFactoryCodec: compiled in hardware support: %s", hwSupport.c_str()); + + #if defined(HAS_MMAL) + +From 9b8e40d2afb3936870b2988d196bdb2178ca1ba2 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 5 Oct 2014 14:05:25 +0100 +Subject: [PATCH 099/102] [PiSink] Allow audio output latency to be set in + settings + +--- + language/English/strings.po | 15 +++++++++++++++ + system/settings/rbp.xml | 12 ++++++++++++ + xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp | 13 ++++++++----- + xbmc/cores/AudioEngine/Sinks/AESinkPi.h | 1 + + 4 files changed, 36 insertions(+), 5 deletions(-) + +diff --git a/language/English/strings.po b/language/English/strings.po +index 83179a5..e6defbe 100755 +--- a/language/English/strings.po ++++ b/language/English/strings.po +@@ -16202,3 +16202,18 @@ msgstr "" + msgctxt "#38052" + msgid "Remote button press release time (ms)" + msgstr "" ++ ++#: system/settings/rbp.xml ++msgctxt "#38012" ++msgid "Audio output latency" ++msgstr "" ++ ++#: system/settings/rbp.xml ++msgctxt "#38013" ++msgid "Increase this to protect against underruns, reduce to have lower latency gui sounds" ++msgstr "" ++ ++#: system/settings/rbp.xml ++msgctxt "#38014" ++msgid "%i ms" ++msgstr "" +diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml +index 4c2ef41..40be71e 100644 +--- a/system/settings/rbp.xml ++++ b/system/settings/rbp.xml +@@ -113,6 +113,18 @@ + + 101 + ++ ++ 3 ++ 100 ++ ++ 50 ++ 50 ++ 300 ++ ++ ++ 38014 ++ ++ + + + +diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp +index fd9a03d..484ce14 100644 +--- a/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp ++++ b/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp +@@ -34,7 +34,6 @@ + #define CLASSNAME "CAESinkPi" + + #define NUM_OMX_BUFFERS 2 +-#define AUDIO_PLAYBUFFER (0.1) // 100ms + + static const unsigned int PassthroughSampleRates[] = { 8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000, 88200, 96000, 176400, 192000 }; + +@@ -42,6 +41,7 @@ CAEDeviceInfo CAESinkPi::m_info; + + CAESinkPi::CAESinkPi() : + m_sinkbuffer_sec_per_byte(0), ++ m_latency(0), + m_Initialized(false), + m_submitted(0), + m_omx_output(NULL) +@@ -189,6 +189,9 @@ bool CAESinkPi::Initialize(AEAudioFormat &format, std::string &device) + m_initDevice = device; + m_initFormat = format; + ++ m_latency = CSettings::Get().GetInt("audiooutput.latency") * 1e-3; ++ m_latency = std::max(m_latency, 50e-3); ++ + // analogue only supports stereo + if (CSettings::Get().GetString("audiooutput.audiodevice") == "PI:Analogue" || CSettings::Get().GetString("audiooutput.audiodevice") == "PI:Both") + { +@@ -205,7 +208,7 @@ bool CAESinkPi::Initialize(AEAudioFormat &format, std::string &device) + unsigned int sample_size = CAEUtil::DataFormatToBits(format.m_dataFormat) >> 3; + format.m_frameSize = sample_size * channels; + format.m_sampleRate = std::max(8000U, std::min(192000U, format.m_sampleRate)); +- format.m_frames = format.m_sampleRate * AUDIO_PLAYBUFFER / NUM_OMX_BUFFERS; ++ format.m_frames = format.m_sampleRate * m_latency / NUM_OMX_BUFFERS; + format.m_frameSamples = format.m_frames * channels; + + SetAudioProps(m_passthrough, GetChannelMap(format.m_channelLayout, m_passthrough)); +@@ -420,7 +423,7 @@ void CAESinkPi::GetDelay(AEDelayStatus& status) + + double CAESinkPi::GetCacheTotal() + { +- return AUDIO_PLAYBUFFER; ++ return m_latency; + } + + unsigned int CAESinkPi::AddPackets(uint8_t **data, unsigned int frames, unsigned int offset) +@@ -468,8 +471,8 @@ unsigned int CAESinkPi::AddPackets(uint8_t **data, unsigned int frames, unsigned + m_submitted++; + GetDelay(status); + delay = status.GetDelay(); +- if (delay > AUDIO_PLAYBUFFER) +- Sleep((int)(1000.0f * (delay - AUDIO_PLAYBUFFER))); ++ if (delay > m_latency) ++ Sleep((int)(1000.0f * (delay - m_latency))); + return frames; + } + +diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkPi.h b/xbmc/cores/AudioEngine/Sinks/AESinkPi.h +index 5c57999..cac5051 100644 +--- a/xbmc/cores/AudioEngine/Sinks/AESinkPi.h ++++ b/xbmc/cores/AudioEngine/Sinks/AESinkPi.h +@@ -53,6 +53,7 @@ class CAESinkPi : public IAESink + AEAudioFormat m_initFormat; + AEAudioFormat m_format; + double m_sinkbuffer_sec_per_byte; ++ double m_latency; + static CAEDeviceInfo m_info; + bool m_Initialized; + uint32_t m_submitted; + +From 2a9dde0697a3656aa05d4f1abb0783e41c4df1e0 Mon Sep 17 00:00:00 2001 +From: Cedric Girard +Date: Mon, 7 Jul 2014 15:37:52 +0200 +Subject: [PATCH 100/102] native resolution + +From adam-aph pull #1096 +Rebased to master with appropriate code change +Removed AdvancedSettings and move them to a struct with sensible +defaults +--- + xbmc/cores/VideoRenderers/BaseRenderer.cpp | 109 ++++++++++++++++++++++++++++- + xbmc/cores/VideoRenderers/BaseRenderer.h | 17 +++++ + 2 files changed, 125 insertions(+), 1 deletion(-) + +diff --git a/xbmc/cores/VideoRenderers/BaseRenderer.cpp b/xbmc/cores/VideoRenderers/BaseRenderer.cpp +index 9118cb0..48afcfc 100644 +--- a/xbmc/cores/VideoRenderers/BaseRenderer.cpp ++++ b/xbmc/cores/VideoRenderers/BaseRenderer.cpp +@@ -41,12 +41,27 @@ CBaseRenderer::CBaseRenderer() + m_sourceWidth = 720; + m_sourceHeight = 480; + m_resolution = RES_DESKTOP; ++ m_bestResolution = m_resolution; + m_fps = 0.0f; + m_renderOrientation = 0; + m_oldRenderOrientation = 0; + m_oldDestRect.SetRect(0.0f, 0.0f, 0.0f, 0.0f); + m_iFlags = 0; + ++ m_nativeUpscaleSettings = ++ { ++ true, //NativeUpscaleMode ++ true, //OverrideFPS ++ false, //CorrectPixelRatio ++ 1920, //DestWidth ++ 1080, //DestHeight ++ 0, //MinWidth ++ 0, //MinHeight ++ 1920, //MaxWidth ++ 1080,//MaxHeight ++ }; ++ ++ + for(int i=0; i < 4; i++) + { + m_rotatedDestCoords[i].x = 0; +@@ -99,6 +114,72 @@ void CBaseRenderer::ChooseBestResolution(float fps) + #endif + CLog::Log(LOGNOTICE, "Display resolution %s : %s (%d)", + m_resolution == RES_DESKTOP ? "DESKTOP" : "USER", g_graphicsContext.GetResInfo(m_resolution).strMode.c_str(), m_resolution); ++ ++ m_bestResolution = m_resolution; // save it ++ int iNatW = (int)m_sourceWidth; ++ int iNatH = (int)m_sourceHeight; ++ ++ if( m_nativeUpscaleSettings.MaxWidth && iNatW > m_nativeUpscaleSettings.MaxWidth ) ++ iNatW = 0; ++ ++ if( m_nativeUpscaleSettings.MaxHeight && iNatH > m_nativeUpscaleSettings.MaxHeight ) ++ iNatH = 0; ++ ++ if( m_nativeUpscaleSettings.NativeUpscaleMode && iNatW && iNatH ) // Native Upscale Mode ++ { ++ CLog::Log(LOGNOTICE, "Searching for NATIVE resolution: %dx%d", m_sourceWidth, m_sourceHeight); ++ ++ RESOLUTION_INFO org = g_graphicsContext.GetResInfo(m_resolution); ++ ++ bool bOverrideFPS = m_nativeUpscaleSettings.OverrideFPS; ++ double nfRD, fRD, fD, fODist = 100000000.0; ++ int iWD, iHD; ++ float fOrgRefreshRate = org.fRefreshRate; ++ int iOrgScreen = org.iScreen; ++ ++ if(iNatW <= m_nativeUpscaleSettings.MinWidth && ++ iNatH <= m_nativeUpscaleSettings.MinHeight) ++ { ++ iNatW = m_nativeUpscaleSettings.MinWidth; ++ iNatH = m_nativeUpscaleSettings.MinHeight; ++ } ++ ++ // best fit ++ for (size_t i = (int)RES_DESKTOP; i < CDisplaySettings::Get().ResolutionInfoSize(); i++) ++ { ++ const RESOLUTION_INFO info = g_graphicsContext.GetResInfo((RESOLUTION)i); ++ fRD = info.fRefreshRate - fOrgRefreshRate; // refreshrate delta ++ nfRD = info.fRefreshRate / fOrgRefreshRate; // refreshrate fit ++ iWD = info.iWidth - iNatW; // width delta ++ iHD = info.iHeight - iNatH; // height delta ++ // distance function: ++ // refreshrate, witdh and height deltas are multiplied by weight factors ++ // current weights values do not prefer any parameter (well, almost...) ++ // so we will search for lowest width, height and refresh rate which fit to the source parameters ++ // however if any of these parameters need to be preferred, bump up the weight value for it ++ fD = (iWD * 1.0) + (iHD * 1.0); // default weights for width and height resolution ++ ++ if (!bOverrideFPS) ++ { // if original fps should be preserved, accept only these ++ fRD = (fRD == 0.0) ? (0.0) : (-1.0); // resolutions where refreshrate is the same ++ } ++ else ++ { // preferred multiple fps ++ fD += fRD + ( (abs(nfRD-floor(nfRD+0.5)) < 1e-6) ? 10.0 : 1000.0 ); ++ } ++ ++ if( fRD >= 0.0 && iWD >= 0 && iHD >= 0 && fD <= fODist && ++ info.iScreen == iOrgScreen ) ++ { ++ m_resolution = (RESOLUTION)i; // if we are here, then this resolution is closer to ++ fODist = fD; // the source parameters than previous one ++ } ++ } ++ ++ CLog::Log(LOGNOTICE, "Display resolution ADJUST2 : %s (%d)", ++ org.strMode.c_str(), m_resolution); ++ } ++ + } + + bool CBaseRenderer::FindResolutionFromOverride(float fps, float& weight, bool fallback) +@@ -605,10 +686,12 @@ void CBaseRenderer::ManageDisplay() + + void CBaseRenderer::SetViewMode(int viewMode) + { ++ int savedViewMode; ++ + if (viewMode < ViewModeNormal || viewMode > ViewModeCustom) + viewMode = ViewModeNormal; + +- CMediaSettings::Get().GetCurrentVideoSettings().m_ViewMode = viewMode; ++ CMediaSettings::Get().GetCurrentVideoSettings().m_ViewMode = savedViewMode = viewMode; + + // get our calibrated full screen resolution + RESOLUTION res = GetResolution(); +@@ -619,6 +702,27 @@ void CBaseRenderer::SetViewMode(int viewMode) + // and the source frame ratio + float sourceFrameRatio = GetAspectRatio(); + ++ // if we upscale via external AVR device, correct the pixel ratio ++ if( m_nativeUpscaleSettings.NativeUpscaleMode && m_bestResolution != m_resolution ++ && m_nativeUpscaleSettings.CorrectPixelRatio ) ++ { ++ float destWidth = (float)(m_nativeUpscaleSettings.DestWidth); ++ float destHeight = (float)(m_nativeUpscaleSettings.DestHeight); ++ float destFrameRatio = (float)destWidth / destHeight; ++ bool destScreenIs43 = (destFrameRatio < 8.f/(3.f*sqrt(3.f))); // final output ++ float outWidth = (float)(info.iWidth); ++ float outHeight = (float)(info.iHeight); ++ float outFrameRatio = (float)outWidth / outHeight; ++ bool outScreenIs43 = (outFrameRatio < 8.f/(3.f*sqrt(3.f))); // xbmc output ++ ++ if( outScreenIs43 && !destScreenIs43 ) // final output is 16x9 ++ viewMode = ViewModeStretch16x9; ++ else if( !outScreenIs43 && destScreenIs43 ) // final output is 4x3 ++ viewMode = ViewModeStretch4x3; ++ ++ CMediaSettings::Get().GetCurrentVideoSettings().m_ViewMode = viewMode; ++ } ++ + bool is43 = (sourceFrameRatio < 8.f/(3.f*sqrt(3.f)) && + CMediaSettings::Get().GetCurrentVideoSettings().m_ViewMode == ViewModeNormal); + +@@ -715,6 +819,9 @@ void CBaseRenderer::SetViewMode(int viewMode) + CDisplaySettings::Get().SetZoomAmount(1.0); + } + ++ // restore original view mode ++ CMediaSettings::Get().GetCurrentVideoSettings().m_ViewMode = savedViewMode; ++ + CMediaSettings::Get().GetCurrentVideoSettings().m_CustomZoomAmount = CDisplaySettings::Get().GetZoomAmount(); + CMediaSettings::Get().GetCurrentVideoSettings().m_CustomPixelRatio = CDisplaySettings::Get().GetPixelRatio(); + CMediaSettings::Get().GetCurrentVideoSettings().m_CustomNonLinStretch = CDisplaySettings::Get().IsNonLinearStretched(); +diff --git a/xbmc/cores/VideoRenderers/BaseRenderer.h b/xbmc/cores/VideoRenderers/BaseRenderer.h +index 850aa6f..c0645f3 100644 +--- a/xbmc/cores/VideoRenderers/BaseRenderer.h ++++ b/xbmc/cores/VideoRenderers/BaseRenderer.h +@@ -72,6 +72,20 @@ typedef void (*RenderFeaturesCallBackFn)(const void *ctx, Features &renderFeatur + + struct DVDVideoPicture; + ++typedef struct NativeUpscale ++{ ++ bool NativeUpscaleMode; ++ bool OverrideFPS; ++ bool CorrectPixelRatio; ++ int DestWidth; ++ int DestHeight; ++ int MinWidth; ++ int MinHeight; ++ int MaxWidth; ++ int MaxHeight; ++} NativeUpscale; ++ ++ + class CBaseRenderer + { + public: +@@ -122,11 +136,14 @@ class CBaseRenderer + void MarkDirty(); + + RESOLUTION m_resolution; // the resolution we're running in ++ RESOLUTION m_bestResolution; // the preferred resolution + unsigned int m_sourceWidth; + unsigned int m_sourceHeight; + float m_sourceFrameRatio; + float m_fps; + ++ NativeUpscale m_nativeUpscaleSettings; ++ + unsigned int m_renderOrientation; // orientation of the video in degress counter clockwise + unsigned int m_oldRenderOrientation; // orientation of the previous frame + // for drawing the texture with glVertex4f (holds all 4 corner points of the destination rect + +From 7b11a25255f877d101a5c27d288908dcbb576769 Mon Sep 17 00:00:00 2001 +From: Cedric Girard +Date: Mon, 25 Aug 2014 18:06:47 +0200 +Subject: [PATCH 101/102] allow to disable native resolution switching through + GUI + +--- + language/English/strings.po | 6 +++++- + system/settings/settings.xml | 8 ++++++++ + xbmc/cores/VideoRenderers/BaseRenderer.cpp | 5 ++--- + xbmc/cores/VideoRenderers/BaseRenderer.h | 1 - + 4 files changed, 15 insertions(+), 5 deletions(-) + +diff --git a/language/English/strings.po b/language/English/strings.po +index e6defbe..0d2c644 100755 +--- a/language/English/strings.po ++++ b/language/English/strings.po +@@ -6453,7 +6453,11 @@ msgctxt "#13555" + msgid "%d Minutes" + msgstr "" + +-#empty strings from id 13556 to 13599 ++msgctxt "#13556" ++msgid "Enable native resolution switching" ++msgstr "" ++ ++#empty strings from id 13557 to 13599 + + #: system/settings/darwin.xml + msgctxt "#13600" +diff --git a/system/settings/settings.xml b/system/settings/settings.xml +index dbddcb6..d30d878 100644 +--- a/system/settings/settings.xml ++++ b/system/settings/settings.xml +@@ -428,6 +428,14 @@ + + + ++ ++ 2 ++ false ++ ++ 0 ++ ++ ++ + + 2 + false +diff --git a/xbmc/cores/VideoRenderers/BaseRenderer.cpp b/xbmc/cores/VideoRenderers/BaseRenderer.cpp +index 48afcfc..fb52691 100644 +--- a/xbmc/cores/VideoRenderers/BaseRenderer.cpp ++++ b/xbmc/cores/VideoRenderers/BaseRenderer.cpp +@@ -50,7 +50,6 @@ CBaseRenderer::CBaseRenderer() + + m_nativeUpscaleSettings = + { +- true, //NativeUpscaleMode + true, //OverrideFPS + false, //CorrectPixelRatio + 1920, //DestWidth +@@ -125,7 +124,7 @@ void CBaseRenderer::ChooseBestResolution(float fps) + if( m_nativeUpscaleSettings.MaxHeight && iNatH > m_nativeUpscaleSettings.MaxHeight ) + iNatH = 0; + +- if( m_nativeUpscaleSettings.NativeUpscaleMode && iNatW && iNatH ) // Native Upscale Mode ++ if( CSettings::Get().GetBool("videoplayer.nativeresolution") && iNatW && iNatH ) // Native Upscale Mode + { + CLog::Log(LOGNOTICE, "Searching for NATIVE resolution: %dx%d", m_sourceWidth, m_sourceHeight); + +@@ -703,7 +702,7 @@ void CBaseRenderer::SetViewMode(int viewMode) + float sourceFrameRatio = GetAspectRatio(); + + // if we upscale via external AVR device, correct the pixel ratio +- if( m_nativeUpscaleSettings.NativeUpscaleMode && m_bestResolution != m_resolution ++ if( CSettings::Get().GetBool("videoplayer.nativeresolution") && m_bestResolution != m_resolution + && m_nativeUpscaleSettings.CorrectPixelRatio ) + { + float destWidth = (float)(m_nativeUpscaleSettings.DestWidth); +diff --git a/xbmc/cores/VideoRenderers/BaseRenderer.h b/xbmc/cores/VideoRenderers/BaseRenderer.h +index c0645f3..b181454 100644 +--- a/xbmc/cores/VideoRenderers/BaseRenderer.h ++++ b/xbmc/cores/VideoRenderers/BaseRenderer.h +@@ -74,7 +74,6 @@ struct DVDVideoPicture; + + typedef struct NativeUpscale + { +- bool NativeUpscaleMode; + bool OverrideFPS; + bool CorrectPixelRatio; + int DestWidth; + +From a7c44cab2f8c563e4326cada82dd9bf912a4d972 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 7 Dec 2014 15:21:18 +0000 +Subject: [PATCH 102/102] [omxplayer] Remove test of removed setting, avoids a + log message + +--- + xbmc/cores/omxplayer/OMXPlayerAudio.cpp | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/xbmc/cores/omxplayer/OMXPlayerAudio.cpp b/xbmc/cores/omxplayer/OMXPlayerAudio.cpp +index d305a07..2f1df45 100644 +--- a/xbmc/cores/omxplayer/OMXPlayerAudio.cpp ++++ b/xbmc/cores/omxplayer/OMXPlayerAudio.cpp +@@ -525,17 +525,17 @@ AEDataFormat OMXPlayerAudio::GetDataFormat(CDVDStreamInfo hints) + /* check our audio capabilties */ + + /* pathrought is overriding hw decode*/ +- if(hints.codec == AV_CODEC_ID_AC3 && CAEFactory::SupportsRaw(AE_FMT_AC3, hints.samplerate) && !CSettings::Get().GetBool("audiooutput.dualaudio")) ++ if(hints.codec == AV_CODEC_ID_AC3 && CAEFactory::SupportsRaw(AE_FMT_AC3, hints.samplerate)) + { + dataFormat = AE_FMT_AC3; + m_passthrough = true; + } +- if(hints.codec == AV_CODEC_ID_EAC3 && CAEFactory::SupportsRaw(AE_FMT_AC3, hints.samplerate * 4) && !CSettings::Get().GetBool("audiooutput.dualaudio")) ++ if(hints.codec == AV_CODEC_ID_EAC3 && CAEFactory::SupportsRaw(AE_FMT_AC3, hints.samplerate * 4)) + { + dataFormat = AE_FMT_EAC3; + m_passthrough = true; + } +- if(hints.codec == AV_CODEC_ID_DTS && CAEFactory::SupportsRaw(AE_FMT_DTS, hints.samplerate) && !CSettings::Get().GetBool("audiooutput.dualaudio")) ++ if(hints.codec == AV_CODEC_ID_DTS && CAEFactory::SupportsRaw(AE_FMT_DTS, hints.samplerate)) + { + dataFormat = AE_FMT_DTS; + m_passthrough = true;