From a2de345fb3ccfe64e3126fe7154650660fd5f735 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Tue, 18 Nov 2014 20:32:40 +0100 Subject: [PATCH] projects/RPi/patches/kodi: update RPi support patch Signed-off-by: Stephan Raue --- .../RPi/patches/kodi/kodi-001-newclock4.patch | 2718 +++++++---------- 1 file changed, 1084 insertions(+), 1634 deletions(-) diff --git a/projects/RPi/patches/kodi/kodi-001-newclock4.patch b/projects/RPi/patches/kodi/kodi-001-newclock4.patch index 0a4c23bdf0..c4f9bde026 100644 --- a/projects/RPi/patches/kodi/kodi-001-newclock4.patch +++ b/projects/RPi/patches/kodi/kodi-001-newclock4.patch @@ -1,7 +1,7 @@ -From a95b561674e3a6581326d059f785ab40d6cef1f2 Mon Sep 17 00:00:00 2001 +From c25bd83d26b0f3f9d73f51488700d58cd49071f5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 18:19:32 +0100 -Subject: [PATCH 01/92] [rbp/omxplayer] When opening a stream don't try to +Subject: [PATCH 01/93] [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 e7a9379bc4aca2a5a687230966400c9759359668 Mon Sep 17 00:00:00 2001 +From c6a2e3aa3c692d349167894f8a91bef261aa98db Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 29 Apr 2014 15:23:22 +0100 -Subject: [PATCH 02/92] [ffmpeg] Speed up wtv index creation +Subject: [PATCH 02/93] [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 9a566fa5584ed7eada1d4daaa0d6b555733313c1 Mon Sep 17 00:00:00 2001 +From eabdd68d5eabc55e8b45a3125ec8cdce8d17a8f6 Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:49:17 +1300 -Subject: [PATCH 03/92] adds GetTvShowSeasons +Subject: [PATCH 03/93] adds GetTvShowSeasons --- xbmc/video/VideoDatabase.cpp | 30 ++++++++++++++++++++++++------ @@ -193,10 +193,10 @@ index 78259ed..cbb26b7 100644 bool GetArtTypes(const MediaType &mediaType, std::vector &artTypes); -From 155611d52e8060bea3e7e7ab3c7f85421e2f80d4 Mon Sep 17 00:00:00 2001 +From e3caa27dbd95c11d899ce9a824eefb1273721b97 Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:50:10 +1300 -Subject: [PATCH 04/92] move AddSeason() public. +Subject: [PATCH 04/93] move AddSeason() public. --- xbmc/video/VideoDatabase.h | 2 +- @@ -223,10 +223,10 @@ index cbb26b7..1a79c00 100644 /*! \brief Adds a path to the tvshow link table. \param idShow the id of the show. -From a32329719c0a8fcbeb4de57159dbbcee913e4f93 Mon Sep 17 00:00:00 2001 +From 3ab75c04099cb3885f5cf11ea77e56eb0970033f Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:48:24 +1300 -Subject: [PATCH 05/92] adds GetArt function to (video) scraper, allowing art +Subject: [PATCH 05/93] adds GetArt function to (video) scraper, allowing art to be fetched given the video identifier. --- @@ -341,10 +341,10 @@ index 22ac229..75bc341 100644 enum LOOKUP_STATE { DO_NOTHING = 0, FIND_MOVIE = 1, -From 15dda702e7a7bb7d4be718a0071db38eba96a75f Mon Sep 17 00:00:00 2001 +From 3923486c0a7bda7eac3ba71963e7a2c119bfb5c8 Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:53:14 +1300 -Subject: [PATCH 06/92] refresh season art if a new season is found that isn't +Subject: [PATCH 06/93] refresh season art if a new season is found that isn't recorded in the database yet. Fixes #14339 --- @@ -448,10 +448,10 @@ index 92883e7..47d5ed4 100644 bool ProcessItemByVideoInfoTag(const CFileItem *item, EPISODELIST &episodeList); -From a90d635e9e42ff2c075e2b7234fd6a723822f93e Mon Sep 17 00:00:00 2001 +From 542f9440944a95adaa5d3ad47dcbe9a133a402ec Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:53:34 +1300 -Subject: [PATCH 07/92] REMOVEME: updated thetvdb.com scraper to support art +Subject: [PATCH 07/93] REMOVEME: updated thetvdb.com scraper to support art updates --- @@ -559,10 +559,10 @@ index f27e4fc..bdf329f 100644 -From 3222366568ca4d2349deec2778d0b3640587d50b Mon Sep 17 00:00:00 2001 +From afd8f16ebb039189aa44d9d4a5afc5121bfc5280 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 2 Aug 2014 17:48:04 +0100 -Subject: [PATCH 08/92] [omx] Report decoded image name +Subject: [PATCH 08/93] [omx] Report decoded image name --- xbmc/cores/omxplayer/OMXImage.cpp | 1 + @@ -581,10 +581,10 @@ index aa413b9..22ec3f0 100644 else { -From 9f3437f332408ebce8317c6a5d40f031bf1c0436 Mon Sep 17 00:00:00 2001 +From 8a13458b476409f8e9bca467e23c12f2ded7afee Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 14 Dec 2013 16:55:05 +0000 -Subject: [PATCH 09/92] logging: Add microsecond timer to log messages +Subject: [PATCH 09/93] logging: Add microsecond timer to log messages --- xbmc/utils/log.cpp | 17 +++++++++++++++-- @@ -637,10 +637,10 @@ index 3443f12..31c4a99 100644 levelNames[logLevel]) + strData; -From b17c65fccb51569283f0daeee430d9cd6bc42d7b Mon Sep 17 00:00:00 2001 +From 52db813b34c18d3c15ee0dfe3bcc4b2e6d4a78c0 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 8 Mar 2014 15:36:06 +0000 -Subject: [PATCH 10/92] [hifiberry] Hack: force it to be recognised as IEC958 +Subject: [PATCH 10/93] [hifiberry] Hack: force it to be recognised as IEC958 capable to enable passthrough options --- @@ -663,10 +663,10 @@ index d30cbab..b268819 100644 info.m_displayName.substr(info.m_displayName.size()-5) == " HDMI") { -From ad917549f6ab25734da1d8834ed59665d6aa9ee9 Mon Sep 17 00:00:00 2001 +From 45046b28ea79e6ff3627f9739f82838055130b28 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 11 Dec 2013 17:21:54 +0000 -Subject: [PATCH 11/92] Move the reference-counting of Begin and End calls from +Subject: [PATCH 11/93] Move the reference-counting of Begin and End calls from DX and GL source files into GUIFontTTF.cpp. --- @@ -1054,10 +1054,10 @@ index c0bb53a..735fb3a 100644 protected: virtual CBaseTexture* ReallocTexture(unsigned int& newHeight); -From c6401d999b1b233851eac770d46abe178028eeda Mon Sep 17 00:00:00 2001 +From 578b15ece3b509974833f3651851ffd36dff239f Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 11 Dec 2013 18:47:54 +0000 -Subject: [PATCH 12/92] Convert CGUIFontTTFBase::m_vertex to be managed as a +Subject: [PATCH 12/93] Convert CGUIFontTTFBase::m_vertex to be managed as a std::vector. Also retired CGUIFontTTFBase::m_vertex_count and @@ -1237,10 +1237,10 @@ index 97853fd..b76c6a5 100644 *vertices++ = m_vertex[i]; *vertices++ = m_vertex[i+1]; -From 8204ffaea71234b462e4ef7c46687a3f0ea03f5d Mon Sep 17 00:00:00 2001 +From e484cdf5dcd6ffc025224cc5402ece2ce6e1c1c2 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Mon, 16 Dec 2013 18:58:12 +0000 -Subject: [PATCH 13/92] CGUIFontTTFBase::RenderCharacter can now append to +Subject: [PATCH 13/93] CGUIFontTTFBase::RenderCharacter can now append to arbitrary vectors of vertices rather than only CGUIFontTTFBase::m_vertex --- @@ -1313,10 +1313,10 @@ index 5675725..a5d44f4 100644 virtual CBaseTexture* ReallocTexture(unsigned int& newHeight) = 0; -From 880332f62ec7150f8ef72f95f287f23b7c2f49cd Mon Sep 17 00:00:00 2001 +From 5fd54d0bb10b6fe87e752d732e02b6abd68ab227 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 17:18:38 +0000 -Subject: [PATCH 14/92] Add a cache of font glyph bounding box vertices. +Subject: [PATCH 14/93] 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 @@ -2076,10 +2076,10 @@ index f351c99..9036ba9 100644 + return !operator==(a, b); +} -From 19e0034245d86c35ce0dc93b6533b9fe37d2831e Mon Sep 17 00:00:00 2001 +From 023ba93116b5257ba8fcc312cf88860b9eeb691b Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 23 Jan 2014 22:24:17 +0000 -Subject: [PATCH 15/92] Lay the groundwork for hardware clipping. +Subject: [PATCH 15/93] 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 @@ -2341,10 +2341,10 @@ index 98e398a..81ee49e 100644 virtual void ResetScissors(); -From fb75fe8403e7d9d1ada5c17c14bcad0e0da5ff44 Mon Sep 17 00:00:00 2001 +From 566320bf51a1d9c32d26888e2c7ca376fa7a45a9 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 23 Jan 2014 16:42:22 +0000 -Subject: [PATCH 16/92] Increase font cache hit rate by keying on the +Subject: [PATCH 16/93] 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 @@ -2545,10 +2545,10 @@ index 3b93672..258dffa 100644 private: virtual bool FirstBegin() = 0; -From d05b5268aac43edd8a018bb4d0006d0680ae8328 Mon Sep 17 00:00:00 2001 +From aabc9ab602630f055641623b6a4ae447d5ff321a Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 8 Jan 2014 12:16:33 +0000 -Subject: [PATCH 17/92] Rewrite of scrolling text code. +Subject: [PATCH 17/93] 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 @@ -2864,10 +2864,10 @@ index 2cda726..fbc579e 100644 private: void Process(); -From 0cfaac1afce5068a81cc55da1540180c0e753c4f Mon Sep 17 00:00:00 2001 +From ad13a68337cd1f30a571fd35700cd0db5b4f49b2 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Mon, 27 Jan 2014 23:21:10 +0000 -Subject: [PATCH 18/92] Move the application of the translation offsets into +Subject: [PATCH 18/93] 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 @@ -3061,10 +3061,10 @@ index 9935ea4..18c9358 100644 memset(newTexture->GetPixels(), 0, m_textureHeight * newTexture->GetPitch()); if (m_texture) -From fd3e88118a5070a7dac82b3d6b7b33f311543e15 Mon Sep 17 00:00:00 2001 +From d1cbefa0ef6e03ee1c36ece18f7fef20320c5cf6 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 15:28:06 +0000 -Subject: [PATCH 19/92] Rather than applying the translation offsets to the +Subject: [PATCH 19/93] 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. @@ -3208,10 +3208,10 @@ index 81ee49e..d2f9cd1 100644 protected: virtual void SetVSyncImpl(bool enable) = 0; -From bdbd453ceef0b03a95f008a1a0ca5525cec2adf1 Mon Sep 17 00:00:00 2001 +From a978367d1d49edd4eb43fadb726750da72c97584 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 29 Jan 2014 13:21:19 +0000 -Subject: [PATCH 20/92] Enable hardware clipping. +Subject: [PATCH 20/93] Enable hardware clipping. --- xbmc/guilib/GUIFontTTF.cpp | 4 ++-- @@ -3283,10 +3283,10 @@ index ea08bf4..b63e337 100644 glUniformMatrix4fv(modelLoc, 1, GL_FALSE, g_matrices.GetMatrix(MM_MODELVIEW)); } -From 377e7c63ffc913635be2a2c2ebe510729a3ae1b1 Mon Sep 17 00:00:00 2001 +From 8ace52ff2b373f690827a822056417ec0e540078 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 15:32:51 +0000 -Subject: [PATCH 21/92] Move the vertex data across to a vertex buffer object +Subject: [PATCH 21/93] Move the vertex data across to a vertex buffer object just prior to drawing. --- @@ -3337,10 +3337,10 @@ index b63e337..b00055d 100644 // Disable the attributes used by this shader -From dc7c4f6c26204e60309b11b54ef889c54bfd320e Mon Sep 17 00:00:00 2001 +From 41cb7f92ec56d02627d12d350e6b9640ec3910fe Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 16:04:04 +0000 -Subject: [PATCH 22/92] Move vertex data into an OpenGL VBO when the font cache +Subject: [PATCH 22/93] 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 @@ -3613,10 +3613,10 @@ index 735fb3a..6102c90 100644 protected: virtual CBaseTexture* ReallocTexture(unsigned int& newHeight); -From 02b12be17511f262f71482cea86932e1242cea4e Mon Sep 17 00:00:00 2001 +From 5adb387af44a62694268e4fdda0f0810bff13860 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 1 Nov 2014 22:15:13 +0000 -Subject: [PATCH 23/92] Switch from glDrawArrays() to glDrawElements(). +Subject: [PATCH 23/93] 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. @@ -3837,10 +3837,10 @@ index d2a94c9..7b6097a 100644 if (m_display != EGL_NO_DISPLAY) -From 13c777aca3442418427e9e4f73518d12e3934089 Mon Sep 17 00:00:00 2001 +From 09a29474b173ccb73a0410dd32289ef69d87ddcc Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 1 May 2014 16:28:39 +0100 -Subject: [PATCH 24/92] Improved file buffering in CArchive +Subject: [PATCH 24/93] 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 @@ -3900,10 +3900,10 @@ index 6ed0f8f..8506d95 100644 } else -From ecde1494d0c6b84a4c4f4828bd143451007b805c Mon Sep 17 00:00:00 2001 +From de568e2203c61397d8bb13b4f530f0608f8b2d39 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 10 Sep 2014 22:07:21 +0100 -Subject: [PATCH 25/92] [mmal] Allow mmal codec for dvd stills +Subject: [PATCH 25/93] [mmal] Allow mmal codec for dvd stills --- xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp | 4 ++++ @@ -3925,17 +3925,17 @@ index f139433..4183a2b 100644 { // If dvd is an mpeg2 and hint.stills -From 00e5297210142b52baf68ce2283f6eff2afb503d Mon Sep 17 00:00:00 2001 +From 67e9cbc39d6d343f5070978adfca64f87661dc9e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 12 Aug 2014 00:31:36 +0100 -Subject: [PATCH 26/92] [omxcodec] Don't force software codec with dvds +Subject: [PATCH 26/93] [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 8b3a75a..e9126cd 100644 +index c5309fe..ee63a70 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp @@ -3209,7 +3209,9 @@ bool CDVDPlayer::OpenVideoStream(CDVDStreamInfo& hint, bool reset) @@ -3949,10 +3949,10 @@ index 8b3a75a..e9126cd 100644 CDVDInputStream::IMenus* pMenus = dynamic_cast(m_pInputStream); -From ed48da2bd0de6f6f1707f578ae9c4888358c2621 Mon Sep 17 00:00:00 2001 +From 1bd2916867ef8f820d485765d6734a85efa8673f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 2 Nov 2014 20:10:08 +0000 -Subject: [PATCH 27/92] [dvdplayervideo] Make variables more local +Subject: [PATCH 27/93] [dvdplayervideo] Make variables more local --- xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 14 +++++++------- @@ -4005,10 +4005,10 @@ index e47f85c..e42f8ff 100644 { if (m_bAllowDrop) -From f9b750d76f7f39dc1020c3ab6d589cc7b5b447bf Mon Sep 17 00:00:00 2001 +From c018fd93f66b5387b3a38d693aa4dd7288e5c474 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Nov 2014 16:44:52 +0000 -Subject: [PATCH 28/92] [dvdplayervideo] Move packet handling into separate +Subject: [PATCH 28/93] [dvdplayervideo] Move packet handling into separate function --- @@ -4577,10 +4577,10 @@ index 4e1b3d6..a1606f7 100644 CDVDMessageQueue m_messageQueue; CDVDMessageQueue& m_messageParent; -From f3f2a175e159d89f6439efbf3b92621c49dbd619 Mon Sep 17 00:00:00 2001 +From e08114c1f4368925f39f4bfe81db5438145e96dd Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Nov 2014 16:49:48 +0000 -Subject: [PATCH 29/92] [dvdplayervideo] Prod decoder when in stills mode +Subject: [PATCH 29/93] [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. @@ -4602,10 +4602,10 @@ index 7ee8638..c22ea9f 100644 continue; } -From 3ba02548cb829f0924169c1f621037358c418561 Mon Sep 17 00:00:00 2001 +From 59bfc5035a207417dede46b074e2a35812ad2021 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 16 Apr 2014 21:18:06 +0100 -Subject: [PATCH 30/92] [omxplayer] Don't propagate 3d flags based on supported +Subject: [PATCH 30/93] [omxplayer] Don't propagate 3d flags based on supported 3d modes --- @@ -4658,10 +4658,10 @@ index ac838ce..605318c9 100644 unsigned int iDisplayWidth = width; unsigned int iDisplayHeight = height; -From 136cf80921ec687484c7635a328f138620c86a12 Mon Sep 17 00:00:00 2001 +From a835457e3f780834e17926491941ae12beeb4d2c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Apr 2014 13:00:52 +0100 -Subject: [PATCH 31/92] [graphics] Don't set stereo mode based on resolution +Subject: [PATCH 31/93] [graphics] Don't set stereo mode based on resolution The resolution change should follow stereo mode --- @@ -4719,10 +4719,10 @@ index 3cb5587..fe6ebf4 100644 m_iScreenWidth = info_mod.iWidth; -From aa38a302d4833466154b7408d72205a320d9f2a3 Mon Sep 17 00:00:00 2001 +From 41374f49db0b860aff61d9cea3e38aa1b4619d5a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Apr 2014 13:01:51 +0100 -Subject: [PATCH 32/92] [graphics] Allow switching to a more suitable 3D +Subject: [PATCH 32/93] [graphics] Allow switching to a more suitable 3D resolution --- @@ -4808,10 +4808,10 @@ index 2904c1b..8d3774f 100644 void ResetOverscan(RESOLUTION_INFO &resinfo); void ResetScreenParameters(RESOLUTION res); -From 27254a7b7760b94bd5e632ce8956e62f920f49df Mon Sep 17 00:00:00 2001 +From 6ca25a020d6fc0cf1df97131973171d150398f53 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Apr 2014 13:38:55 +0100 -Subject: [PATCH 33/92] [3D] Support switching to 3D resolutions +Subject: [PATCH 33/93] [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. @@ -4893,10 +4893,10 @@ index 83c3adb..8076e76 100644 return current; } -From 66038eb39cf383dbdc58acfed411c889dbf60b21 Mon Sep 17 00:00:00 2001 +From 5906e43bcefb5ea2afb3556c1f9bdf0d772f3c06 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 23 Apr 2014 00:05:07 +0100 -Subject: [PATCH 34/92] [graphics] Make pixel ratio for 3d modes consistent +Subject: [PATCH 34/93] [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. @@ -5099,10 +5099,10 @@ index c58c28a..bf1e589 100644 AddUniqueResolution(res2, resolutions); -From 3d6c7f4f6bf91588d0d7e960a3dd47281d1ccd39 Mon Sep 17 00:00:00 2001 +From 9e496ef84fc6cf11e0f235a9c34c18dec903145b Mon Sep 17 00:00:00 2001 From: da-anda Date: Sun, 17 Aug 2014 21:09:59 +0200 -Subject: [PATCH 35/92] handle stereoscopic mode of videos in mixed playlists +Subject: [PATCH 35/93] handle stereoscopic mode of videos in mixed playlists --- language/English/strings.po | 2 +- @@ -5270,10 +5270,10 @@ index 35ba597..b013942 100644 case 2: // Mono SetStereoMode( RENDER_STEREO_MODE_MONO ); -From aa9ea613e2799a53ead2566e3809a5823163f156 Mon Sep 17 00:00:00 2001 +From 6b36268961ff10f4850e502a8fe68760c0437d03 Mon Sep 17 00:00:00 2001 From: da-anda Date: Sat, 16 Aug 2014 11:20:54 +0200 -Subject: [PATCH 36/92] remember user selected 3D modes between videos until +Subject: [PATCH 36/93] remember user selected 3D modes between videos until playback ended --- @@ -5490,10 +5490,10 @@ index c1dfb93..cb54bd0 100644 -From 0eec309960904cfe9074232060f213027dcb88dd Mon Sep 17 00:00:00 2001 +From 44b97926bcd7db9051bb73a1b464b7d6eb01069f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 10 Aug 2014 16:45:16 +0100 -Subject: [PATCH 37/92] filesystem: Make support of browsing into archives +Subject: [PATCH 37/93] 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. @@ -5592,10 +5592,11 @@ index 2fd8777..3b294cd 100644 { // XBMC Smart playlist - just XML renamed to XSP // read the name of the playlist in -From 2f8babbf784a0cd47e86a95638e34eb28d5bccca Mon Sep 17 00:00:00 2001 + +From 86d02a58207289183c76d6a0ef8c905a595a6d54 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 27 Oct 2014 13:06:57 +0000 -Subject: [PATCH 39/92] [rbp] Make cachemembuffersize default depend on memory +Subject: [PATCH 39/93] [rbp] Make cachemembuffersize default depend on memory size --- @@ -5652,10 +5653,10 @@ index f4c309b..bf78194 100644 // as multiply of the default data read rate -From 1802b040aa4f73c645d98e93069676660808413e Mon Sep 17 00:00:00 2001 +From 04ff366197afd8c89e5eb8316abd3536d7f339d8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 16 Jun 2014 19:06:00 +0100 -Subject: [PATCH 41/92] [experimental] Disable quiet-noise generation +Subject: [PATCH 41/93] [experimental] Disable quiet-noise generation --- xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp | 2 ++ @@ -5682,10 +5683,10 @@ index b391ff3..463a89c 100644 void CActiveAESink::SetSilenceTimer() -From a13ac4f97871b482dd060eea06bdf1c5c673c5c9 Mon Sep 17 00:00:00 2001 +From d15b00745b67aaa1085ef186e9fc3d732b4a1e88 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 30 May 2014 14:58:43 +0100 -Subject: [PATCH 42/92] [settings] Experiment: Report DESKTOP resolution in +Subject: [PATCH 42/93] [settings] Experiment: Report DESKTOP resolution in video settings --- @@ -5707,10 +5708,10 @@ index 6902f83..50c5f97 100644 StringUtils::Format("%dx%d%s", resolution->width, resolution->height, ModeFlagsToString(resolution->flags, false).c_str()), -From cfa8df6ff66b6b7409f0332c8bcba80eea4f44d0 Mon Sep 17 00:00:00 2001 +From ba69c598a6b6f9184ff3d725b2417ba6f3dffbcd Mon Sep 17 00:00:00 2001 From: macrule Date: Thu, 11 Apr 2013 18:24:42 +0200 -Subject: [PATCH 43/92] Added some vc_tv_* functions that were missing in +Subject: [PATCH 43/93] Added some vc_tv_* functions that were missing in DllBCM. --- @@ -5745,10 +5746,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 607621d6f1f1b168a50d3dce60f078ffc53260b5 Mon Sep 17 00:00:00 2001 +From 94e762d804aea4ac109e04681457ab7081308657 Mon Sep 17 00:00:00 2001 From: macrule Date: Thu, 11 Apr 2013 18:29:03 +0200 -Subject: [PATCH 44/92] Added private utility function to map a float display +Subject: [PATCH 44/93] Added private utility function to map a float display aspect, to the respective SDTV_ASPECT_* enum value. --- @@ -5786,10 +5787,10 @@ index bf1e589..518a87d 100644 bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &resolutions) -From fe96123239c3262fe83856272b4aeafc7e92c0f5 Mon Sep 17 00:00:00 2001 +From 736289e927072841bce14493190a1452afba9d61 Mon Sep 17 00:00:00 2001 From: macrule Date: Thu, 11 Apr 2013 19:50:58 +0200 -Subject: [PATCH 45/92] Changed SDTV resolutions to be treated similarly to +Subject: [PATCH 45/93] 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. @@ -5886,10 +5887,10 @@ index 59401f5..a0acb1a 100644 int m_width; int m_height; -From 1e72ab144e56bc5ce073b6828386ac06d0acdf9f Mon Sep 17 00:00:00 2001 +From b5e3a7337fb964203726b79e4597104be46837ec Mon Sep 17 00:00:00 2001 From: macrule Date: Thu, 11 Apr 2013 19:54:59 +0200 -Subject: [PATCH 46/92] Added methods SuspendVideoOutput() and +Subject: [PATCH 46/93] 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. @@ -5953,10 +5954,10 @@ index 9dc39d5..ca36082 100644 CEGLNativeTypeRaspberryPI::CEGLNativeTypeRaspberryPI() { -From f29ad22884050ef43525374939871ad464dfbf97 Mon Sep 17 00:00:00 2001 +From ea33aee7e67876170a79c2ee56fdafd8b82366fe Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 11 Aug 2013 15:03:36 +0100 -Subject: [PATCH 47/92] PowerManager (and its IPowerSyscall instance) now gets +Subject: [PATCH 47/93] 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. @@ -5968,10 +5969,10 @@ Subject: [PATCH 47/92] PowerManager (and its IPowerSyscall instance) now gets 4 files changed, 23 insertions(+) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index 48fa09b..d1b304b 100644 +index ec53704..c68dbc7 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp -@@ -2359,6 +2359,13 @@ bool CApplication::OnKey(const CKey& key) +@@ -2360,6 +2360,13 @@ bool CApplication::OnKey(const CKey& key) // special handling if the screensaver is active CAction action = CButtonTranslator::GetInstance().GetAction(iWin, key); @@ -6049,10 +6050,10 @@ index 0b1f10a..e42b143 100644 void OnSleep(); void OnWake(); -From e8fa9391f99fff7852d1f3b9ad6e1c1b55d7ba46 Mon Sep 17 00:00:00 2001 +From 92e94eb840739452973cfaf1cc4c1c9887ec164e Mon Sep 17 00:00:00 2001 From: macrule Date: Wed, 17 Apr 2013 13:23:01 +0200 -Subject: [PATCH 48/92] Added CPowerSyscallVirtualSleep class, which acts as a +Subject: [PATCH 48/93] 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. @@ -6228,10 +6229,10 @@ index 0000000..ef6e682 + +#endif // _POWER_SYSCALL_VIRTUAL_SLEEP_H_ -From 6ab00ee904e8d590a4ad79b0d07b516b292a147d Mon Sep 17 00:00:00 2001 +From 37a27d99395613344acba85241168b9b0b94e895 Mon Sep 17 00:00:00 2001 From: macrule Date: Wed, 17 Apr 2013 13:24:22 +0200 -Subject: [PATCH 49/92] Added power management support for the Raspberry Pi. +Subject: [PATCH 49/93] 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. @@ -6377,10 +6378,10 @@ index 0000000..fd1d67c + +#endif // _RASPBERRY_PI_POWER_SYSCALL_H_ -From 9ab26f5b85f7b83e0bd338ccd9e577220e579651 Mon Sep 17 00:00:00 2001 +From 174610a60199d91cc847f7461350f107fff7ca45 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Mar 2014 16:16:29 +0000 -Subject: [PATCH 50/92] [power] hack - don't kill lirc or cec +Subject: [PATCH 50/93] [power] hack - don't kill lirc or cec --- xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 37 +++++++++++++++++++++++ @@ -6464,10 +6465,10 @@ index df8ba06..b99eb44 100644 CBuiltins::Execute("LIRC.Start"); #endif -From 5512a602d89fd557f4e35abf0e57811329a6d213 Mon Sep 17 00:00:00 2001 +From b2836c04645a3945a3dd9550fcd4aae15b4a6903 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Mar 2014 16:47:54 +0000 -Subject: [PATCH 51/92] [power] hack - wake on any action +Subject: [PATCH 51/93] [power] hack - wake on any action --- xbmc/powermanagement/PowerSyscallVirtualSleep.cpp | 6 +++--- @@ -6496,10 +6497,10 @@ index 6a1e47b..a717a09 100644 if(VirtualWake()) { -From c758ed8ab1b9c0bc3f4ce09280bc5203fa64610e Mon Sep 17 00:00:00 2001 +From e534beb4334ff431c946ef0db40efb12156779b0 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Mar 2014 17:30:07 +0000 -Subject: [PATCH 52/92] [power] hack - Make suspend toggle suspend state +Subject: [PATCH 52/93] [power] hack - Make suspend toggle suspend state --- xbmc/powermanagement/PowerSyscallVirtualSleep.cpp | 5 +++++ @@ -6522,10 +6523,10 @@ index a717a09..d39c3ed 100644 return false; } -From 6670154d475c813702e69eadfef844219d690007 Mon Sep 17 00:00:00 2001 +From f98710e0b01769bb1243b01305817ad4a2cedc64 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 4 Mar 2014 19:33:44 +0000 -Subject: [PATCH 53/92] [power] Add back in powerdown and reboot +Subject: [PATCH 53/93] [power] Add back in powerdown and reboot --- .../linux/RaspberryPIPowerSyscall.cpp | 34 ++++++++++++++++++++++ @@ -6603,10 +6604,10 @@ index fd1d67c..062132e 100644 virtual bool CanReboot() { return true; } -From 3d71c210a9b943f2e6a5f8cdf52ce0fbe565e39e Mon Sep 17 00:00:00 2001 +From d4976d1c67b0624612c03f3b89e142ce0ceaa424 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 26 Apr 2014 17:27:52 +0100 -Subject: [PATCH 54/92] [cec] Don't suspend pi on tv switch off - it can't wake +Subject: [PATCH 54/93] [cec] Don't suspend pi on tv switch off - it can't wake up --- @@ -6627,10 +6628,10 @@ index a67dc2f..680863e 100644 -From 863d7d14c55d290d27b73301cb02dde1266be4af Mon Sep 17 00:00:00 2001 +From 4ecaa5409bfae91d62cec4f78059e33eab1933ac Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 27 Jun 2014 00:01:05 +0100 -Subject: [PATCH 55/92] [rbp] Resume video output on startup +Subject: [PATCH 55/93] [rbp] Resume video output on startup --- xbmc/linux/RBP.cpp | 3 +++ @@ -6651,10 +6652,10 @@ index cb87b77..34866f6 100644 m_omx_image_init = true; return true; -From 9896d6fd34e46ad074dfc7f58598653b83f2b2e7 Mon Sep 17 00:00:00 2001 +From 745982e9aea4be85ba5478e94947560fd6861ecc Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 16 Aug 2014 21:01:42 +0100 -Subject: [PATCH 56/92] omxrender: Hacks to reduce GUI rendering rate when +Subject: [PATCH 56/93] omxrender: Hacks to reduce GUI rendering rate when playing video --- @@ -6726,7 +6727,7 @@ index f3c8a01..2996c29 100644 diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index d1b304b..3a5e045 100644 +index c68dbc7..48f4c79 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp @@ -2207,6 +2207,23 @@ void CApplication::Render() @@ -6754,10 +6755,10 @@ index d1b304b..3a5e045 100644 int vsync_mode = CSettings::Get().GetInt("videoscreen.vsync"); -From 5382dbe2c3860bceb8ba5152201ebed8ed55bc0e Mon Sep 17 00:00:00 2001 +From 83d0883a121944e89a789ebac06c78140c3bbf68 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 9 Sep 2014 12:04:26 +0100 -Subject: [PATCH 57/92] egl: Treat unknown display aspect ratio as square pixel +Subject: [PATCH 57/93] egl: Treat unknown display aspect ratio as square pixel --- xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 4 ++-- @@ -6786,10 +6787,10 @@ index ca36082..1529045 100644 SetResolutionString(m_desktopRes); -From a664d8d9b957d560c84946310a63f55c2cbe0312 Mon Sep 17 00:00:00 2001 +From 9a7b10e2de6ca6d4c0495ba7982bba83fe2446c1 Mon Sep 17 00:00:00 2001 From: anaconda Date: Thu, 11 Sep 2014 21:30:43 +0200 -Subject: [PATCH 58/92] Disable textbox autoscrolling while on screensaver. +Subject: [PATCH 58/93] Disable textbox autoscrolling while on screensaver. SQUASH: only if dim or black --- @@ -6799,10 +6800,10 @@ SQUASH: only if dim or black 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index 3a5e045..009d425 100644 +index 48f4c79..21039d8 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp -@@ -5853,3 +5853,10 @@ void CApplication::CloseNetworkShares() +@@ -5858,3 +5858,10 @@ void CApplication::CloseNetworkShares() CSFTPSessionManager::DisconnectAllSessions(); #endif } @@ -6850,10 +6851,10 @@ index b7ef051..e149418 100644 if (m_lastRenderTime) m_autoScrollDelayTime += currentTime - m_lastRenderTime; -From 490ab5546de00a08816e5c85d894f837bdfff074 Mon Sep 17 00:00:00 2001 +From 4419e858f2983b459b248b310abdfec2902469f1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 18 Sep 2014 14:24:56 +0100 -Subject: [PATCH 59/92] [omxplayer] Only enable audio clock master when A/V +Subject: [PATCH 59/93] [omxplayer] Only enable audio clock master when A/V sync method is set to audio clock --- @@ -6884,10 +6885,10 @@ index 549700c..db0886e 100644 OMX_CONFIG_BOOLEANTYPE configBool; OMX_INIT_STRUCTURE(configBool); -From 2db05884b1c05d7f4bd598bc54e1dd4bd88198b2 Mon Sep 17 00:00:00 2001 +From e40240dc5294774604644551ef1d31b3551c63a4 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 19 Sep 2014 11:54:49 +0100 -Subject: [PATCH 60/92] [dvdplayer/rbp] Add pi specific option to maintain +Subject: [PATCH 60/93] [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". @@ -7085,10 +7086,10 @@ index f947acc..606c24f 100644 void SuspendVideoOutput(); void ResumeVideoOutput(); -From 7fc2cd40b43150b50a880cbe6503ce27351857a6 Mon Sep 17 00:00:00 2001 +From f9bd54aa55985e216619d2996d7967c7a3fbe284 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 27 Sep 2014 15:27:04 +0100 -Subject: [PATCH 61/92] [omxplayer] Don't sync up to passthrough audio packets +Subject: [PATCH 61/93] [omxplayer] Don't sync up to passthrough audio packets - let GPU handle it This code was just broken. @@ -7346,10 +7347,10 @@ index 7cf10ad..f014364 100644 OMX_AUDIO_CODINGTYPE m_eEncoding; uint8_t *m_extradata; -From dee99933dc9a03427a1262e081cc2a7581ee8862 Mon Sep 17 00:00:00 2001 +From b76e77b6226e5b486ba59b2c0e27f514e2bf11c0 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 27 Sep 2014 15:32:37 +0100 -Subject: [PATCH 62/92] [dvdplayer] exerimental: don't raise priority of audio +Subject: [PATCH 62/93] [dvdplayer] exerimental: don't raise priority of audio thread --- @@ -7357,7 +7358,7 @@ Subject: [PATCH 62/92] [dvdplayer] exerimental: don't raise priority of audio 1 file changed, 4 insertions(+) diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index e9126cd..55729eb 100644 +index ee63a70..de859e0 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp @@ -3194,7 +3194,11 @@ bool CDVDPlayer::OpenAudioStream(CDVDStreamInfo& hint, bool reset) @@ -7373,18 +7374,18 @@ index e9126cd..55729eb 100644 } -From 1ed7f9b43fb4000bd3b36d4ace034c99e53aab93 Mon Sep 17 00:00:00 2001 +From e0793096bcf2353572702ef0c5a09488e6c2f03f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 28 Sep 2014 19:28:17 +0100 -Subject: [PATCH 63/92] [mmalcodec] Introduce a preroll period to buffer up +Subject: [PATCH 63/93] [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 | 35 +++++++++++++++++----- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 3 ++ - 4 files changed, 36 insertions(+), 8 deletions(-) + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 31 +++++++++++++++++----- + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 3 +++ + 4 files changed, 34 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 @@ -7413,10 +7414,10 @@ index 67aa505..a768e70 100644 protected: MMALVideoPtr m_decoder; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index 664376c..c9c3839 100644 +index 098910e..5d65f4e 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -136,6 +136,8 @@ CMMALVideo::CMMALVideo() +@@ -128,6 +128,8 @@ CMMALVideo::CMMALVideo() m_output_busy = 0; m_demux_queue_length = 0; m_es_format = mmal_format_alloc(); @@ -7425,7 +7426,7 @@ index 664376c..c9c3839 100644 } CMMALVideo::~CMMALVideo() -@@ -702,6 +704,8 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVide +@@ -696,6 +698,8 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVide m_drop_state = false; m_startframe = false; @@ -7434,17 +7435,15 @@ index 664376c..c9c3839 100644 return true; } -@@ -913,24 +917,30 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) +@@ -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 defined(MMAL_DEBUG_VERBOSE) -- CLog::Log(LOGDEBUG, "%s::%s - got output picture:%d", CLASSNAME, __func__, m_output_ready.size()); -+ 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); - #endif + 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; } @@ -7457,23 +7456,22 @@ index 664376c..c9c3839 100644 + + if (!m_output_ready.empty() && !m_preroll) { - #if defined(MMAL_DEBUG_VERBOSE) -- 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); -+ CLog::Log(LOGDEBUG, "%s::%s - got output picture:%d", CLASSNAME, __func__, m_output_ready.size()); - #endif + 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) { -- CLog::Log(LOGDEBUG, "%s::%s - Nothing to do: dts_queue(%d) ready_queue(%d) busy_queue(%d) demux_queue(%d) space(%d)", + 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)", ++ 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; -@@ -974,8 +984,17 @@ void CMMALVideo::Reset(void) +@@ -963,8 +973,17 @@ void CMMALVideo::Reset(void) m_decoderPts = DVD_NOPTS_VALUE; m_droppedPics = 0; m_decode_frame_number = 1; @@ -7513,10 +7511,10 @@ index b4aa571..4f81bbd 100644 MMAL_COMPONENT_T *m_dec; MMAL_PORT_T *m_dec_input; -From 9b41e907935394530b9dacbccd510b024cfa7d0c Mon Sep 17 00:00:00 2001 +From 07a96a4203f52a4e8f56466d6d0f5671166a96ff Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 11 Apr 2014 16:12:27 +0100 -Subject: [PATCH 64/92] [omxplayer] Add ability to log more timestamp info in +Subject: [PATCH 64/93] [omxplayer] Add ability to log more timestamp info in extra debug settings --- @@ -7667,10 +7665,10 @@ index bf78194..c68ac95 100644 void CAdvancedSettings::setExtraLogLevel(const std::vector &components) -From d05ec8077025e6f681c5bc474e5a489f665f4ff9 Mon Sep 17 00:00:00 2001 +From 7b3d22291f15c45cc691ba1b905f2f6c3fcac72c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 23:13:55 +0100 -Subject: [PATCH 65/92] [omxplayer] Add ability to dump out audio/video data +Subject: [PATCH 65/93] [omxplayer] Add ability to dump out audio/video data for later debugging --- @@ -7912,10 +7910,10 @@ index c68ac95..852c70d 100644 void CAdvancedSettings::setExtraLogLevel(const std::vector &components) -From f863a659349b3715a4541105206032b4660dde85 Mon Sep 17 00:00:00 2001 +From a44e75ec7a1bdbe6825c3d0fca3dac26aee2d8d8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 24 Sep 2014 23:13:52 +0100 -Subject: [PATCH 66/92] [audio] Add settings option to boost centre channel +Subject: [PATCH 66/93] [audio] Add settings option to boost centre channel when downmixing This allows a dB volume increase to be added to centre channel. @@ -8037,10 +8035,10 @@ index b5e86ae..00bae83 100644 // stereo upmix if (upmix && m_src_channels == 2 && m_dst_channels > 2) -From 53c0c459527532c53e97cff6c6bfd131bbd1937a Mon Sep 17 00:00:00 2001 +From f8417b01c94584acdb3eb2037983bb22036e18aa Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 3 Oct 2014 18:38:07 +0100 -Subject: [PATCH 67/92] [omxcore] Skip out of flush on error +Subject: [PATCH 67/93] [omxcore] Skip out of flush on error --- xbmc/linux/OMXCore.cpp | 4 ++-- @@ -8069,10 +8067,10 @@ index 4ae29ba..4caa304 100644 OMX_ERRORTYPE omx_err = OMX_ErrorNone; -From 26e4efaa67218f76ba6cbaf11952992443610564 Mon Sep 17 00:00:00 2001 +From 8dfa48f87cfb1db9da2c7f67b84502327dfec406 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 3 Oct 2014 18:40:06 +0100 -Subject: [PATCH 68/92] [SinkPi] Handle multichannel layout more like OMXAudio +Subject: [PATCH 68/93] [SinkPi] Handle multichannel layout more like OMXAudio --- xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp | 14 +++++++------- @@ -8131,10 +8129,10 @@ index 89684e4..fd9a03d 100644 m_format = format; m_sinkbuffer_sec_per_byte = 1.0 / (double)(m_format.m_frameSize * m_format.m_sampleRate); -From 722f1492746205af14dc4d8c3a6109bdcd8810b2 Mon Sep 17 00:00:00 2001 +From 5c0be3d496cdf4cc53e209920e4d0d14e72e14a4 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 5 Oct 2014 14:05:25 +0100 -Subject: [PATCH 69/92] [PiSink] Allow audio output latency to be set in +Subject: [PATCH 69/93] [PiSink] Allow audio output latency to be set in settings --- @@ -8262,10 +8260,10 @@ index 5c57999..cac5051 100644 bool m_Initialized; uint32_t m_submitted; -From 54ef2c8c6a3ceccbc3e516f151614b23a2e2e782 Mon Sep 17 00:00:00 2001 +From a6e42a951c6bd07c70fb06ee4129e2530a360bb2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 18 Aug 2014 19:09:32 +0100 -Subject: [PATCH 70/92] rbp: Use new dispmanx function for vsync callbacks +Subject: [PATCH 70/93] rbp: Use new dispmanx function for vsync callbacks --- xbmc/linux/RBP.cpp | 85 ++++++++++++++----------- @@ -8477,10 +8475,10 @@ index 1529045..b6bf1fc 100644 } DLOG("CEGLNativeTypeRaspberryPI::DestroyDispmaxWindow\n"); -From 252c1d03e42ce8bef9e21b4b00cb88841c8db270 Mon Sep 17 00:00:00 2001 +From 00cd18ff22710d5a3f31e4efaf3c67c73b7710f6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 19 Aug 2014 17:56:45 +0100 -Subject: [PATCH 71/92] Revert "rbp: Use new dispmanx function for vsync +Subject: [PATCH 71/93] Revert "rbp: Use new dispmanx function for vsync callbacks" This reverts commit afbf8fbceaa6649fb4a6bbd9a1cee6087590412b. @@ -8694,10 +8692,10 @@ index b6bf1fc..1529045 100644 } DLOG("CEGLNativeTypeRaspberryPI::DestroyDispmaxWindow\n"); -From 8b66d5eb4b1380521dd123b4c886dd5a0c74c280 Mon Sep 17 00:00:00 2001 +From ddc959222f77f794667278d4935ce4d9bd812978 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 27 Oct 2014 15:23:51 +0000 -Subject: [PATCH 72/92] [rbp] Default extract thumbnails to false +Subject: [PATCH 72/93] [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 @@ -8727,10 +8725,11 @@ index b8e6e59..40be71e 100644
-From ce2871ebaa2f01d996b7f0a1b0f69adc306aba42 Mon Sep 17 00:00:00 2001 + +From c21c65bcc502754df2a1b80c484271fd4e9658b1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Nov 2014 17:16:54 +0000 -Subject: [PATCH 74/92] Revert "[omxplayer] Add ability to dump out audio/video +Subject: [PATCH 74/93] Revert "[omxplayer] Add ability to dump out audio/video data for later debugging" This reverts commit 417416bd29d00f1b42c77488d06e9e6840b8c4f4. @@ -8973,10 +8972,10 @@ index 852c70d..c68ac95 100644 void CAdvancedSettings::setExtraLogLevel(const std::vector &components) -From 5db668c093700c0ec4131403e39625827ac74aa4 Mon Sep 17 00:00:00 2001 +From 134a87f74011f0631e5d9a5a0bb8617dbdaf49a4 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 23:13:55 +0100 -Subject: [PATCH 75/92] [omxplayer] Add ability to dump out audio/video data +Subject: [PATCH 75/93] [omxplayer] Add ability to dump out audio/video data for later debugging --- @@ -9021,7 +9020,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 55729eb..23698c8 100644 +index de859e0..edd12ce 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp @@ -95,6 +95,61 @@ @@ -9125,10 +9124,10 @@ index c68ac95..852c70d 100644 void CAdvancedSettings::setExtraLogLevel(const std::vector &components) -From 1f6a0a9f07addf450eed60b718ece3a8ec825804 Mon Sep 17 00:00:00 2001 +From 9770ae35cc24e9c76fd03cf48b985bd3d24f9938 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 11 Nov 2014 18:14:23 +0000 -Subject: [PATCH 78/92] [resamplepi] Try to report the same numbers as ffmpeg +Subject: [PATCH 78/93] [resamplepi] Try to report the same numbers as ffmpeg --- .../cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp | 11 ++++++----- @@ -9179,19 +9178,19 @@ index 84505bf..2b5bef2 100644 CLog::Log(LOGINFO, "%s::%s = %d", CLASSNAME, __func__, ret); #endif -From 3dd9b3abdb96f41b5e39dae0fe595445043c0751 Mon Sep 17 00:00:00 2001 +From b3cfe38fdef756be18e4d7573438726d0252708f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 11 Nov 2014 20:49:30 +0000 -Subject: [PATCH 79/92] [dvdplayer] New scheme for PLL adjustment for video +Subject: [PATCH 79/93] [dvdplayer] New scheme for PLL adjustment for video clock --- - xbmc/cores/dvdplayer/DVDPlayerAudio.cpp | 56 ++++++++++++++++++++------------- + xbmc/cores/dvdplayer/DVDPlayerAudio.cpp | 45 +++++++++++++++------------------ xbmc/cores/dvdplayer/DVDPlayerAudio.h | 2 ++ - 2 files changed, 36 insertions(+), 22 deletions(-) + 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp b/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp -index 5e9a6d3..1e3a1ae 100644 +index 5e9a6d3..806aa1b 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp @@ -113,7 +113,9 @@ CDVDPlayerAudio::CDVDPlayerAudio(CDVDClock* pClock, CDVDMessageQueue& parent) @@ -9249,7 +9248,7 @@ index 5e9a6d3..1e3a1ae 100644 m_syncclock = false; return; -@@ -704,32 +715,33 @@ void CDVDPlayerAudio::HandleSyncError(double duration) +@@ -704,32 +715,18 @@ void CDVDPlayerAudio::HandleSyncError(double duration) proportional = m_error / DVD_TIME_BASE / proportionaldiv; } m_resampleratio = 1.0 / m_pClock->GetClockSpeed() + proportional + m_integral; @@ -9268,33 +9267,20 @@ index 5e9a6d3..1e3a1ae 100644 - - //on big errors use more proportional - if (fabs(m_error / DVD_TIME_BASE) > 0.0) -+ // PID control loop to reduce error through pll adjustment -+ double error = m_error / DVD_TIME_BASE; -+ double last_error = m_last_error / DVD_TIME_BASE; -+ double dt = 2.0; -+ double Ku = 5e-3; // ultimate gain -+ double Pu = 100.0; // oscillation period -+ double Kp = 0.6 * Ku; -+ double Ki = 2.0 * Kp / Pu; -+ double Kd = Kp * Pu / 8.0; -+ m_integral += error * dt; -+ double derivative = (error - last_error) / dt; -+ double output = Kp * error + Ki * m_integral + Kd * derivative; -+ m_plladjust = 1.0f + output; -+ // skip updating pll if difference is unexpectedly high - probably a glitch after seek/pause/loss -+ if (error - last_error < 2e-3) - { +- { - 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_last_plladjust = g_RBP.AdjustHDMIClock(m_plladjust); -+ CLog::Log(LOGDEBUG, "CDVDPlayerAudio::%s pll:%.5f (%.5f) error:%.3fms prop:%.6f int:%.6f der:%.6f", __FUNCTION__, m_plladjust, m_last_plladjust, error * 1e3, Kp * error , Ki * m_integral, Kd * derivative); - } +- } - 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; @@ -9315,1031 +9301,20 @@ index 02c64a0..37bf4bd 100644 struct SInfo { -From f81c5dead1fde5a80e16f199b7dfcea283c175ae Mon Sep 17 00:00:00 2001 -From: Thomas Amland -Date: Wed, 12 Nov 2014 13:20:55 +0100 -Subject: [PATCH 80/92] do database clean on thread - ---- - xbmc/Application.cpp | 6 ++---- - xbmc/video/VideoInfoScanner.cpp | 20 +++++++++++++++++++- - xbmc/video/VideoInfoScanner.h | 3 ++- - 3 files changed, 23 insertions(+), 6 deletions(-) - -diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index 009d425..4bba14d 100644 ---- a/xbmc/Application.cpp -+++ b/xbmc/Application.cpp -@@ -5646,17 +5646,15 @@ void CApplication::StartVideoCleanup(bool userInitiated /* = true */) - { - if (m_videoInfoScanner->IsScanning()) - return; -- -- m_videoInfoScanner->CleanDatabase(NULL, NULL, userInitiated); -+ m_videoInfoScanner->ShowDialog(userInitiated); -+ m_videoInfoScanner->StartLibraryClean(); - } - - void CApplication::StartVideoScan(const CStdString &strDirectory, bool userInitiated /* = true */, bool scanAll /* = false */) - { - if (m_videoInfoScanner->IsScanning()) - return; -- - m_videoInfoScanner->ShowDialog(userInitiated); -- - m_videoInfoScanner->Start(strDirectory,scanAll); - } - -diff --git a/xbmc/video/VideoInfoScanner.cpp b/xbmc/video/VideoInfoScanner.cpp -index 0d0ad66..cce627a 100644 ---- a/xbmc/video/VideoInfoScanner.cpp -+++ b/xbmc/video/VideoInfoScanner.cpp -@@ -76,10 +76,19 @@ namespace VIDEO - - void CVideoInfoScanner::Process() - { -+ if (m_bClean) -+ { -+ //Only clean, no scanning. -+ CleanDatabase(NULL, NULL, m_showDialog); -+ return; -+ } -+ - try - { - unsigned int tick = XbmcThreads::SystemClockMillis(); - -+ m_bClean = g_advancedSettings.m_bVideoLibraryCleanOnUpdate; -+ - m_database.Open(); - - if (m_showDialog && !CSettings::Get().GetBool("videolibrary.backgroundupdate")) -@@ -186,9 +195,18 @@ namespace VIDEO - m_pathsToScan.insert(it->second); - } - m_database.Close(); -- m_bClean = g_advancedSettings.m_bVideoLibraryCleanOnUpdate; -+ StopThread(); -+ m_bClean = false; -+ Create(); -+ m_bRunning = true; -+ } - -+ void CVideoInfoScanner::StartLibraryClean() -+ { -+ m_pathsToScan.clear(); -+ m_pathsToClean.clear(); - StopThread(); -+ m_bClean = true; - Create(); - m_bRunning = true; - } -diff --git a/xbmc/video/VideoInfoScanner.h b/xbmc/video/VideoInfoScanner.h -index 47d5ed4..68b90fa 100644 ---- a/xbmc/video/VideoInfoScanner.h -+++ b/xbmc/video/VideoInfoScanner.h -@@ -60,8 +60,8 @@ namespace VIDEO - */ - void Start(const CStdString& strDirectory, bool scanAll = false); - bool IsScanning(); -- void CleanDatabase(CGUIDialogProgressBarHandle* handle=NULL, const std::set* paths=NULL, bool showProgress=true); - void Stop(); -+ void StartLibraryClean(); - - //! \brief Set whether or not to show a progress dialog - void ShowDialog(bool show) { m_showDialog = show; } -@@ -126,6 +126,7 @@ namespace VIDEO - virtual void Process(); - bool DoScan(const CStdString& strDirectory); - bool IsExcluded(const CStdString& strDirectory) const; -+ void CleanDatabase(CGUIDialogProgressBarHandle* handle=NULL, const std::set* paths=NULL, bool showProgress=true); - - INFO_RET RetrieveInfoForTvShow(CFileItem *pItem, bool bDirNames, ADDON::ScraperPtr &scraper, bool useLocal, CScraperUrl* pURL, bool fetchEpisodes, CGUIDialogProgress* pDlgProgress); - INFO_RET RetrieveInfoForMovie(CFileItem *pItem, bool bDirNames, ADDON::ScraperPtr &scraper, bool useLocal, CScraperUrl* pURL, CGUIDialogProgress* pDlgProgress); - -From 5d3814998756c042af27cc048e5073a512c24c5e Mon Sep 17 00:00:00 2001 -From: Thomas Amland -Date: Wed, 12 Nov 2014 14:36:52 +0100 -Subject: [PATCH 81/92] use extended progress bar for library clean - ---- - xbmc/video/VideoDatabase.cpp | 50 +++++++---------------------------------- - xbmc/video/VideoDatabase.h | 2 +- - xbmc/video/VideoInfoScanner.cpp | 28 +++++++++++------------ - 3 files changed, 23 insertions(+), 57 deletions(-) - -diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp -index 9e54a34..4c41ab0 100644 ---- a/xbmc/video/VideoDatabase.cpp -+++ b/xbmc/video/VideoDatabase.cpp -@@ -7923,9 +7923,8 @@ void CVideoDatabase::GetMusicVideoDirectorsByName(const CStdString& strSearch, C - } - } - --void CVideoDatabase::CleanDatabase(CGUIDialogProgressBarHandle* handle, const set* paths, bool showProgress) -+void CVideoDatabase::CleanDatabase(CGUIDialogProgressBarHandle* handle, const set* paths, bool silent) - { -- CGUIDialogProgress *progress=NULL; - try - { - if (NULL == m_pDB.get()) return; -@@ -7960,21 +7959,7 @@ void CVideoDatabase::CleanDatabase(CGUIDialogProgressBarHandle* handle, const se - if (handle) - { - handle->SetTitle(g_localizeStrings.Get(700)); -- handle->SetText(""); -- } -- else if (showProgress) -- { -- progress = (CGUIDialogProgress *)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS); -- if (progress) -- { -- progress->SetHeading(700); -- progress->SetLine(0, ""); -- progress->SetLine(1, 313); -- progress->SetLine(2, 330); -- progress->SetPercentage(0); -- progress->StartModal(); -- progress->ShowProgressBar(true); -- } -+ handle->SetText(g_localizeStrings.Get(313)); - } - - std::string filesToTestForDelete; -@@ -8001,23 +7986,7 @@ void CVideoDatabase::CleanDatabase(CGUIDialogProgressBarHandle* handle, const se - if (URIUtils::IsOnDVD(fullPath) || !CFile::Exists(fullPath, false)) - filesToTestForDelete += m_pDS->fv("files.idFile").get_asString() + ","; - -- if (handle == NULL && progress != NULL) -- { -- int percentage = current * 100 / total; -- if (percentage > progress->GetPercentage()) -- { -- progress->SetPercentage(percentage); -- progress->Progress(); -- } -- if (progress->IsCanceled()) -- { -- progress->Close(); -- m_pDS->close(); -- ANNOUNCEMENT::CAnnouncementManager::Get().Announce(ANNOUNCEMENT::VideoLibrary, "xbmc", "OnCleanFinished"); -- return; -- } -- } -- else if (handle != NULL) -+ if (handle != NULL) - handle->SetPercentage(current * 100 / (float)total); - - m_pDS->next(); -@@ -8049,15 +8018,14 @@ void CVideoDatabase::CleanDatabase(CGUIDialogProgressBarHandle* handle, const se - { - StringUtils::TrimRight(filesToTestForDelete, ","); - -- movieIDs = CleanMediaType(MediaTypeMovie, filesToTestForDelete, pathsDeleteDecisions, filesToDelete, !showProgress); -- episodeIDs = CleanMediaType(MediaTypeEpisode, filesToTestForDelete, pathsDeleteDecisions, filesToDelete, !showProgress); -- musicVideoIDs = CleanMediaType(MediaTypeMusicVideo, filesToTestForDelete, pathsDeleteDecisions, filesToDelete, !showProgress); -+ movieIDs = CleanMediaType(MediaTypeMovie, filesToTestForDelete, pathsDeleteDecisions, filesToDelete, silent); -+ episodeIDs = CleanMediaType(MediaTypeEpisode, filesToTestForDelete, pathsDeleteDecisions, filesToDelete, silent); -+ musicVideoIDs = CleanMediaType(MediaTypeMusicVideo, filesToTestForDelete, pathsDeleteDecisions, filesToDelete, silent); - } - -- if (progress != NULL) -+ if (handle != NULL) - { -- progress->SetPercentage(100); -- progress->Progress(); -+ handle->SetPercentage(100); - } - - if (!filesToDelete.empty()) -@@ -8274,8 +8242,6 @@ void CVideoDatabase::CleanDatabase(CGUIDialogProgressBarHandle* handle, const se - CLog::Log(LOGERROR, "%s failed", __FUNCTION__); - RollbackTransaction(); - } -- if (progress) -- progress->Close(); - - ANNOUNCEMENT::CAnnouncementManager::Get().Announce(ANNOUNCEMENT::VideoLibrary, "xbmc", "OnCleanFinished"); - } -diff --git a/xbmc/video/VideoDatabase.h b/xbmc/video/VideoDatabase.h -index 1a79c00..352a2e8 100644 ---- a/xbmc/video/VideoDatabase.h -+++ b/xbmc/video/VideoDatabase.h -@@ -658,7 +658,7 @@ class CVideoDatabase : public CDatabase - bool HasContent(VIDEODB_CONTENT_TYPE type); - bool HasSets() const; - -- void CleanDatabase(CGUIDialogProgressBarHandle* handle=NULL, const std::set* paths=NULL, bool showProgress=true); -+ void CleanDatabase(CGUIDialogProgressBarHandle* handle=NULL, const std::set* paths=NULL, bool silent=false); - - /*! \brief Add a file to the database, if necessary - If the file is already in the database, we simply return its id. -diff --git a/xbmc/video/VideoInfoScanner.cpp b/xbmc/video/VideoInfoScanner.cpp -index cce627a..9e42a8f 100644 ---- a/xbmc/video/VideoInfoScanner.cpp -+++ b/xbmc/video/VideoInfoScanner.cpp -@@ -76,30 +76,30 @@ namespace VIDEO - - void CVideoInfoScanner::Process() - { -+ if (m_showDialog && !CSettings::Get().GetBool("videolibrary.backgroundupdate")) -+ { -+ CGUIDialogExtendedProgressBar* dialog = -+ (CGUIDialogExtendedProgressBar*)g_windowManager.GetWindow(WINDOW_DIALOG_EXT_PROGRESS); -+ if (dialog) -+ m_handle = dialog->GetHandle(g_localizeStrings.Get(314)); -+ } -+ - if (m_bClean) - { - //Only clean, no scanning. -- CleanDatabase(NULL, NULL, m_showDialog); -+ CleanDatabase(m_handle, NULL, m_showDialog); -+ if (m_handle) -+ m_handle->MarkFinished(); -+ m_handle = NULL; - return; - } - - try - { - unsigned int tick = XbmcThreads::SystemClockMillis(); -- - m_bClean = g_advancedSettings.m_bVideoLibraryCleanOnUpdate; -- -- m_database.Open(); -- -- if (m_showDialog && !CSettings::Get().GetBool("videolibrary.backgroundupdate")) -- { -- CGUIDialogExtendedProgressBar* dialog = -- (CGUIDialogExtendedProgressBar*)g_windowManager.GetWindow(WINDOW_DIALOG_EXT_PROGRESS); -- if (dialog) -- m_handle = dialog->GetHandle(g_localizeStrings.Get(314)); -- } -- - m_bCanInterrupt = true; -+ m_database.Open(); - - CLog::Log(LOGNOTICE, "VideoInfoScanner: Starting scan .."); - ANNOUNCEMENT::CAnnouncementManager::Get().Announce(ANNOUNCEMENT::VideoLibrary, "xbmc", "OnScanStarted"); -@@ -228,7 +228,7 @@ namespace VIDEO - { - m_bRunning = true; - m_database.Open(); -- m_database.CleanDatabase(handle, paths, showProgress); -+ m_database.CleanDatabase(handle, paths, !showProgress); - m_database.Close(); - m_bRunning = false; - } - -From 4c11cdb747bfea7c2bff995e2cd2846490ea4ed2 Mon Sep 17 00:00:00 2001 -From: fritsch -Date: Tue, 11 Nov 2014 21:34:44 +0100 -Subject: [PATCH 82/92] VAAPI: Use Component Logging - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp | 55 ++++++++++++++++---------- - 1 file changed, 35 insertions(+), 20 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp -index a5e560a..ed7bd74 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp -@@ -30,6 +30,7 @@ - #include "settings/Settings.h" - #include "guilib/GraphicContext.h" - #include "settings/MediaSettings.h" -+#include "settings/AdvancedSettings.h" - #include - - extern "C" { -@@ -142,7 +143,8 @@ bool CVAAPIContext::CreateContext() - return false; - } - -- CLog::Log(LOGDEBUG, "VAAPI - initialize version %d.%d", major_version, minor_version); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "VAAPI - initialize version %d.%d", major_version, minor_version); - - - QueryCaps(); -@@ -174,13 +176,16 @@ void CVAAPIContext::QueryCaps() - for(int i = 0; i < m_attributeCount; i++) - { - VADisplayAttribute * const display_attr = &m_attributes[i]; -- CLog::Log(LOGDEBUG, "VAAPI - attrib %d (%s/%s) min %d max %d value 0x%x\n" -- , display_attr->type -- ,(display_attr->flags & VA_DISPLAY_ATTRIB_GETTABLE) ? "get" : "---" -- ,(display_attr->flags & VA_DISPLAY_ATTRIB_SETTABLE) ? "set" : "---" -- , display_attr->min_value -- , display_attr->max_value -- , display_attr->value); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ { -+ CLog::Log(LOGDEBUG, "VAAPI - attrib %d (%s/%s) min %d max %d value 0x%x\n" -+ , display_attr->type -+ ,(display_attr->flags & VA_DISPLAY_ATTRIB_GETTABLE) ? "get" : "---" -+ ,(display_attr->flags & VA_DISPLAY_ATTRIB_SETTABLE) ? "set" : "---" -+ , display_attr->min_value -+ , display_attr->max_value -+ , display_attr->value); -+ } - } - - int max_profiles = vaMaxNumProfiles(m_display); -@@ -190,7 +195,10 @@ void CVAAPIContext::QueryCaps() - return; - - for(int i = 0; i < m_profileCount; i++) -- CLog::Log(LOGDEBUG, "VAAPI - profile %d", m_profiles[i]); -+ { -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "VAAPI - profile %d", m_profiles[i]); -+ } - } - - VAConfigAttrib CVAAPIContext::GetAttrib(VAProfile profile) -@@ -482,7 +490,8 @@ bool CDecoder::Open(AVCodecContext* avctx, const enum PixelFormat fmt, unsigned - if (CDVDVideoCodec::IsCodecDisabled(g_vaapi_available, settings_count, avctx->codec_id)) - return false; - -- CLog::Log(LOGDEBUG,"VAAPI - open decoder"); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG,"VAAPI - open decoder"); - - if (!CVAAPIContext::EnsureContext(&m_vaapiConfig.context, this)) - return false; -@@ -616,7 +625,8 @@ long CDecoder::Release() - if (m_vaapiConfigured == true) - { - CSingleLock lock(m_DecoderSection); -- CLog::Log(LOGDEBUG,"VAAPI::Release pre-cleanup"); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG,"VAAPI::Release pre-cleanup"); - - Message *reply; - if (m_vaapiOutput.m_controlPort.SendOutMessageSync(COutputControlProtocol::PRECLEANUP, -@@ -834,7 +844,8 @@ int CDecoder::Check(AVCodecContext* avctx) - - if (state == VAAPI_LOST) - { -- CLog::Log(LOGDEBUG,"VAAPI::Check waiting for display reset event"); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG,"VAAPI::Check waiting for display reset event"); - if (!m_DisplayEvent.WaitMSec(4000)) - { - CLog::Log(LOGERROR, "VAAPI::Check - device didn't reset in reasonable time"); -@@ -1071,7 +1082,8 @@ void CDecoder::FiniVAAPIOutput() - m_vaapiConfig.contextId = VA_INVALID_ID; - - // detroy surfaces -- CLog::Log(LOGDEBUG, "VAAPI::FiniVAAPIOutput destroying %d video surfaces", m_videoSurfaces.Size()); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "VAAPI::FiniVAAPIOutput destroying %d video surfaces", m_videoSurfaces.Size()); - VASurfaceID surf; - while((surf = m_videoSurfaces.RemoveNext()) != VA_INVALID_SURFACE) - { -@@ -1827,7 +1839,8 @@ void COutput::InitCycle() - } - else - { -- CLog::Log(LOGDEBUG,"VAAPI - deinterlace method not supported, falling back to BOB"); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG,"VAAPI - deinterlace method not supported, falling back to BOB"); - method = VS_INTERLACEMETHOD_RENDER_BOB; - } - -@@ -2073,7 +2086,8 @@ bool COutput::ProcessSyncPicture() - } - else - { -- CLog::Log(LOGDEBUG, "COutput::%s - return of invalid render pic", __FUNCTION__); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "COutput::%s - return of invalid render pic", __FUNCTION__); - } - } - return busy; -@@ -2177,8 +2191,8 @@ bool COutput::EnsureBufferPool() - } - - m_bufferPool.procPicId = 0; -- -- CLog::Log(LOGDEBUG, "VAAPI::COutput::InitBufferPool - Surfaces created"); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "VAAPI::COutput::InitBufferPool - Surfaces created"); - return true; - } - -@@ -2342,8 +2356,8 @@ bool COutput::CreateGlxContext() - CLog::Log(LOGERROR, "VAAPI::COutput::CreateGlxContext - Could not make Pixmap current"); - return false; - } -- -- CLog::Log(LOGDEBUG, "VAAPI::COutput::CreateGlxContext - created context"); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "VAAPI::COutput::CreateGlxContext - created context"); - return true; - } - -@@ -3047,7 +3061,8 @@ bool CFFmpegPostproc::Init(EINTERLACEMETHOD method) - else if (method == VS_INTERLACEMETHOD_RENDER_BOB || - method == VS_INTERLACEMETHOD_NONE) - { -- CLog::Log(LOGDEBUG, "CFFmpegPostproc::Init - skip deinterlacing"); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "CFFmpegPostproc::Init - skip deinterlacing"); - avfilter_inout_free(&outputs); - avfilter_inout_free(&inputs); - } - -From 93bf3176f2362d178b69b46bdb8257206ba91244 Mon Sep 17 00:00:00 2001 -From: fritsch -Date: Tue, 11 Nov 2014 21:37:16 +0100 -Subject: [PATCH 83/92] VDPAU: Component Logging - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 35 ++++++++++++++++++-------- - 1 file changed, 25 insertions(+), 10 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -index 5760fc5..ee0110f 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp -@@ -667,7 +667,8 @@ void CDecoder::SetWidthHeight(int width, int height) - m_vdpauConfig.outWidth = width; - m_vdpauConfig.outHeight = height; - } -- CLog::Log(LOGDEBUG, "CVDPAU::SetWidthHeight Setting OutWidth: %i OutHeight: %i", m_vdpauConfig.outWidth, m_vdpauConfig.outHeight); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "CVDPAU::SetWidthHeight Setting OutWidth: %i OutHeight: %i", m_vdpauConfig.outWidth, m_vdpauConfig.outHeight); - } - - void CDecoder::OnLostDevice() -@@ -807,7 +808,8 @@ void CDecoder::FiniVDPAUOutput() - return; - m_vdpauConfig.vdpDecoder = VDP_INVALID_HANDLE; - -- CLog::Log(LOGDEBUG, "CVDPAU::FiniVDPAUOutput destroying %d video surfaces", m_videoSurfaces.Size()); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "CVDPAU::FiniVDPAUOutput destroying %d video surfaces", m_videoSurfaces.Size()); - - VdpVideoSurface surf; - while((surf = m_videoSurfaces.RemoveNext()) != VDP_INVALID_HANDLE) -@@ -1047,7 +1049,10 @@ int CDecoder::Render(struct AVCodecContext *s, struct AVFrame *src, - - uint64_t diff = CurrentHostCounter() - startTime; - if (diff*1000/CurrentHostFrequency() > 30) -- CLog::Log(LOGDEBUG, "CVDPAU::DrawSlice - VdpDecoderRender long decoding: %d ms, dec: %d, proc: %d, rend: %d", (int)((diff*1000)/CurrentHostFrequency()), decoded, processed, rend); -+ { -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "CVDPAU::DrawSlice - VdpDecoderRender long decoding: %d ms, dec: %d, proc: %d, rend: %d", (int)((diff*1000)/CurrentHostFrequency()), decoded, processed, rend); -+ } - - return 0; - } -@@ -1161,7 +1166,10 @@ int CDecoder::Decode(AVCodecContext *avctx, AVFrame *pFrame) - m_bufferStats.SetParams(diff, m_codecControl); - } - if (diff*1000/CurrentHostFrequency() > 50) -- CLog::Log(LOGDEBUG,"CVDPAU::Decode long wait: %d", (int)((diff*1000)/CurrentHostFrequency())); -+ { -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG,"CVDPAU::Decode long wait: %d", (int)((diff*1000)/CurrentHostFrequency())); -+ } - - if (!retval) - { -@@ -2996,7 +3004,9 @@ void COutput::Flush() - it2 = m_bufferPool.glVideoSurfaceMap.find(pic->sourceIdx); - if (it2 == m_bufferPool.glVideoSurfaceMap.end()) - { -- CLog::Log(LOGDEBUG, "COutput::Flush - gl surface not found"); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "COutput::Flush - gl surface not found"); -+ - continue; - } - m_config.videoSurfaces->MarkRender(it2->second.sourceVuv); -@@ -3157,7 +3167,8 @@ bool COutput::ProcessSyncPicture() - } - else - { -- CLog::Log(LOGDEBUG, "COutput::%s - return of invalid render pic", __FUNCTION__); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "COutput::%s - return of invalid render pic", __FUNCTION__); - } - } - return busy; -@@ -3171,7 +3182,9 @@ void COutput::ProcessReturnPicture(CVdpauRenderPicture *pic) - it = m_bufferPool.glVideoSurfaceMap.find(pic->sourceIdx); - if (it == m_bufferPool.glVideoSurfaceMap.end()) - { -- CLog::Log(LOGDEBUG, "COutput::ProcessReturnPicture - gl surface not found"); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "COutput::ProcessReturnPicture - gl surface not found"); -+ - return; - } - #ifdef GL_NV_vdpau_interop -@@ -3186,7 +3199,9 @@ void COutput::ProcessReturnPicture(CVdpauRenderPicture *pic) - it = m_bufferPool.glOutputSurfaceMap.find(pic->sourceIdx); - if (it == m_bufferPool.glOutputSurfaceMap.end()) - { -- CLog::Log(LOGDEBUG, "COutput::ProcessReturnPicture - gl surface not found"); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "COutput::ProcessReturnPicture - gl surface not found"); -+ - return; - } - #ifdef GL_NV_vdpau_interop -@@ -3326,8 +3341,8 @@ void COutput::PreCleanup() - CheckStatus(vdp_st, __LINE__); - - m_bufferPool.outputSurfaces[i] = VDP_INVALID_HANDLE; -- -- CLog::Log(LOGDEBUG, "VDPAU::PreCleanup - released output surface"); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "VDPAU::PreCleanup - released output surface"); - } - - } - -From a88d8f0c00c51d796dd853055250c727e2be9f57 Mon Sep 17 00:00:00 2001 -From: fritsch -Date: Tue, 11 Nov 2014 21:49:45 +0100 -Subject: [PATCH 84/92] IMX: Use Component Logging - ---- - .../dvdplayer/DVDCodecs/Video/DVDVideoCodecIMX.cpp | 64 ++++++++++++++-------- - 1 file changed, 41 insertions(+), 23 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecIMX.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecIMX.cpp -index adbb27e..e8ccc67 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecIMX.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecIMX.cpp -@@ -29,6 +29,7 @@ - #include "threads/SingleLock.h" - #include "utils/log.h" - #include "DVDClock.h" -+#include "settings/AdvancedSettings.h" - #include "threads/Atomics.h" - - #define FRAME_ALIGN 16 -@@ -171,7 +172,8 @@ bool CDVDVideoCodecIMX::VpuOpen(void) - } - else - { -- CLog::Log(LOGDEBUG, "VPU Lib version : major.minor.rel=%d.%d.%d.\n", vpuVersion.nLibMajor, vpuVersion.nLibMinor, vpuVersion.nLibRelease); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "VPU Lib version : major.minor.rel=%d.%d.%d.\n", vpuVersion.nLibMajor, vpuVersion.nLibMinor, vpuVersion.nLibRelease); - } - - ret = VPU_DecQueryMem(&memInfo); -@@ -363,19 +365,23 @@ bool CDVDVideoCodecIMX::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) - } - - m_hints = hints; -- CLog::Log(LOGDEBUG, "Let's decode with iMX VPU\n"); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "Let's decode with iMX VPU\n"); - - #ifdef MEDIAINFO -- CLog::Log(LOGDEBUG, "Decode: MEDIAINFO: fpsrate %d / fpsscale %d\n", m_hints.fpsrate, m_hints.fpsscale); -- CLog::Log(LOGDEBUG, "Decode: MEDIAINFO: CodecID %d \n", m_hints.codec); -- CLog::Log(LOGDEBUG, "Decode: MEDIAINFO: StreamType %d \n", m_hints.type); -- CLog::Log(LOGDEBUG, "Decode: MEDIAINFO: Level %d \n", m_hints.level); -- CLog::Log(LOGDEBUG, "Decode: MEDIAINFO: Profile %d \n", m_hints.profile); -- CLog::Log(LOGDEBUG, "Decode: MEDIAINFO: PTS_invalid %d \n", m_hints.ptsinvalid); -- CLog::Log(LOGDEBUG, "Decode: MEDIAINFO: Tag %d \n", m_hints.codec_tag); -- CLog::Log(LOGDEBUG, "Decode: MEDIAINFO: %dx%d \n", m_hints.width, m_hints.height); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ { -+ CLog::Log(LOGDEBUG, "Decode: MEDIAINFO: fpsrate %d / fpsscale %d\n", m_hints.fpsrate, m_hints.fpsscale); -+ CLog::Log(LOGDEBUG, "Decode: MEDIAINFO: CodecID %d \n", m_hints.codec); -+ CLog::Log(LOGDEBUG, "Decode: MEDIAINFO: StreamType %d \n", m_hints.type); -+ CLog::Log(LOGDEBUG, "Decode: MEDIAINFO: Level %d \n", m_hints.level); -+ CLog::Log(LOGDEBUG, "Decode: MEDIAINFO: Profile %d \n", m_hints.profile); -+ CLog::Log(LOGDEBUG, "Decode: MEDIAINFO: PTS_invalid %d \n", m_hints.ptsinvalid); -+ CLog::Log(LOGDEBUG, "Decode: MEDIAINFO: Tag %d \n", m_hints.codec_tag); -+ CLog::Log(LOGDEBUG, "Decode: MEDIAINFO: %dx%d \n", m_hints.width, m_hints.height); -+ } - { uint8_t *pb = (uint8_t*)&m_hints.codec_tag; -- if (isalnum(pb[0]) && isalnum(pb[1]) && isalnum(pb[2]) && isalnum(pb[3])) -+ if ((isalnum(pb[0]) && isalnum(pb[1]) && isalnum(pb[2]) && isalnum(pb[3])) && g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "Decode: MEDIAINFO: Tag fourcc %c%c%c%c\n", pb[0], pb[1], pb[2], pb[3]); - } - if (m_hints.extrasize) -@@ -384,10 +390,15 @@ bool CDVDVideoCodecIMX::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) - - for (unsigned int i=0; i < m_hints.extrasize; i++) - sprintf(buf+i*2, "%02x", ((uint8_t*)m_hints.extradata)[i]); -- CLog::Log(LOGDEBUG, "Decode: MEDIAINFO: extradata %d %s\n", m_hints.extrasize, buf); -+ -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "Decode: MEDIAINFO: extradata %d %s\n", m_hints.extrasize, buf); -+ } -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ { -+ CLog::Log(LOGDEBUG, "Decode: MEDIAINFO: %d / %d \n", m_hints.width, m_hints.height); -+ CLog::Log(LOGDEBUG, "Decode: aspect %f - forced aspect %d\n", m_hints.aspect, m_hints.forced_aspect); - } -- CLog::Log(LOGDEBUG, "Decode: MEDIAINFO: %d / %d \n", m_hints.width, m_hints.height); -- CLog::Log(LOGDEBUG, "Decode: aspect %f - forced aspect %d\n", m_hints.aspect, m_hints.forced_aspect); - #endif - - m_convert_bitstream = false; -@@ -647,11 +658,14 @@ int CDVDVideoCodecIMX::Decode(BYTE *pData, int iSize, double dts, double pts) - ret = VPU_DecGetInitialInfo(m_vpuHandle, &m_initInfo); - if (ret == VPU_DEC_RET_SUCCESS) - { -- CLog::Log(LOGDEBUG, "%s - VPU Init Stream Info : %dx%d (interlaced : %d - Minframe : %d)"\ -- " - Align : %d bytes - crop : %d %d %d %d - Q16Ratio : %x\n", __FUNCTION__, -- m_initInfo.nPicWidth, m_initInfo.nPicHeight, m_initInfo.nInterlace, m_initInfo.nMinFrameBufferCount, -- m_initInfo.nAddressAlignment, m_initInfo.PicCropRect.nLeft, m_initInfo.PicCropRect.nTop, -- m_initInfo.PicCropRect.nRight, m_initInfo.PicCropRect.nBottom, m_initInfo.nQ16ShiftWidthDivHeightRatio); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ { -+ CLog::Log(LOGDEBUG, "%s - VPU Init Stream Info : %dx%d (interlaced : %d - Minframe : %d)"\ -+ " - Align : %d bytes - crop : %d %d %d %d - Q16Ratio : %x\n", __FUNCTION__, -+ m_initInfo.nPicWidth, m_initInfo.nPicHeight, m_initInfo.nInterlace, m_initInfo.nMinFrameBufferCount, -+ m_initInfo.nAddressAlignment, m_initInfo.PicCropRect.nLeft, m_initInfo.PicCropRect.nTop, -+ m_initInfo.PicCropRect.nRight, m_initInfo.PicCropRect.nBottom, m_initInfo.nQ16ShiftWidthDivHeightRatio); -+ } - if (VpuAllocFrameBuffers()) - { - ret = VPU_DecRegisterFrameBuffer(m_vpuHandle, m_vpuFrameBuffers, m_vpuFrameBufferNum); -@@ -744,11 +758,13 @@ int CDVDVideoCodecIMX::Decode(BYTE *pData, int iSize, double dts, double pts) - - if (decRet & VPU_DEC_OUTPUT_REPEAT) - { -- CLog::Log(LOGDEBUG, "%s - Frame repeat.\n", __FUNCTION__); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s - Frame repeat.\n", __FUNCTION__); - } - if (decRet & VPU_DEC_OUTPUT_DROPPED) - { -- CLog::Log(LOGDEBUG, "%s - Frame dropped.\n", __FUNCTION__); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s - Frame dropped.\n", __FUNCTION__); - } - if (decRet & VPU_DEC_NO_ENOUGH_BUF) - { -@@ -756,7 +772,8 @@ int CDVDVideoCodecIMX::Decode(BYTE *pData, int iSize, double dts, double pts) - } - if (decRet & VPU_DEC_SKIP) - { -- CLog::Log(LOGDEBUG, "%s - Frame skipped.\n", __FUNCTION__); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s - Frame skipped.\n", __FUNCTION__); - } - if (decRet & VPU_DEC_FLUSH) - { -@@ -823,7 +840,8 @@ void CDVDVideoCodecIMX::Reset() - { - int ret; - -- CLog::Log(LOGDEBUG, "%s - called\n", __FUNCTION__); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s - called\n", __FUNCTION__); - - // Release last buffer - if(m_lastBuffer) - -From 6a3eb895d2a83ce9682602268fd9eef11d9fac02 Mon Sep 17 00:00:00 2001 +From 39c78f921ce65d18078b301d73d917029492f46c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 12 Nov 2014 16:52:15 +0000 -Subject: [PATCH 85/92] MMAL: Use Component Logging +Subject: [PATCH 80/93] MMAL: Use Component Logging --- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 175 +++++++++------------ - 1 file changed, 78 insertions(+), 97 deletions(-) + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index c9c3839..6742e0e 100644 +index 5d65f4e..6742e0e 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -41,21 +41,17 @@ - #include "cores/VideoRenderers/RenderFlags.h" - #include "settings/DisplaySettings.h" - #include "cores/VideoRenderers/RenderManager.h" -+#include "settings/AdvancedSettings.h" - - #include "linux/RBP.h" - --#ifdef _DEBUG --#define MMAL_DEBUG_VERBOSE --#endif -- - #define CLASSNAME "CMMALVideoBuffer" - - CMMALVideoBuffer::CMMALVideoBuffer(CMMALVideo *omv) - : m_omv(omv), m_refs(0) - { --#if defined(MMAL_DEBUG_VERBOSE) -- CLog::Log(LOGDEBUG, "%s::%s %p", CLASSNAME, __func__, this); --#endif -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s %p", CLASSNAME, __func__, this); - mmal_buffer = NULL; - width = 0; - height = 0; -@@ -67,18 +63,16 @@ CMMALVideoBuffer::CMMALVideoBuffer(CMMALVideo *omv) - - CMMALVideoBuffer::~CMMALVideoBuffer() - { --#if defined(MMAL_DEBUG_VERBOSE) -- CLog::Log(LOGDEBUG, "%s::%s %p", CLASSNAME, __func__, this); --#endif -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s %p", CLASSNAME, __func__, this); - } - - - CMMALVideoBuffer* CMMALVideoBuffer::Acquire() - { - long count = AtomicIncrement(&m_refs); -- #if defined(MMAL_DEBUG_VERBOSE) -- CLog::Log(LOGDEBUG, "%s::%s %p (%p) ref:%ld", CLASSNAME, __func__, this, mmal_buffer, count); -- #endif -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s %p (%p) ref:%ld", CLASSNAME, __func__, this, mmal_buffer, count); - (void)count; - return this; - } -@@ -86,9 +80,8 @@ CMMALVideoBuffer* CMMALVideoBuffer::Acquire() - long CMMALVideoBuffer::Release() - { - long count = AtomicDecrement(&m_refs); --#if defined(MMAL_DEBUG_VERBOSE) --CLog::Log(LOGDEBUG, "%s::%s %p (%p) ref:%ld", CLASSNAME, __func__, this, mmal_buffer, count); --#endif -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s %p (%p) ref:%ld", CLASSNAME, __func__, this, mmal_buffer, count); - if (count == 0) - { - m_omv->ReleaseBuffer(this); -@@ -101,9 +94,8 @@ CLog::Log(LOGDEBUG, "%s::%s %p (%p) ref:%ld", CLASSNAME, __func__, this, mmal_bu - - CMMALVideo::CMMALVideo() - { -- #if defined(MMAL_DEBUG_VERBOSE) -- CLog::Log(LOGDEBUG, "%s::%s %p", CLASSNAME, __func__, this); -- #endif -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s %p", CLASSNAME, __func__, this); - pthread_mutex_init(&m_output_mutex, NULL); - - m_drop_state = false; -@@ -142,9 +134,8 @@ CMMALVideo::CMMALVideo() - - CMMALVideo::~CMMALVideo() - { -- #if defined(MMAL_DEBUG_VERBOSE) -- CLog::Log(LOGDEBUG, "%s::%s %p", CLASSNAME, __func__, this); -- #endif -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s %p", CLASSNAME, __func__, this); - assert(m_finished); - Reset(); - -@@ -205,7 +196,8 @@ void CMMALVideo::PortSettingsChanged(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *bu - m_aspect_ratio = (float)(m_es_format->es->video.par.num * m_es_format->es->video.crop.width) / (m_es_format->es->video.par.den * m_es_format->es->video.crop.height); - m_decoded_width = m_es_format->es->video.crop.width; - m_decoded_height = m_es_format->es->video.crop.height; -- CLog::Log(LOGDEBUG, "%s::%s format changed: %dx%d %.2f frame:%d", CLASSNAME, __func__, m_decoded_width, m_decoded_height, m_aspect_ratio, m_changed_count); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s format changed: %dx%d %.2f frame:%d", CLASSNAME, __func__, m_decoded_width, m_decoded_height, m_aspect_ratio, m_changed_count); - } - else - CLog::Log(LOGERROR, "%s::%s format changed: Unexpected %dx%d", CLASSNAME, __func__, m_es_format->es->video.crop.width, m_es_format->es->video.crop.height); -@@ -222,7 +214,8 @@ void CMMALVideo::dec_control_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *bu - } - else if (buffer->cmd == MMAL_EVENT_FORMAT_CHANGED) - { -- CLog::Log(LOGDEBUG, "%s::%s format changed", CLASSNAME, __func__); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s format changed", CLASSNAME, __func__); - PortSettingsChanged(port, buffer); - } - else -@@ -240,19 +233,18 @@ static void dec_control_port_cb_static(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T * - - static void dec_input_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer) - { --#if defined(MMAL_DEBUG_VERBOSE) -- CLog::Log(LOGDEBUG, "%s::%s port:%p buffer %p, len %d cmd:%x", CLASSNAME, __func__, port, buffer, buffer->length, buffer->cmd); --#endif -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s port:%p buffer %p, len %d cmd:%x", CLASSNAME, __func__, port, buffer, buffer->length, buffer->cmd); - mmal_buffer_header_release(buffer); - } - - - void CMMALVideo::dec_output_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer) - { --#if defined(MMAL_DEBUG_VERBOSE) - if (!(buffer->cmd == 0 && buffer->length > 0)) -- CLog::Log(LOGDEBUG, "%s::%s port:%p buffer %p, len %d cmd:%x", CLASSNAME, __func__, port, buffer, buffer->length, buffer->cmd); --#endif -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s port:%p buffer %p, len %d cmd:%x", CLASSNAME, __func__, port, buffer, buffer->length, buffer->cmd); -+ - bool kept = false; - - if (buffer->cmd == 0) -@@ -275,16 +267,16 @@ void CMMALVideo::dec_output_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buf - - if (m_drop_state) - { -- CLog::Log(LOGDEBUG, "%s::%s - dropping %p (drop:%d)", CLASSNAME, __func__, buffer, m_drop_state); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s - dropping %p (drop:%d)", CLASSNAME, __func__, buffer, m_drop_state); - } - else - { - CMMALVideoBuffer *omvb = new CMMALVideoBuffer(this); - m_output_busy++; --#if defined(MMAL_DEBUG_VERBOSE) -- CLog::Log(LOGDEBUG, "%s::%s - %p (%p) buffer_size(%u) dts:%.3f pts:%.3f flags:%x:%x frame:%d", -- CLASSNAME, __func__, buffer, omvb, buffer->length, dts*1e-6, buffer->pts*1e-6, buffer->flags, buffer->type->video.flags, omvb->m_changed_count); --#endif -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s - %p (%p) buffer_size(%u) dts:%.3f pts:%.3f flags:%x:%x frame:%d", -+ CLASSNAME, __func__, buffer, omvb, buffer->length, dts*1e-6, buffer->pts*1e-6, buffer->flags, buffer->type->video.flags, omvb->m_changed_count); - omvb->mmal_buffer = buffer; - buffer->user_data = (void *)omvb; - omvb->m_changed_count = m_changed_count; -@@ -316,7 +308,8 @@ static void dec_output_port_cb_static(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *b - bool CMMALVideo::change_dec_output_format() - { - MMAL_STATUS_T status; -- CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); - - MMAL_PARAMETER_VIDEO_INTERLACE_TYPE_T interlace_type = {{ MMAL_PARAMETER_VIDEO_INTERLACE_TYPE, sizeof( interlace_type )}}; - status = mmal_port_parameter_get( m_dec_output, &interlace_type.hdr ); -@@ -325,7 +318,8 @@ bool CMMALVideo::change_dec_output_format() - { - if (m_interlace_mode != interlace_type.eMode) - { -- CLog::Log(LOGDEBUG, "%s::%s Interlace mode %d->%d", CLASSNAME, __func__, m_interlace_mode, interlace_type.eMode); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s Interlace mode %d->%d", CLASSNAME, __func__, m_interlace_mode, interlace_type.eMode); - m_interlace_mode = interlace_type.eMode; - } - } -@@ -347,7 +341,8 @@ bool CMMALVideo::CreateDeinterlace(EINTERLACEMETHOD interlace_method) - { - MMAL_STATUS_T status; - -- CLog::Log(LOGDEBUG, "%s::%s method:%d", CLASSNAME, __func__, interlace_method); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s method:%d", CLASSNAME, __func__, interlace_method); - - assert(!m_deint); - assert(m_dec_output == m_dec->output[0]); -@@ -430,7 +425,8 @@ bool CMMALVideo::DestroyDeinterlace() - { - MMAL_STATUS_T status; - -- CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); - - assert(m_deint); - assert(m_dec_output == m_deint->output[0]); -@@ -498,9 +494,8 @@ bool CMMALVideo::SendCodecConfigData() - buffer->length = std::min(m_hints.extrasize, buffer->alloc_size); - memcpy(buffer->data, m_hints.extradata, buffer->length); - buffer->flags |= MMAL_BUFFER_HEADER_FLAG_FRAME_END | MMAL_BUFFER_HEADER_FLAG_CONFIG; --#if defined(MMAL_DEBUG_VERBOSE) -- CLog::Log(LOGDEBUG, "%s::%s - %-8p %-6d flags:%x", CLASSNAME, __func__, buffer, buffer->length, buffer->flags); --#endif -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s - %-8p %-6d flags:%x", CLASSNAME, __func__, buffer, buffer->length, buffer->flags); - status = mmal_port_send_buffer(m_dec_input, buffer); - if (status != MMAL_SUCCESS) - { -@@ -512,9 +507,8 @@ bool CMMALVideo::SendCodecConfigData() - - bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVideoPtr myself) - { -- #if defined(MMAL_DEBUG_VERBOSE) -- CLog::Log(LOGDEBUG, "%s::%s usemmal:%d software:%d %dx%d", CLASSNAME, __func__, CSettings::Get().GetBool("videoplayer.usemmal"), hints.software, hints.width, hints.height); -- #endif -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s usemmal:%d software:%d %dx%d", CLASSNAME, __func__, CSettings::Get().GetBool("videoplayer.usemmal"), hints.software, hints.width, hints.height); - - // we always qualify even if DVDFactoryCodec does this too. - if (!CSettings::Get().GetBool("videoplayer.usemmal") || hints.software) -@@ -720,9 +714,8 @@ void CMMALVideo::Dispose() - done = true; - m_finished = true; - pthread_mutex_unlock(&m_output_mutex); -- #if defined(MMAL_DEBUG_VERBOSE) -- 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); -- #endif -+ 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); - if (done) - { - assert(m_dts_queue.empty()); -@@ -732,10 +725,9 @@ void CMMALVideo::Dispose() - - void CMMALVideo::SetDropState(bool bDrop) - { --#if defined(MMAL_DEBUG_VERBOSE) - if (m_drop_state != bDrop) -- CLog::Log(LOGDEBUG, "%s::%s - m_drop_state(%d)", CLASSNAME, __func__, bDrop); --#endif -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s - m_drop_state(%d)", CLASSNAME, __func__, bDrop); - m_drop_state = bDrop; - if (m_drop_state) - { -@@ -760,10 +752,9 @@ void CMMALVideo::SetDropState(bool bDrop) - - int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - { -- #if defined(MMAL_DEBUG_VERBOSE) -- //CLog::Log(LOGDEBUG, "%s::%s - %-8p %-6d dts:%.3f pts:%.3f dts_queue(%d) ready_queue(%d) busy_queue(%d)", -- // CLASSNAME, __func__, pData, iSize, dts == DVD_NOPTS_VALUE ? 0.0 : dts*1e-6, pts == DVD_NOPTS_VALUE ? 0.0 : pts*1e-6, m_dts_queue.size(), m_output_ready.size(), m_output_busy); -- #endif -+ //if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ // CLog::Log(LOGDEBUG, "%s::%s - %-8p %-6d dts:%.3f pts:%.3f dts_queue(%d) ready_queue(%d) busy_queue(%d)", -+ // CLASSNAME, __func__, pData, iSize, dts == DVD_NOPTS_VALUE ? 0.0 : dts*1e-6, pts == DVD_NOPTS_VALUE ? 0.0 : pts*1e-6, m_dts_queue.size(), m_output_ready.size(), m_output_busy); - - unsigned int demuxer_bytes = 0; - uint8_t *demuxer_content = NULL; -@@ -849,10 +840,9 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - if (demuxer_bytes == 0) - buffer->flags |= MMAL_BUFFER_HEADER_FLAG_FRAME_END; - -- #if defined(MMAL_DEBUG_VERBOSE) -- CLog::Log(LOGDEBUG, "%s::%s - %-8p %-6d/%-6d dts:%.3f pts:%.3f flags:%x dts_queue(%d) ready_queue(%d) busy_queue(%d) demux_queue(%d) space(%d)", -- CLASSNAME, __func__, buffer, buffer->length, demuxer_bytes, dts == DVD_NOPTS_VALUE ? 0.0 : dts*1e-6, pts == DVD_NOPTS_VALUE ? 0.0 : pts*1e-6, buffer->flags, 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); -- #endif -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s - %-8p %-6d/%-6d dts:%.3f pts:%.3f flags:%x dts_queue(%d) ready_queue(%d) busy_queue(%d) demux_queue(%d) space(%d)", -+ CLASSNAME, __func__, buffer, buffer->length, demuxer_bytes, dts == DVD_NOPTS_VALUE ? 0.0 : dts*1e-6, pts == DVD_NOPTS_VALUE ? 0.0 : pts*1e-6, buffer->flags, 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); - assert((int)buffer->length > 0); - status = mmal_port_send_buffer(m_dec_input, buffer); - if (status != MMAL_SUCCESS) -@@ -879,7 +869,8 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - } - if (m_changed_count_dec != m_changed_count) - { -- CLog::Log(LOGDEBUG, "%s::%s format changed frame:%d(%d)", CLASSNAME, __func__, m_changed_count_dec, m_changed_count); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s format changed frame:%d(%d)", CLASSNAME, __func__, m_changed_count_dec, m_changed_count); - m_changed_count_dec = m_changed_count; - if (!change_dec_output_format()) - { -@@ -919,9 +910,8 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - int ret = 0; - if (mmal_queue_length(m_dec_input_pool->queue) > 0 && !m_demux_queue_length) - { -- #if defined(MMAL_DEBUG_VERBOSE) -- 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); -- #endif -+ 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_BUFFER; - } - else -@@ -932,14 +922,14 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - - if (!m_output_ready.empty() && !m_preroll) - { -- #if defined(MMAL_DEBUG_VERBOSE) -- CLog::Log(LOGDEBUG, "%s::%s - got output picture:%d", CLASSNAME, __func__, m_output_ready.size()); -- #endif -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s - got output picture:%d", CLASSNAME, __func__, m_output_ready.size()); - ret |= VC_PICTURE; - } - if (!ret) - { -- CLog::Log(LOGDEBUG, "%s::%s - Nothing to do: dts_queue(%d) ready_queue(%d) busy_queue(%d) demux_queue(%d) space(%d) preroll(%d)", -+ 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) 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 - } -@@ -948,9 +938,8 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - - void CMMALVideo::Reset(void) - { -- #if defined(MMAL_DEBUG_VERBOSE) -- CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); -- #endif -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); - - if (m_dec_input) - mmal_port_disable(m_dec_input); -@@ -989,35 +978,31 @@ void CMMALVideo::Reset(void) +@@ -978,9 +978,8 @@ void CMMALVideo::Reset(void) void CMMALVideo::SetSpeed(int iSpeed) { @@ -10351,423 +9326,11 @@ index c9c3839..6742e0e 100644 m_speed = iSpeed; } - - void CMMALVideo::ReturnBuffer(CMMALVideoBuffer *buffer) - { --#if defined(MMAL_DEBUG_VERBOSE) -- CLog::Log(LOGDEBUG, "%s::%s %p (%d)", CLASSNAME, __func__, buffer, m_output_busy); --#endif -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s %p (%d)", CLASSNAME, __func__, buffer, m_output_busy); - - mmal_buffer_header_release(buffer->mmal_buffer); - } - - void CMMALVideo::Recycle(MMAL_BUFFER_HEADER_T *buffer) - { --#if defined(MMAL_DEBUG_VERBOSE) -- CLog::Log(LOGDEBUG, "%s::%s %p", CLASSNAME, __func__, buffer); --#endif -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s %p", CLASSNAME, __func__, buffer); - - MMAL_STATUS_T status; - mmal_buffer_header_reset(buffer); - buffer->cmd = 0; -- #if defined(MMAL_DEBUG_VERBOSE) -- CLog::Log(LOGDEBUG, "%s::%s Send buffer %p from pool to decoder output port %p dts_queue(%d) ready_queue(%d) busy_queue(%d)", CLASSNAME, __func__, buffer, m_dec_output, -- m_dts_queue.size(), m_output_ready.size(), m_output_busy); -- #endif -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s Send buffer %p from pool to decoder output port %p dts_queue(%d) ready_queue(%d) busy_queue(%d)", CLASSNAME, __func__, buffer, m_dec_output, -+ m_dts_queue.size(), m_output_ready.size(), m_output_busy); - status = mmal_port_send_buffer(m_dec_output, buffer); - if (status != MMAL_SUCCESS) - { -@@ -1041,9 +1026,8 @@ void CMMALVideo::ReleaseBuffer(CMMALVideoBuffer *buffer) - pthread_mutex_unlock(&m_output_mutex); - if (done) - m_myself.reset(); -- #if defined(MMAL_DEBUG_VERBOSE) -- CLog::Log(LOGDEBUG, "%s::%s %p (%p) dts_queue(%d) ready_queue(%d) busy_queue(%d) done:%d", CLASSNAME, __func__, buffer, buffer->mmal_buffer, m_dts_queue.size(), m_output_ready.size(), m_output_busy, done); -- #endif -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s %p (%p) dts_queue(%d) ready_queue(%d) busy_queue(%d) done:%d", CLASSNAME, __func__, buffer, buffer->mmal_buffer, m_dts_queue.size(), m_output_ready.size(), m_output_busy, done); - delete buffer; - } - -@@ -1086,11 +1070,10 @@ bool CMMALVideo::GetPicture(DVDVideoPicture* pDvdVideoPicture) - - pDvdVideoPicture->MMALBuffer->Acquire(); - pDvdVideoPicture->iFlags = DVP_FLAG_ALLOCATED; --#if defined(MMAL_DEBUG_VERBOSE) -- CLog::Log(LOGINFO, "%s::%s dts:%.3f pts:%.3f flags:%x:%x MMALBuffer:%p mmal_buffer:%p", CLASSNAME, __func__, -- pDvdVideoPicture->dts == DVD_NOPTS_VALUE ? 0.0 : pDvdVideoPicture->dts*1e-6, pDvdVideoPicture->pts == DVD_NOPTS_VALUE ? 0.0 : pDvdVideoPicture->pts*1e-6, -- pDvdVideoPicture->iFlags, buffer->mmal_buffer->flags, pDvdVideoPicture->MMALBuffer, pDvdVideoPicture->MMALBuffer->mmal_buffer); --#endif -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGINFO, "%s::%s dts:%.3f pts:%.3f flags:%x:%x MMALBuffer:%p mmal_buffer:%p", CLASSNAME, __func__, -+ pDvdVideoPicture->dts == DVD_NOPTS_VALUE ? 0.0 : pDvdVideoPicture->dts*1e-6, pDvdVideoPicture->pts == DVD_NOPTS_VALUE ? 0.0 : pDvdVideoPicture->pts*1e-6, -+ pDvdVideoPicture->iFlags, buffer->mmal_buffer->flags, pDvdVideoPicture->MMALBuffer, pDvdVideoPicture->MMALBuffer->mmal_buffer); - assert(!(buffer->mmal_buffer->flags & MMAL_BUFFER_HEADER_FLAG_DECODEONLY)); - } - else -@@ -1111,9 +1094,8 @@ bool CMMALVideo::ClearPicture(DVDVideoPicture* pDvdVideoPicture) - { - if (pDvdVideoPicture->format == RENDER_FMT_MMAL) - { --#if defined(MMAL_DEBUG_VERBOSE) -- CLog::Log(LOGDEBUG, "%s::%s - %p (%p)", CLASSNAME, __func__, pDvdVideoPicture->MMALBuffer, pDvdVideoPicture->MMALBuffer->mmal_buffer); --#endif -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s - %p (%p)", CLASSNAME, __func__, pDvdVideoPicture->MMALBuffer, pDvdVideoPicture->MMALBuffer->mmal_buffer); - pDvdVideoPicture->MMALBuffer->Release(); - } - memset(pDvdVideoPicture, 0, sizeof *pDvdVideoPicture); -@@ -1125,8 +1107,7 @@ bool CMMALVideo::GetCodecStats(double &pts, int &droppedPics) - pts = m_decoderPts; - droppedPics = m_droppedPics; - m_droppedPics = 0; --#if defined(MMAL_DEBUG_VERBOSE) -- //CLog::Log(LOGDEBUG, "%s::%s - pts:%.0f droppedPics:%d", CLASSNAME, __func__, pts, droppedPics); --#endif -+ //if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ // CLog::Log(LOGDEBUG, "%s::%s - pts:%.0f droppedPics:%d", CLASSNAME, __func__, pts, droppedPics); - return true; - } -From 63c17d689572825c6f6dcc34dff2701e9f0fbada Mon Sep 17 00:00:00 2001 -From: arnova -Date: Wed, 12 Nov 2014 18:30:54 +0100 -Subject: [PATCH 86/92] changed: Have CurlFile return m_bufferSize as chunksize - ---- - xbmc/filesystem/CurlFile.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/xbmc/filesystem/CurlFile.h b/xbmc/filesystem/CurlFile.h -index 1cc7bc3..2e32367 100644 ---- a/xbmc/filesystem/CurlFile.h -+++ b/xbmc/filesystem/CurlFile.h -@@ -63,6 +63,7 @@ namespace XFILE - virtual std::string GetContent() { return GetMimeType(); } - virtual int IoControl(EIoControl request, void* param); - virtual std::string GetContentCharset(void) { return GetServerReportedCharset(); } -+ virtual int GetChunkSize(void) { return m_bufferSize; } - - bool Post(const std::string& strURL, const std::string& strPostData, std::string& strHTML); - bool Get(const std::string& strURL, std::string& strHTML); - -From 28b22302ff3127ff35e447cad6a022c91d6cd1a1 Mon Sep 17 00:00:00 2001 -From: arnova -Date: Tue, 11 Nov 2014 13:31:42 +0100 -Subject: [PATCH 87/92] fixed: FileCache-full logic was wrong + create seperate - IsCacheFull() functions - ---- - xbmc/filesystem/CacheStrategy.cpp | 10 ++++++++++ - xbmc/filesystem/CacheStrategy.h | 3 +++ - xbmc/filesystem/CircularCache.cpp | 12 ++++++++++++ - xbmc/filesystem/CircularCache.h | 1 + - xbmc/filesystem/FileCache.cpp | 10 ++-------- - xbmc/filesystem/FileCache.h | 1 - - xbmc/filesystem/MemBufferCache.cpp | 9 +++++++++ - xbmc/filesystem/MemBufferCache.h | 1 + - 8 files changed, 38 insertions(+), 9 deletions(-) - -diff --git a/xbmc/filesystem/CacheStrategy.cpp b/xbmc/filesystem/CacheStrategy.cpp -index acc86af..29d31e9 100644 ---- a/xbmc/filesystem/CacheStrategy.cpp -+++ b/xbmc/filesystem/CacheStrategy.cpp -@@ -126,6 +126,11 @@ void CSimpleFileCache::Close() - m_filename.clear(); - } - -+bool CSimpleFileCache::IsCacheFull(size_t iSize) -+{ -+ return m_bEndOfInput; // Never full, except when we hit eof -+} -+ - int CSimpleFileCache::WriteToCache(const char *pBuffer, size_t iSize) - { - size_t written = 0; -@@ -300,6 +305,11 @@ void CSimpleDoubleCache::Close() - } - } - -+bool CSimpleDoubleCache::IsCacheFull(size_t iSize) -+{ -+ return m_pCache->IsCacheFull(iSize); // NOTE: Check the active cache only -+} -+ - int CSimpleDoubleCache::WriteToCache(const char *pBuffer, size_t iSize) - { - return m_pCache->WriteToCache(pBuffer, iSize); -diff --git a/xbmc/filesystem/CacheStrategy.h b/xbmc/filesystem/CacheStrategy.h -index 9ea7274..69b9b38 100644 ---- a/xbmc/filesystem/CacheStrategy.h -+++ b/xbmc/filesystem/CacheStrategy.h -@@ -44,6 +44,7 @@ class CCacheStrategy{ - virtual int Open() = 0; - virtual void Close() = 0; - -+ virtual bool IsCacheFull(size_t iSize) = 0; - virtual int WriteToCache(const char *pBuffer, size_t iSize) = 0; - virtual int ReadFromCache(char *pBuffer, size_t iMaxSize) = 0; - virtual int64_t WaitForData(unsigned int iMinAvail, unsigned int iMillis) = 0; -@@ -76,6 +77,7 @@ class CSimpleFileCache : public CCacheStrategy { - virtual int Open() ; - virtual void Close() ; - -+ virtual bool IsCacheFull(size_t iSize); - virtual int WriteToCache(const char *pBuffer, size_t iSize) ; - virtual int ReadFromCache(char *pBuffer, size_t iMaxSize) ; - virtual int64_t WaitForData(unsigned int iMinAvail, unsigned int iMillis) ; -@@ -110,6 +112,7 @@ class CSimpleDoubleCache : public CCacheStrategy{ - virtual int Open() ; - virtual void Close() ; - -+ virtual bool IsCacheFull(size_t iSize); - virtual int WriteToCache(const char *pBuffer, size_t iSize) ; - virtual int ReadFromCache(char *pBuffer, size_t iMaxSize) ; - virtual int64_t WaitForData(unsigned int iMinAvail, unsigned int iMillis) ; -diff --git a/xbmc/filesystem/CircularCache.cpp b/xbmc/filesystem/CircularCache.cpp -index b9ae641..eb15306 100644 ---- a/xbmc/filesystem/CircularCache.cpp -+++ b/xbmc/filesystem/CircularCache.cpp -@@ -76,6 +76,18 @@ void CCircularCache::Close() - m_buf = NULL; - } - -+bool CCircularCache::IsCacheFull(size_t iSize) -+{ -+ CSingleLock lock(m_sync); -+ -+ size_t back = (size_t)(m_cur - m_beg); // Backbuffer size -+ size_t front = (size_t)(m_end - m_cur); // Frontbuffer size -+ size_t limit = m_size - std::min(back, m_size_back) - front; -+ -+ // Check if iSize (normally m_chunkSize) would fit in the cache -+ return (iSize > limit); -+} -+ - /** - * Function will write to m_buf at m_end % m_size location - * it will write at maximum m_size, but it will only write -diff --git a/xbmc/filesystem/CircularCache.h b/xbmc/filesystem/CircularCache.h -index ae9e9b9..8dd873d 100644 ---- a/xbmc/filesystem/CircularCache.h -+++ b/xbmc/filesystem/CircularCache.h -@@ -36,6 +36,7 @@ class CCircularCache : public CCacheStrategy - virtual int Open() ; - virtual void Close(); - -+ virtual bool IsCacheFull(size_t iSize); - virtual int WriteToCache(const char *buf, size_t len) ; - virtual int ReadFromCache(char *buf, size_t len) ; - virtual int64_t WaitForData(unsigned int minimum, unsigned int iMillis) ; -diff --git a/xbmc/filesystem/FileCache.cpp b/xbmc/filesystem/FileCache.cpp -index 50fe9b4..4e95d77 100644 ---- a/xbmc/filesystem/FileCache.cpp -+++ b/xbmc/filesystem/FileCache.cpp -@@ -103,7 +103,6 @@ CFileCache::CFileCache(bool useDoubleCache) : CThread("FileCache") - m_pCache = new CSimpleDoubleCache(m_pCache); - } - m_seekPossible = 0; -- m_cacheFull = false; - } - - CFileCache::CFileCache(CCacheStrategy *pCache, bool bDeleteCache) : CThread("FileCacheStrategy") -@@ -183,7 +182,6 @@ bool CFileCache::Open(const CURL& url) - m_writePos = 0; - m_writeRate = 1024 * 1024; - m_writeRateActual = 0; -- m_cacheFull = false; - m_seekEvent.Reset(); - m_seekEnded.Reset(); - -@@ -219,7 +217,7 @@ void CFileCache::Process() - { - m_seekEvent.Reset(); - int64_t cacheMaxPos = m_pCache->CachedDataEndPosIfSeekTo(m_seekPos); -- cacheReachEOF = cacheMaxPos == m_source.GetLength(); -+ cacheReachEOF = (cacheMaxPos == m_source.GetLength()); - bool sourceSeekFailed = false; - if (!cacheReachEOF) - { -@@ -239,7 +237,6 @@ void CFileCache::Process() - assert(m_writePos == cacheMaxPos); - average.Reset(m_writePos); - limiter.Reset(m_writePos); -- m_cacheFull = false; - m_nSeekResult = m_seekPos; - } - -@@ -300,13 +297,10 @@ void CFileCache::Process() - } - else if (iWrite == 0) - { -- m_cacheFull = true; - average.Pause(); - m_pCache->m_space.WaitMSec(5); - average.Resume(); - } -- else -- m_cacheFull = false; - - iTotalWrite += iWrite; - -@@ -503,7 +497,7 @@ int CFileCache::IoControl(EIoControl request, void* param) - status->forward = m_pCache->WaitForData(0, 0); - status->maxrate = m_writeRate; - status->currate = m_writeRateActual; -- status->full = m_cacheFull; -+ status->full = m_pCache->IsCacheFull(m_chunkSize); - return 0; - } - -diff --git a/xbmc/filesystem/FileCache.h b/xbmc/filesystem/FileCache.h -index a144cc1..a9177c0 100644 ---- a/xbmc/filesystem/FileCache.h -+++ b/xbmc/filesystem/FileCache.h -@@ -76,7 +76,6 @@ namespace XFILE - unsigned m_chunkSize; - unsigned m_writeRate; - unsigned m_writeRateActual; -- bool m_cacheFull; - CCriticalSection m_sync; - }; - -diff --git a/xbmc/filesystem/MemBufferCache.cpp b/xbmc/filesystem/MemBufferCache.cpp -index c430ce8..6414df1 100644 ---- a/xbmc/filesystem/MemBufferCache.cpp -+++ b/xbmc/filesystem/MemBufferCache.cpp -@@ -67,6 +67,15 @@ void MemBufferCache::Close() - m_forwardBuffer.Clear(); - } - -+bool MemBufferCache::IsCacheFull(size_t iSize) -+{ -+ CSingleLock lock(m_sync); -+ -+ // must also check the forward buffer. -+ // if we have leftovers from the previous seek - we need not read anymore until they are utilized -+ return !(m_buffer.getMaxWriteSize() < iSize || m_forwardBuffer.getMaxReadSize() > 0); -+} -+ - int MemBufferCache::WriteToCache(const char *pBuffer, size_t iSize) - { - CSingleLock lock(m_sync); -diff --git a/xbmc/filesystem/MemBufferCache.h b/xbmc/filesystem/MemBufferCache.h -index 5574a5b..6325e9b 100644 ---- a/xbmc/filesystem/MemBufferCache.h -+++ b/xbmc/filesystem/MemBufferCache.h -@@ -40,6 +40,7 @@ class MemBufferCache : public CCacheStrategy - virtual int Open() ; - virtual void Close(); - -+ virtual bool IsCacheFull(size_t iSize) ; - virtual int WriteToCache(const char *pBuffer, size_t iSize) ; - virtual int ReadFromCache(char *pBuffer, size_t iMaxSize) ; - virtual int64_t WaitForData(unsigned int iMinAvail, unsigned int iMillis) ; - -From 98f65f812bcd2e6356d1bcdf9eb126e7d22d3687 Mon Sep 17 00:00:00 2001 -From: arnova -Date: Wed, 12 Nov 2014 19:26:29 +0100 -Subject: [PATCH 88/92] fixed: Don't keep reading source when cache is full - (fixes #15500) - ---- - xbmc/filesystem/FileCache.cpp | 34 ++++++++++++++++++++-------------- - 1 file changed, 20 insertions(+), 14 deletions(-) - -diff --git a/xbmc/filesystem/FileCache.cpp b/xbmc/filesystem/FileCache.cpp -index 4e95d77..96b8d79 100644 ---- a/xbmc/filesystem/FileCache.cpp -+++ b/xbmc/filesystem/FileCache.cpp -@@ -262,24 +262,30 @@ void CFileCache::Process() - } - - ssize_t iRead = 0; -- if (!cacheReachEOF) -- iRead = m_source.Read(buffer.get(), m_chunkSize); -- if (iRead == 0) -+ /* Only read from source if there's enough write space in the cache -+ else we may keep disposing data and seeking back on (slow) source -+ */ -+ if (!m_pCache->IsCacheFull(m_chunkSize)) - { -- CLog::Log(LOGINFO, "CFileCache::Process - Hit eof."); -- m_pCache->EndOfInput(); -- -- // The thread event will now also cause the wait of an event to return a false. -- if (AbortableWait(m_seekEvent) == WAIT_SIGNALED) -+ if (!cacheReachEOF) -+ iRead = m_source.Read(buffer.get(), m_chunkSize); -+ if (iRead == 0) - { -- m_pCache->ClearEndOfInput(); -- m_seekEvent.Set(); // hack so that later we realize seek is needed -+ CLog::Log(LOGINFO, "CFileCache::Process - Hit eof."); -+ m_pCache->EndOfInput(); -+ -+ // The thread event will now also cause the wait of an event to return a false. -+ if (AbortableWait(m_seekEvent) == WAIT_SIGNALED) -+ { -+ m_pCache->ClearEndOfInput(); -+ m_seekEvent.Set(); // hack so that later we realize seek is needed -+ } -+ else -+ break; - } -- else -- break; -+ else if (iRead < 0) -+ m_bStop = true; - } -- else if (iRead < 0) -- m_bStop = true; - - int iTotalWrite=0; - while (!m_bStop && (iTotalWrite < iRead)) - -From 72078b7fbc2ec35eb83782804b22b583866f92fa Mon Sep 17 00:00:00 2001 -From: arnova -Date: Wed, 12 Nov 2014 21:22:40 +0100 -Subject: [PATCH 89/92] changed: Show cachebytes from input in dvdplayer info - as it's more intuitive - ---- - xbmc/cores/dvdplayer/DVDPlayer.cpp | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index 23698c8..7b5298a 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayer.cpp -+++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -2880,7 +2880,7 @@ void CDVDPlayer::GetGeneralInfo(std::string& strGeneralInfo) - if(m_StateInput.cache_bytes >= 0) - { - strBuf += StringUtils::Format(" cache:%s %2.0f%%" -- , StringUtils::SizeToString(m_State.cache_bytes).c_str() -+ , StringUtils::SizeToString(m_StateInput.cache_bytes).c_str() - , m_State.cache_level * 100); - if(m_playSpeed == 0 || m_caching == CACHESTATE_FULL) - strBuf += StringUtils::Format(" %d sec", DVD_TIME_TO_SEC(m_State.cache_delay)); -@@ -2916,7 +2916,7 @@ void CDVDPlayer::GetGeneralInfo(std::string& strGeneralInfo) - if(m_StateInput.cache_bytes >= 0) - { - strBuf += StringUtils::Format(" cache:%s %2.0f%%" -- , StringUtils::SizeToString(m_State.cache_bytes).c_str() -+ , StringUtils::SizeToString(m_StateInput.cache_bytes).c_str() - , m_State.cache_level * 100); - if(m_playSpeed == 0 || m_caching == CACHESTATE_FULL) - strBuf += StringUtils::Format(" %d sec", DVD_TIME_TO_SEC(m_State.cache_delay)); - -From bc2e08ea21dba4b40ec5470f0471921053aaede4 Mon Sep 17 00:00:00 2001 +From 0f41124101913efeb5523475b4d57f03a5d173ec Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 15 Nov 2014 12:01:26 +0000 -Subject: [PATCH 90/92] squash: stills: avoid deferencing null packet +Subject: [PATCH 81/93] squash: stills: avoid deferencing null packet --- xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 9 +++++++-- @@ -10801,10 +9364,10 @@ index c22ea9f..af369c0 100644 // reset the request, the following while loop may break before // setting the flag to a new value -From eb77209e08100babfff2f3436852b04c728888d2 Mon Sep 17 00:00:00 2001 +From c7552c924f39a590227b7ebf5f68c3ab23e54174 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 15 Nov 2014 12:03:34 +0000 -Subject: [PATCH 91/92] [dvdplayer] Add lock for player creation +Subject: [PATCH 82/93] [dvdplayer] Add lock for player creation --- xbmc/cores/dvdplayer/DVDPlayer.cpp | 3 +++ @@ -10812,7 +9375,7 @@ Subject: [PATCH 91/92] [dvdplayer] Add lock for player creation 2 files changed, 4 insertions(+) diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index 7b5298a..85a088b 100644 +index edd12ce..a102012 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:: @@ -10850,17 +9413,17 @@ index ef64076..7ea6ea6 100644 + CCriticalSection m_players_lock; }; -From b40f2d0a50c2131b12a30f672e54eb3ea3659575 Mon Sep 17 00:00:00 2001 +From aaf2abd84adb86d76bac29b657efc7a6659e7a6e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 15 Nov 2014 17:14:58 +0000 -Subject: [PATCH 92/92] [omxplayer] Fix for out of sync after trickplay +Subject: [PATCH 83/93] [omxplayer] Fix for out of sync after trickplay --- xbmc/cores/dvdplayer/DVDPlayer.cpp | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index 85a088b..5938d34 100644 +index a102012..6f5fc57 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp @@ -2427,7 +2427,24 @@ void CDVDPlayer::HandleMessages() @@ -10913,3 +9476,890 @@ index 85a088b..5938d34 100644 } else if (pMsg->IsType(CDVDMsg::PLAYER_CHANNEL_SELECT_NUMBER) && m_messenger.GetPacketCount(CDVDMsg::PLAYER_CHANNEL_SELECT_NUMBER) == 0) { + +From 9a861ec3cb5f914374261ebff79f0c7f5467077d Mon Sep 17 00:00:00 2001 +From: arnova +Date: Wed, 12 Nov 2014 18:30:54 +0100 +Subject: [PATCH 84/93] changed: Have CurlFile return m_bufferSize as chunksize + +--- + xbmc/filesystem/CurlFile.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/xbmc/filesystem/CurlFile.h b/xbmc/filesystem/CurlFile.h +index 1cc7bc3..2e32367 100644 +--- a/xbmc/filesystem/CurlFile.h ++++ b/xbmc/filesystem/CurlFile.h +@@ -63,6 +63,7 @@ namespace XFILE + virtual std::string GetContent() { return GetMimeType(); } + virtual int IoControl(EIoControl request, void* param); + virtual std::string GetContentCharset(void) { return GetServerReportedCharset(); } ++ virtual int GetChunkSize(void) { return m_bufferSize; } + + bool Post(const std::string& strURL, const std::string& strPostData, std::string& strHTML); + bool Get(const std::string& strURL, std::string& strHTML); + +From 333824c1e43dbea80e90e06a16c4373f482dcb9f Mon Sep 17 00:00:00 2001 +From: arnova +Date: Thu, 13 Nov 2014 18:34:03 +0100 +Subject: [PATCH 85/93] changed: Rename confusing CSimpleDoubleCache class to + CDoubleCache + +--- + xbmc/filesystem/CacheStrategy.cpp | 34 +++++++++++++++++----------------- + xbmc/filesystem/CacheStrategy.h | 6 +++--- + xbmc/filesystem/FileCache.cpp | 2 +- + 3 files changed, 21 insertions(+), 21 deletions(-) + +diff --git a/xbmc/filesystem/CacheStrategy.cpp b/xbmc/filesystem/CacheStrategy.cpp +index acc86af..cd19405 100644 +--- a/xbmc/filesystem/CacheStrategy.cpp ++++ b/xbmc/filesystem/CacheStrategy.cpp +@@ -272,25 +272,25 @@ CCacheStrategy *CSimpleFileCache::CreateNew() + } + + +-CSimpleDoubleCache::CSimpleDoubleCache(CCacheStrategy *impl) ++CDoubleCache::CDoubleCache(CCacheStrategy *impl) + { + assert(NULL != impl); + m_pCache = impl; + m_pCacheOld = NULL; + } + +-CSimpleDoubleCache::~CSimpleDoubleCache() ++CDoubleCache::~CDoubleCache() + { + delete m_pCache; + delete m_pCacheOld; + } + +-int CSimpleDoubleCache::Open() ++int CDoubleCache::Open() + { + return m_pCache->Open(); + } + +-void CSimpleDoubleCache::Close() ++void CDoubleCache::Close() + { + m_pCache->Close(); + if (m_pCacheOld) +@@ -300,27 +300,27 @@ void CSimpleDoubleCache::Close() + } + } + +-int CSimpleDoubleCache::WriteToCache(const char *pBuffer, size_t iSize) ++int CDoubleCache::WriteToCache(const char *pBuffer, size_t iSize) + { + return m_pCache->WriteToCache(pBuffer, iSize); + } + +-int CSimpleDoubleCache::ReadFromCache(char *pBuffer, size_t iMaxSize) ++int CDoubleCache::ReadFromCache(char *pBuffer, size_t iMaxSize) + { + return m_pCache->ReadFromCache(pBuffer, iMaxSize); + } + +-int64_t CSimpleDoubleCache::WaitForData(unsigned int iMinAvail, unsigned int iMillis) ++int64_t CDoubleCache::WaitForData(unsigned int iMinAvail, unsigned int iMillis) + { + return m_pCache->WaitForData(iMinAvail, iMillis); + } + +-int64_t CSimpleDoubleCache::Seek(int64_t iFilePosition) ++int64_t CDoubleCache::Seek(int64_t iFilePosition) + { + return m_pCache->Seek(iFilePosition); + } + +-void CSimpleDoubleCache::Reset(int64_t iSourcePosition, bool clearAnyway) ++void CDoubleCache::Reset(int64_t iSourcePosition, bool clearAnyway) + { + if (!clearAnyway && m_pCache->IsCachedPosition(iSourcePosition) + && (!m_pCacheOld || !m_pCacheOld->IsCachedPosition(iSourcePosition) +@@ -349,27 +349,27 @@ void CSimpleDoubleCache::Reset(int64_t iSourcePosition, bool clearAnyway) + m_pCache = tmp; + } + +-void CSimpleDoubleCache::EndOfInput() ++void CDoubleCache::EndOfInput() + { + m_pCache->EndOfInput(); + } + +-bool CSimpleDoubleCache::IsEndOfInput() ++bool CDoubleCache::IsEndOfInput() + { + return m_pCache->IsEndOfInput(); + } + +-void CSimpleDoubleCache::ClearEndOfInput() ++void CDoubleCache::ClearEndOfInput() + { + m_pCache->ClearEndOfInput(); + } + +-int64_t CSimpleDoubleCache::CachedDataEndPos() ++int64_t CDoubleCache::CachedDataEndPos() + { + return m_pCache->CachedDataEndPos(); + } + +-int64_t CSimpleDoubleCache::CachedDataEndPosIfSeekTo(int64_t iFilePosition) ++int64_t CDoubleCache::CachedDataEndPosIfSeekTo(int64_t iFilePosition) + { + int64_t ret = m_pCache->CachedDataEndPosIfSeekTo(iFilePosition); + if (m_pCacheOld) +@@ -377,13 +377,13 @@ int64_t CSimpleDoubleCache::CachedDataEndPosIfSeekTo(int64_t iFilePosition) + return ret; + } + +-bool CSimpleDoubleCache::IsCachedPosition(int64_t iFilePosition) ++bool CDoubleCache::IsCachedPosition(int64_t iFilePosition) + { + return m_pCache->IsCachedPosition(iFilePosition) || (m_pCacheOld && m_pCacheOld->IsCachedPosition(iFilePosition)); + } + +-CCacheStrategy *CSimpleDoubleCache::CreateNew() ++CCacheStrategy *CDoubleCache::CreateNew() + { +- return new CSimpleDoubleCache(m_pCache->CreateNew()); ++ return new CDoubleCache(m_pCache->CreateNew()); + } + +diff --git a/xbmc/filesystem/CacheStrategy.h b/xbmc/filesystem/CacheStrategy.h +index 9ea7274..2adb0fc 100644 +--- a/xbmc/filesystem/CacheStrategy.h ++++ b/xbmc/filesystem/CacheStrategy.h +@@ -102,10 +102,10 @@ class CSimpleFileCache : public CCacheStrategy { + volatile int64_t m_nReadPosition; + }; + +-class CSimpleDoubleCache : public CCacheStrategy{ ++class CDoubleCache : public CCacheStrategy{ + public: +- CSimpleDoubleCache(CCacheStrategy *impl); +- virtual ~CSimpleDoubleCache(); ++ CDoubleCache(CCacheStrategy *impl); ++ virtual ~CDoubleCache(); + + virtual int Open() ; + virtual void Close() ; +diff --git a/xbmc/filesystem/FileCache.cpp b/xbmc/filesystem/FileCache.cpp +index 50fe9b4..886621f 100644 +--- a/xbmc/filesystem/FileCache.cpp ++++ b/xbmc/filesystem/FileCache.cpp +@@ -100,7 +100,7 @@ CFileCache::CFileCache(bool useDoubleCache) : CThread("FileCache") + } + if (useDoubleCache) + { +- m_pCache = new CSimpleDoubleCache(m_pCache); ++ m_pCache = new CDoubleCache(m_pCache); + } + m_seekPossible = 0; + m_cacheFull = false; + +From 44dadf435af3562a9bd663e602dea2fc43be9395 Mon Sep 17 00:00:00 2001 +From: arnova +Date: Tue, 11 Nov 2014 13:31:42 +0100 +Subject: [PATCH 86/93] fixed: FileCache-full logic was wrong + implement + CanWriteToCache() function + +--- + xbmc/filesystem/CacheStrategy.cpp | 12 +++++++++++- + xbmc/filesystem/CacheStrategy.h | 3 +++ + xbmc/filesystem/CircularCache.cpp | 14 +++++++++++++- + xbmc/filesystem/CircularCache.h | 1 + + xbmc/filesystem/FileCache.cpp | 9 ++++----- + xbmc/filesystem/MemBufferCache.cpp | 11 ++++++++++- + xbmc/filesystem/MemBufferCache.h | 1 + + 7 files changed, 43 insertions(+), 8 deletions(-) + +diff --git a/xbmc/filesystem/CacheStrategy.cpp b/xbmc/filesystem/CacheStrategy.cpp +index cd19405..31e0644 100644 +--- a/xbmc/filesystem/CacheStrategy.cpp ++++ b/xbmc/filesystem/CacheStrategy.cpp +@@ -1,5 +1,5 @@ + /* +- * Copyright (C) 2005-2013 Team XBMC ++ * Copyright (C) 2005-2014 Team XBMC + * http://xbmc.org + * + * This Program is free software; you can redistribute it and/or modify +@@ -126,6 +126,11 @@ void CSimpleFileCache::Close() + m_filename.clear(); + } + ++bool CSimpleFileCache::CanWriteToCache(size_t iSize) ++{ ++ return true; // Can always write since it's a on disk ++} ++ + int CSimpleFileCache::WriteToCache(const char *pBuffer, size_t iSize) + { + size_t written = 0; +@@ -300,6 +305,11 @@ void CDoubleCache::Close() + } + } + ++bool CDoubleCache::CanWriteToCache(size_t iSize) ++{ ++ return m_pCache->CanWriteToCache(iSize); // NOTE: Check the active cache only ++} ++ + int CDoubleCache::WriteToCache(const char *pBuffer, size_t iSize) + { + return m_pCache->WriteToCache(pBuffer, iSize); +diff --git a/xbmc/filesystem/CacheStrategy.h b/xbmc/filesystem/CacheStrategy.h +index 2adb0fc..7ac4820 100644 +--- a/xbmc/filesystem/CacheStrategy.h ++++ b/xbmc/filesystem/CacheStrategy.h +@@ -44,6 +44,7 @@ class CCacheStrategy{ + virtual int Open() = 0; + virtual void Close() = 0; + ++ virtual bool CanWriteToCache(size_t iSize) = 0; + virtual int WriteToCache(const char *pBuffer, size_t iSize) = 0; + virtual int ReadFromCache(char *pBuffer, size_t iMaxSize) = 0; + virtual int64_t WaitForData(unsigned int iMinAvail, unsigned int iMillis) = 0; +@@ -76,6 +77,7 @@ class CSimpleFileCache : public CCacheStrategy { + virtual int Open() ; + virtual void Close() ; + ++ virtual bool CanWriteToCache(size_t iSize); + virtual int WriteToCache(const char *pBuffer, size_t iSize) ; + virtual int ReadFromCache(char *pBuffer, size_t iMaxSize) ; + virtual int64_t WaitForData(unsigned int iMinAvail, unsigned int iMillis) ; +@@ -110,6 +112,7 @@ class CDoubleCache : public CCacheStrategy{ + virtual int Open() ; + virtual void Close() ; + ++ virtual bool CanWriteToCache(size_t iSize); + virtual int WriteToCache(const char *pBuffer, size_t iSize) ; + virtual int ReadFromCache(char *pBuffer, size_t iMaxSize) ; + virtual int64_t WaitForData(unsigned int iMinAvail, unsigned int iMillis) ; +diff --git a/xbmc/filesystem/CircularCache.cpp b/xbmc/filesystem/CircularCache.cpp +index b9ae641..1268095 100644 +--- a/xbmc/filesystem/CircularCache.cpp ++++ b/xbmc/filesystem/CircularCache.cpp +@@ -1,5 +1,5 @@ + /* +- * Copyright (C) 2005-2013 Team XBMC ++ * Copyright (C) 2005-2014 Team XBMC + * http://xbmc.org + * + * This Program is free software; you can redistribute it and/or modify +@@ -76,6 +76,18 @@ void CCircularCache::Close() + m_buf = NULL; + } + ++bool CCircularCache::CanWriteToCache(size_t iSize) ++{ ++ CSingleLock lock(m_sync); ++ ++ size_t back = (size_t)(m_cur - m_beg); // Backbuffer size ++ size_t front = (size_t)(m_end - m_cur); // Frontbuffer size ++ size_t limit = m_size - std::min(back, m_size_back) - front; ++ ++ // Check if iSize (normally chunk-size) would fit in the cache ++ return (iSize <= limit); ++} ++ + /** + * Function will write to m_buf at m_end % m_size location + * it will write at maximum m_size, but it will only write +diff --git a/xbmc/filesystem/CircularCache.h b/xbmc/filesystem/CircularCache.h +index ae9e9b9..ff74f97 100644 +--- a/xbmc/filesystem/CircularCache.h ++++ b/xbmc/filesystem/CircularCache.h +@@ -36,6 +36,7 @@ class CCircularCache : public CCacheStrategy + virtual int Open() ; + virtual void Close(); + ++ virtual bool CanWriteToCache(size_t iSize); + virtual int WriteToCache(const char *buf, size_t len) ; + virtual int ReadFromCache(char *buf, size_t len) ; + virtual int64_t WaitForData(unsigned int minimum, unsigned int iMillis) ; +diff --git a/xbmc/filesystem/FileCache.cpp b/xbmc/filesystem/FileCache.cpp +index 886621f..f1c2d6d 100644 +--- a/xbmc/filesystem/FileCache.cpp ++++ b/xbmc/filesystem/FileCache.cpp +@@ -1,5 +1,5 @@ + /* +- * Copyright (C) 2005-2013 Team XBMC ++ * Copyright (C) 2005-2014 Team XBMC + * http://xbmc.org + * + * This Program is free software; you can redistribute it and/or modify +@@ -219,7 +219,7 @@ void CFileCache::Process() + { + m_seekEvent.Reset(); + int64_t cacheMaxPos = m_pCache->CachedDataEndPosIfSeekTo(m_seekPos); +- cacheReachEOF = cacheMaxPos == m_source.GetLength(); ++ cacheReachEOF = (cacheMaxPos == m_source.GetLength()); + bool sourceSeekFailed = false; + if (!cacheReachEOF) + { +@@ -264,7 +264,9 @@ void CFileCache::Process() + } + } + ++ m_cacheFull = !m_pCache->CanWriteToCache(m_chunkSize); + ssize_t iRead = 0; ++ + if (!cacheReachEOF) + iRead = m_source.Read(buffer.get(), m_chunkSize); + if (iRead == 0) +@@ -300,13 +302,10 @@ void CFileCache::Process() + } + else if (iWrite == 0) + { +- m_cacheFull = true; + average.Pause(); + m_pCache->m_space.WaitMSec(5); + average.Resume(); + } +- else +- m_cacheFull = false; + + iTotalWrite += iWrite; + +diff --git a/xbmc/filesystem/MemBufferCache.cpp b/xbmc/filesystem/MemBufferCache.cpp +index c430ce8..97e1bcb 100644 +--- a/xbmc/filesystem/MemBufferCache.cpp ++++ b/xbmc/filesystem/MemBufferCache.cpp +@@ -1,5 +1,5 @@ + /* +- * Copyright (C) 2005-2013 Team XBMC ++ * Copyright (C) 2005-2014 Team XBMC + * http://xbmc.org + * + * This Program is free software; you can redistribute it and/or modify +@@ -67,6 +67,15 @@ void MemBufferCache::Close() + m_forwardBuffer.Clear(); + } + ++bool MemBufferCache::CanWriteToCache(size_t iSize) ++{ ++ CSingleLock lock(m_sync); ++ ++ // must also check the forward buffer. ++ // if we have leftovers from the previous seek - we need not read anymore until they are utilized ++ return (m_buffer.getMaxWriteSize() < iSize || m_forwardBuffer.getMaxReadSize() > 0); ++} ++ + int MemBufferCache::WriteToCache(const char *pBuffer, size_t iSize) + { + CSingleLock lock(m_sync); +diff --git a/xbmc/filesystem/MemBufferCache.h b/xbmc/filesystem/MemBufferCache.h +index 5574a5b..0031de3 100644 +--- a/xbmc/filesystem/MemBufferCache.h ++++ b/xbmc/filesystem/MemBufferCache.h +@@ -40,6 +40,7 @@ class MemBufferCache : public CCacheStrategy + virtual int Open() ; + virtual void Close(); + ++ virtual bool CanWriteToCache(size_t iSize) ; + virtual int WriteToCache(const char *pBuffer, size_t iSize) ; + virtual int ReadFromCache(char *pBuffer, size_t iMaxSize) ; + virtual int64_t WaitForData(unsigned int iMinAvail, unsigned int iMillis) ; + +From f78976eeac3f103b29d3eef2b38ff92b8c337c9d Mon Sep 17 00:00:00 2001 +From: arnova +Date: Wed, 12 Nov 2014 19:26:29 +0100 +Subject: [PATCH 87/93] fixed: Don't keep reading source when cache is full + (fixes #15500) + +--- + xbmc/filesystem/FileCache.cpp | 35 ++++++++++++++++++++--------------- + 1 file changed, 20 insertions(+), 15 deletions(-) + +diff --git a/xbmc/filesystem/FileCache.cpp b/xbmc/filesystem/FileCache.cpp +index f1c2d6d..849f4b3 100644 +--- a/xbmc/filesystem/FileCache.cpp ++++ b/xbmc/filesystem/FileCache.cpp +@@ -266,25 +266,30 @@ void CFileCache::Process() + + m_cacheFull = !m_pCache->CanWriteToCache(m_chunkSize); + ssize_t iRead = 0; +- +- if (!cacheReachEOF) +- iRead = m_source.Read(buffer.get(), m_chunkSize); +- if (iRead == 0) ++ /* Only read from source if there's enough write space in the cache ++ else we may keep disposing data and seeking back on (slow) source ++ */ ++ if (!m_cacheFull) + { +- CLog::Log(LOGINFO, "CFileCache::Process - Hit eof."); +- m_pCache->EndOfInput(); +- +- // The thread event will now also cause the wait of an event to return a false. +- if (AbortableWait(m_seekEvent) == WAIT_SIGNALED) ++ if (!cacheReachEOF) ++ iRead = m_source.Read(buffer.get(), m_chunkSize); ++ if (iRead == 0) + { +- m_pCache->ClearEndOfInput(); +- m_seekEvent.Set(); // hack so that later we realize seek is needed ++ CLog::Log(LOGINFO, "CFileCache::Process - Hit eof."); ++ m_pCache->EndOfInput(); ++ ++ // The thread event will now also cause the wait of an event to return a false. ++ if (AbortableWait(m_seekEvent) == WAIT_SIGNALED) ++ { ++ m_pCache->ClearEndOfInput(); ++ m_seekEvent.Set(); // hack so that later we realize seek is needed ++ } ++ else ++ break; + } +- else +- break; ++ else if (iRead < 0) ++ m_bStop = true; + } +- else if (iRead < 0) +- m_bStop = true; + + int iTotalWrite=0; + while (!m_bStop && (iTotalWrite < iRead)) + +From 66be7b9ae0b2aa8e318f8113b215ff501da47a80 Mon Sep 17 00:00:00 2001 +From: arnova +Date: Wed, 12 Nov 2014 21:22:40 +0100 +Subject: [PATCH 88/93] changed: Use m_StateInput else dvdplayer osd info is 8 + seconds delayed + +--- + xbmc/cores/dvdplayer/DVDPlayer.cpp | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp +index 6f5fc57..4f15056 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayer.cpp ++++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp +@@ -2882,10 +2882,10 @@ void CDVDPlayer::GetGeneralInfo(std::string& strGeneralInfo) + if(m_StateInput.cache_bytes >= 0) + { + strBuf += StringUtils::Format(" cache:%s %2.0f%%" +- , StringUtils::SizeToString(m_State.cache_bytes).c_str() +- , m_State.cache_level * 100); ++ , StringUtils::SizeToString(m_StateInput.cache_bytes).c_str() ++ , m_StateInput.cache_level * 100); + if(m_playSpeed == 0 || m_caching == CACHESTATE_FULL) +- strBuf += StringUtils::Format(" %d sec", DVD_TIME_TO_SEC(m_State.cache_delay)); ++ strBuf += StringUtils::Format(" %d sec", DVD_TIME_TO_SEC(m_StateInput.cache_delay)); + } + + strGeneralInfo = StringUtils::Format("C( ad:% 6.3f, a/v:% 6.3f%s, dcpu:%2i%% acpu:%2i%% vcpu:%2i%%%s af:%d%% vf:%d%% amp:% 5.2f )" +@@ -2918,10 +2918,10 @@ void CDVDPlayer::GetGeneralInfo(std::string& strGeneralInfo) + if(m_StateInput.cache_bytes >= 0) + { + strBuf += StringUtils::Format(" cache:%s %2.0f%%" +- , StringUtils::SizeToString(m_State.cache_bytes).c_str() +- , m_State.cache_level * 100); ++ , StringUtils::SizeToString(m_StateInput.cache_bytes).c_str() ++ , m_StateInput.cache_level * 100); + if(m_playSpeed == 0 || m_caching == CACHESTATE_FULL) +- strBuf += StringUtils::Format(" %d sec", DVD_TIME_TO_SEC(m_State.cache_delay)); ++ strBuf += StringUtils::Format(" %d sec", DVD_TIME_TO_SEC(m_StateInput.cache_delay)); + } + + strGeneralInfo = StringUtils::Format("C( ad:% 6.3f, a/v:% 6.3f%s, dcpu:%2i%% acpu:%2i%% vcpu:%2i%%%s )" + +From dfe711619e8733365ced01ff2a113fa6e14ee7b3 Mon Sep 17 00:00:00 2001 +From: arnova +Date: Sun, 16 Nov 2014 15:35:20 +0100 +Subject: [PATCH 89/93] fixed: Calling WaitForData with full cache caused it to + always block the max. of 5 seconds + +--- + xbmc/filesystem/CircularCache.cpp | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/xbmc/filesystem/CircularCache.cpp b/xbmc/filesystem/CircularCache.cpp +index 1268095..f201c26 100644 +--- a/xbmc/filesystem/CircularCache.cpp ++++ b/xbmc/filesystem/CircularCache.cpp +@@ -209,6 +209,11 @@ int64_t CCircularCache::Seek(int64_t pos) + // we try to avoid a (heavy) seek on the source + if (pos >= m_end && pos < m_end + 100000) + { ++ /* Make everything in the cache (back & forward), back-cache, to make sure ++ * there's sufficient forward space. Increasing it with only 100000 may not be ++ * sufficient due to variable filesystem chunksize ++ */ ++ m_cur = m_end; + lock.Leave(); + WaitForData((size_t)(pos - m_cur), 5000); + lock.Enter(); + +From 7988110c81f8e7a11a09168132a8dab4c96aeebb Mon Sep 17 00:00:00 2001 +From: Memphiz +Date: Mon, 17 Nov 2014 09:13:36 +0100 +Subject: [PATCH 90/93] - fix premature close of pipe. It should only be closed + if refcount is zero + +--- + xbmc/filesystem/PipesManager.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/filesystem/PipesManager.cpp b/xbmc/filesystem/PipesManager.cpp +index 7389abf..e84fb08 100644 +--- a/xbmc/filesystem/PipesManager.cpp ++++ b/xbmc/filesystem/PipesManager.cpp +@@ -318,9 +318,9 @@ void PipesManager::ClosePipe(XFILE::Pipe *pipe) + return ; + + pipe->DecRef(); +- pipe->Close(); + if (pipe->RefCount() == 0) + { ++ pipe->Close(); + m_pipes.erase(pipe->GetName()); + delete pipe; + } + +From c3331217710cf0f350afa28c0551f272a3fc193c Mon Sep 17 00:00:00 2001 +From: montellese +Date: Sun, 16 Nov 2014 14:16:10 +0100 +Subject: [PATCH 91/93] video library: add the possibility to clean the + database in the background + +--- + xbmc/Application.cpp | 8 +++++++- + xbmc/settings/MediaSettings.cpp | 2 +- + xbmc/video/VideoInfoScanner.cpp | 36 ++++++++++++++++++++++++++++++++---- + xbmc/video/VideoInfoScanner.h | 1 + + 4 files changed, 41 insertions(+), 6 deletions(-) + +diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp +index 21039d8..908d036 100644 +--- a/xbmc/Application.cpp ++++ b/xbmc/Application.cpp +@@ -5652,7 +5652,13 @@ void CApplication::StartVideoCleanup(bool userInitiated /* = true */) + if (m_videoInfoScanner->IsScanning()) + return; + +- m_videoInfoScanner->CleanDatabase(NULL, NULL, userInitiated); ++ if (userInitiated) ++ m_videoInfoScanner->CleanDatabase(NULL, NULL, true); ++ else ++ { ++ m_videoInfoScanner->ShowDialog(false); ++ m_videoInfoScanner->StartCleanDatabase(); ++ } + } + + void CApplication::StartVideoScan(const CStdString &strDirectory, bool userInitiated /* = true */, bool scanAll /* = false */) +diff --git a/xbmc/settings/MediaSettings.cpp b/xbmc/settings/MediaSettings.cpp +index 57d6ab4..6b29fe7 100644 +--- a/xbmc/settings/MediaSettings.cpp ++++ b/xbmc/settings/MediaSettings.cpp +@@ -336,7 +336,7 @@ void CMediaSettings::OnSettingAction(const CSetting *setting) + else if (settingId == "videolibrary.cleanup") + { + if (CGUIDialogYesNo::ShowAndGetInput(313, 333, 0, 0)) +- g_application.StartVideoCleanup(); ++ g_application.StartVideoCleanup(true); + } + else if (settingId == "videolibrary.export") + CBuiltins::Execute("exportlibrary(video)"); +diff --git a/xbmc/video/VideoInfoScanner.cpp b/xbmc/video/VideoInfoScanner.cpp +index 0d0ad66..3eda0e0 100644 +--- a/xbmc/video/VideoInfoScanner.cpp ++++ b/xbmc/video/VideoInfoScanner.cpp +@@ -78,10 +78,6 @@ namespace VIDEO + { + try + { +- unsigned int tick = XbmcThreads::SystemClockMillis(); +- +- m_database.Open(); +- + if (m_showDialog && !CSettings::Get().GetBool("videolibrary.backgroundupdate")) + { + CGUIDialogExtendedProgressBar* dialog = +@@ -90,6 +86,24 @@ namespace VIDEO + m_handle = dialog->GetHandle(g_localizeStrings.Get(314)); + } + ++ // check if we only need to perform a cleaning ++ if (m_bClean && m_pathsToScan.empty()) ++ { ++ CleanDatabase(m_handle, NULL, false); ++ ++ if (m_handle) ++ m_handle->MarkFinished(); ++ m_handle = NULL; ++ ++ m_bRunning = false; ++ ++ return; ++ } ++ ++ unsigned int tick = XbmcThreads::SystemClockMillis(); ++ ++ m_database.Open(); ++ + m_bCanInterrupt = true; + + CLog::Log(LOGNOTICE, "VideoInfoScanner: Starting scan .."); +@@ -193,6 +207,20 @@ namespace VIDEO + m_bRunning = true; + } + ++ void CVideoInfoScanner::StartCleanDatabase() ++ { ++ m_strStartDir.clear(); ++ m_scanAll = false; ++ m_pathsToScan.clear(); ++ m_pathsToClean.clear(); ++ ++ m_bClean = true; ++ ++ StopThread(); ++ Create(); ++ m_bRunning = true; ++ } ++ + bool CVideoInfoScanner::IsScanning() + { + return m_bRunning; +diff --git a/xbmc/video/VideoInfoScanner.h b/xbmc/video/VideoInfoScanner.h +index 47d5ed4..a0f9d53 100644 +--- a/xbmc/video/VideoInfoScanner.h ++++ b/xbmc/video/VideoInfoScanner.h +@@ -59,6 +59,7 @@ namespace VIDEO + \param scanAll whether to scan everything not already scanned (regardless of whether the user normally doesn't want a folder scanned.) Defaults to false. + */ + void Start(const CStdString& strDirectory, bool scanAll = false); ++ void StartCleanDatabase(); + bool IsScanning(); + void CleanDatabase(CGUIDialogProgressBarHandle* handle=NULL, const std::set* paths=NULL, bool showProgress=true); + void Stop(); + +From 1e15299ce38a645b285578733cf4e71976e8020d Mon Sep 17 00:00:00 2001 +From: montellese +Date: Sun, 16 Nov 2014 15:58:00 +0100 +Subject: [PATCH 92/93] music library: add the possibility to clean the + database in the background + +--- + xbmc/Application.cpp | 14 +++++++++++ + xbmc/Application.h | 6 +++++ + xbmc/interfaces/Builtins.cpp | 8 +----- + xbmc/music/infoscanner/MusicInfoScanner.cpp | 38 ++++++++++++++++++++++++++++- + xbmc/music/infoscanner/MusicInfoScanner.h | 3 +++ + xbmc/settings/MediaSettings.cpp | 5 ++-- + 6 files changed, 63 insertions(+), 11 deletions(-) + +diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp +index 908d036..9ccdbbc 100644 +--- a/xbmc/Application.cpp ++++ b/xbmc/Application.cpp +@@ -5671,6 +5671,20 @@ void CApplication::StartVideoScan(const CStdString &strDirectory, bool userIniti + m_videoInfoScanner->Start(strDirectory,scanAll); + } + ++void CApplication::StartMusicCleanup(bool userInitiated /* = true */) ++{ ++ if (m_musicInfoScanner->IsScanning()) ++ return; ++ ++ if (userInitiated) ++ m_musicInfoScanner->CleanDatabase(true); ++ else ++ { ++ m_musicInfoScanner->ShowDialog(false); ++ m_musicInfoScanner->StartCleanDatabase(); ++ } ++} ++ + void CApplication::StartMusicScan(const CStdString &strDirectory, bool userInitiated /* = true */, int flags /* = 0 */) + { + if (m_musicInfoScanner->IsScanning()) +diff --git a/xbmc/Application.h b/xbmc/Application.h +index fd8908a..15efc90 100644 +--- a/xbmc/Application.h ++++ b/xbmc/Application.h +@@ -260,6 +260,12 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs + void StartVideoScan(const CStdString &path, bool userInitiated = true, bool scanAll = false); + + /*! ++ \brief Starts a music library cleanup. ++ \param userInitiated Whether the action was initiated by the user (either via GUI or any other method) or not. It is meant to hide or show dialogs. ++ */ ++ void StartMusicCleanup(bool userInitiated = true); ++ ++ /*! + \brief Starts a music library update. + \param path The path to scan or "" (empty string) for a global scan. + \param userInitiated Whether the action was initiated by the user (either via GUI or any other method) or not. It is meant to hide or show dialogs. +diff --git a/xbmc/interfaces/Builtins.cpp b/xbmc/interfaces/Builtins.cpp +index ba3052c..d99f047 100644 +--- a/xbmc/interfaces/Builtins.cpp ++++ b/xbmc/interfaces/Builtins.cpp +@@ -1470,13 +1470,7 @@ int CBuiltins::Execute(const std::string& execString) + else if (StringUtils::EqualsNoCase(params[0], "music")) + { + if (!g_application.IsMusicScanning()) +- { +- CMusicDatabase musicdatabase; +- +- musicdatabase.Open(); +- musicdatabase.Cleanup(userInitiated); +- musicdatabase.Close(); +- } ++ g_application.StartMusicCleanup(userInitiated); + else + CLog::Log(LOGERROR, "CleanLibrary is not possible while scanning for media info"); + } +diff --git a/xbmc/music/infoscanner/MusicInfoScanner.cpp b/xbmc/music/infoscanner/MusicInfoScanner.cpp +index 5e39b73..38fe565 100644 +--- a/xbmc/music/infoscanner/MusicInfoScanner.cpp ++++ b/xbmc/music/infoscanner/MusicInfoScanner.cpp +@@ -82,6 +82,14 @@ void CMusicInfoScanner::Process() + ANNOUNCEMENT::CAnnouncementManager::Get().Announce(ANNOUNCEMENT::AudioLibrary, "xbmc", "OnScanStarted"); + try + { ++ if (m_bClean) ++ { ++ CleanDatabase(false); ++ m_bRunning = false; ++ ++ return; ++ } ++ + unsigned int tick = XbmcThreads::SystemClockMillis(); + + m_musicDatabase.Open(); +@@ -94,6 +102,8 @@ void CMusicInfoScanner::Process() + m_handle = dialog->GetHandle(g_localizeStrings.Get(314)); + } + ++ m_bClean = g_advancedSettings.m_bMusicLibraryCleanOnUpdate; ++ + m_bCanInterrupt = true; + + if (m_scanType == 0) // load info from files +@@ -267,7 +277,21 @@ void CMusicInfoScanner::Start(const CStdString& strDirectory, int flags) + } + else + m_pathsToScan.insert(strDirectory); +- m_bClean = g_advancedSettings.m_bMusicLibraryCleanOnUpdate; ++ m_bClean = false; ++ ++ m_scanType = 0; ++ Create(); ++ m_bRunning = true; ++} ++ ++void CMusicInfoScanner::StartCleanDatabase() ++{ ++ m_fileCountReader.StopThread(); ++ StopThread(); ++ m_pathsToScan.clear(); ++ m_seenPaths.clear(); ++ m_flags = SCAN_BACKGROUND; ++ m_bClean = true; + + m_scanType = 0; + Create(); +@@ -375,6 +399,18 @@ void CMusicInfoScanner::Stop() + StopThread(false); + } + ++void CMusicInfoScanner::CleanDatabase(bool showProgress /* = true */) ++{ ++ CMusicDatabase musicdatabase; ++ if (!musicdatabase.Open()) ++ return; ++ ++ musicdatabase.Cleanup(showProgress); ++ musicdatabase.Close(); ++ ++ CUtil::DeleteMusicDatabaseDirectoryCache(); ++} ++ + static void OnDirectoryScanned(const CStdString& strDirectory) + { + CGUIMessage msg(GUI_MSG_DIRECTORY_SCANNED, 0, 0, 0); +diff --git a/xbmc/music/infoscanner/MusicInfoScanner.h b/xbmc/music/infoscanner/MusicInfoScanner.h +index b7bfd1f..658d01c 100644 +--- a/xbmc/music/infoscanner/MusicInfoScanner.h ++++ b/xbmc/music/infoscanner/MusicInfoScanner.h +@@ -55,11 +55,14 @@ class CMusicInfoScanner : CThread, public IRunnable + virtual ~CMusicInfoScanner(); + + void Start(const CStdString& strDirectory, int flags); ++ void StartCleanDatabase(); + void FetchAlbumInfo(const CStdString& strDirectory, bool refresh=false); + void FetchArtistInfo(const CStdString& strDirectory, bool refresh=false); + bool IsScanning(); + void Stop(); + ++ void CleanDatabase(bool showProgress = true); ++ + //! \brief Set whether or not to show a progress dialog + void ShowDialog(bool show) { m_showDialog = show; } + +diff --git a/xbmc/settings/MediaSettings.cpp b/xbmc/settings/MediaSettings.cpp +index 6b29fe7..973edba 100644 +--- a/xbmc/settings/MediaSettings.cpp ++++ b/xbmc/settings/MediaSettings.cpp +@@ -314,9 +314,8 @@ void CMediaSettings::OnSettingAction(const CSetting *setting) + } + else if (settingId == "musiclibrary.cleanup") + { +- CMusicDatabase musicdatabase; +- musicdatabase.Clean(); +- CUtil::DeleteMusicDatabaseDirectoryCache(); ++ if (CGUIDialogYesNo::ShowAndGetInput(313, 333, 0, 0)) ++ g_application.StartMusicCleanup(true); + } + else if (settingId == "musiclibrary.export") + CBuiltins::Execute("exportlibrary(music)"); + +From 1edd176c5dfbcfa2369127c6814602812d9e3071 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 18 Nov 2014 18:53:42 +0000 +Subject: [PATCH 93/93] [omxplayer] Fix for EAC3 passthrough + +The Pi firmware supports EAC3 passthrough okay, but we weren't correctly enabling support. +See: https://github.com/OpenELEC/OpenELEC.tv/issues/3302 +--- + xbmc/cores/omxplayer/OMXAudio.h | 1 + + xbmc/cores/omxplayer/OMXPlayerAudio.cpp | 5 +++++ + 2 files changed, 6 insertions(+) + +diff --git a/xbmc/cores/omxplayer/OMXAudio.h b/xbmc/cores/omxplayer/OMXAudio.h +index f014364..c7cf65e 100644 +--- a/xbmc/cores/omxplayer/OMXAudio.h ++++ b/xbmc/cores/omxplayer/OMXAudio.h +@@ -48,6 +48,7 @@ extern "C" { + #define OMX_IS_RAW(x) \ + ( \ + (x) == AE_FMT_AC3 || \ ++ (x) == AE_FMT_EAC3 || \ + (x) == AE_FMT_DTS \ + ) + +diff --git a/xbmc/cores/omxplayer/OMXPlayerAudio.cpp b/xbmc/cores/omxplayer/OMXPlayerAudio.cpp +index f2bb9a2..d305a07 100644 +--- a/xbmc/cores/omxplayer/OMXPlayerAudio.cpp ++++ b/xbmc/cores/omxplayer/OMXPlayerAudio.cpp +@@ -530,6 +530,11 @@ AEDataFormat OMXPlayerAudio::GetDataFormat(CDVDStreamInfo hints) + 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")) ++ { ++ 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")) + { + dataFormat = AE_FMT_DTS;