From 0d3512d492a3df00e62d674fd045aedc71169eb7 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Wed, 12 Nov 2014 02:50:10 +0100 Subject: [PATCH] projects/RPi/patches/kodi: update RPi support patch Signed-off-by: Stephan Raue --- .../RPi/patches/kodi/kodi-001-newclock4.patch | 2561 ++++++++++++----- 1 file changed, 1846 insertions(+), 715 deletions(-) diff --git a/projects/RPi/patches/kodi/kodi-001-newclock4.patch b/projects/RPi/patches/kodi/kodi-001-newclock4.patch index c55532f809..2fc7fcacb5 100644 --- a/projects/RPi/patches/kodi/kodi-001-newclock4.patch +++ b/projects/RPi/patches/kodi/kodi-001-newclock4.patch @@ -1,7 +1,7 @@ -From 30d186f47ebee71c4571803a8035bc9f5b19b910 Mon Sep 17 00:00:00 2001 +From 2e21c89b6f31b48488708896151ddd58b234027c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 18:19:32 +0100 -Subject: [PATCH 01/84] [rbp/omxplayer] When opening a stream don't try to +Subject: [PATCH 01/88] [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 95ea2332eff47abc1f91f25683b133572f0aa69b Mon Sep 17 00:00:00 2001 +From 7ee57ebabbe4387cf90770d14eae1ebb129cf95d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 29 Apr 2014 15:23:22 +0100 -Subject: [PATCH 02/84] [ffmpeg] Speed up wtv index creation +Subject: [PATCH 02/88] [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 432579c0f844e9a6dcf9ee0a0999908f474f3df3 Mon Sep 17 00:00:00 2001 +From 2d1634a4a4732e94fe0688278d48d6deee6d540e Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:49:17 +1300 -Subject: [PATCH 03/84] adds GetTvShowSeasons +Subject: [PATCH 03/88] adds GetTvShowSeasons --- xbmc/video/VideoDatabase.cpp | 30 ++++++++++++++++++++++++------ @@ -125,7 +125,7 @@ Subject: [PATCH 03/84] adds GetTvShowSeasons 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp -index c18c3b5..14184b1 100644 +index dd77e99..9e54a34 100644 --- a/xbmc/video/VideoDatabase.cpp +++ b/xbmc/video/VideoDatabase.cpp @@ -4209,7 +4209,7 @@ bool CVideoDatabase::RemoveArtForItem(int mediaId, const MediaType &mediaType, c @@ -193,10 +193,10 @@ index 78259ed..cbb26b7 100644 bool GetArtTypes(const MediaType &mediaType, std::vector &artTypes); -From a847649fab4ee953a3b4d680bb828b6c8e6e279a Mon Sep 17 00:00:00 2001 +From 9a74fd25bec68610f5d78a557c38f754f6d14c87 Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:50:10 +1300 -Subject: [PATCH 04/84] move AddSeason() public. +Subject: [PATCH 04/88] 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 e7d8d58ecf4eaa6f0b469b13189f9bfd84fc16b4 Mon Sep 17 00:00:00 2001 +From 438061d812494b1539eb38b32bba97cc8c0187be Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:48:24 +1300 -Subject: [PATCH 05/84] adds GetArt function to (video) scraper, allowing art +Subject: [PATCH 05/88] 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 9d49dcdea36dc98d924440d72a1843e00c136a4c Mon Sep 17 00:00:00 2001 +From 30b71249fe3fd2b58d4e8f36679958e4c56a94ad Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:53:14 +1300 -Subject: [PATCH 06/84] refresh season art if a new season is found that isn't +Subject: [PATCH 06/88] 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 8b79d04ea0b7fc0e0e7a869a4603a8050f1a2c74 Mon Sep 17 00:00:00 2001 +From 9d5cd1a0c4f1110bc834503224088e5d5bc8c247 Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:53:34 +1300 -Subject: [PATCH 07/84] REMOVEME: updated thetvdb.com scraper to support art +Subject: [PATCH 07/88] REMOVEME: updated thetvdb.com scraper to support art updates --- @@ -559,10 +559,10 @@ index f27e4fc..bdf329f 100644 -From 6bb3f6ed82d656fd15c92861f7cef6541e36c740 Mon Sep 17 00:00:00 2001 +From 9e7734d143948b115fbc820a8496dcb70c9dfa47 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 2 Aug 2014 17:48:04 +0100 -Subject: [PATCH 08/84] [omx] Report decoded image name +Subject: [PATCH 08/88] [omx] Report decoded image name --- xbmc/cores/omxplayer/OMXImage.cpp | 1 + @@ -581,10 +581,10 @@ index aa413b9..22ec3f0 100644 else { -From 2b5186365600487c6b3f5b712ddcf6bc189e7f9d Mon Sep 17 00:00:00 2001 +From bff39e76d586c56551a52c9bcfe7bf9269084c01 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 14 Dec 2013 16:55:05 +0000 -Subject: [PATCH 09/84] logging: Add microsecond timer to log messages +Subject: [PATCH 09/88] logging: Add microsecond timer to log messages --- xbmc/utils/log.cpp | 17 +++++++++++++++-- @@ -637,10 +637,10 @@ index 3443f12..31c4a99 100644 levelNames[logLevel]) + strData; -From 232cad5fb449facd176dac3dfa3e087bbf2cb1ca Mon Sep 17 00:00:00 2001 +From 4171b4bf42df150a597979f15c336cd8016c4d42 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 8 Mar 2014 15:36:06 +0000 -Subject: [PATCH 13/84] [hifiberry] Hack: force it to be recognised as IEC958 +Subject: [PATCH 10/88] [hifiberry] Hack: force it to be recognised as IEC958 capable to enable passthrough options --- @@ -648,10 +648,10 @@ Subject: [PATCH 13/84] [hifiberry] Hack: force it to be recognised as IEC958 1 file changed, 4 insertions(+) diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp -index a464b4b..7eba389 100644 +index d30cbab..b268819 100644 --- a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp +++ b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp -@@ -1296,6 +1296,10 @@ void CAESinkALSA::EnumerateDevice(AEDeviceInfoList &list, const std::string &dev +@@ -1331,6 +1331,10 @@ void CAESinkALSA::EnumerateDevice(AEDeviceInfoList &list, const std::string &dev if (snd_card_get_name(cardNr, &cardName) == 0) info.m_displayName = cardName; @@ -663,10 +663,10 @@ index a464b4b..7eba389 100644 info.m_displayName.substr(info.m_displayName.size()-5) == " HDMI") { -From 78f8be64cd8aaa62ab95351f8e1a1fc3ca4f8bea Mon Sep 17 00:00:00 2001 +From 45a217afdf09296b30d3c3ca407e5b19c2767e50 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 11 Dec 2013 17:21:54 +0000 -Subject: [PATCH 14/84] Move the reference-counting of Begin and End calls from +Subject: [PATCH 11/88] 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 8a5762283df853c3ba0f7417cf7c9c6f22ba7379 Mon Sep 17 00:00:00 2001 +From 547b2b8f3b0c0b645aa68662663ce7e091c770cd Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 11 Dec 2013 18:47:54 +0000 -Subject: [PATCH 15/84] Convert CGUIFontTTFBase::m_vertex to be managed as a +Subject: [PATCH 12/88] 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 8e79a3e46dfbd5268a0106857f3e5d1bb5aa3cb9 Mon Sep 17 00:00:00 2001 +From 371723178008ae3ef8cac140b3bec0b063cb1e66 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Mon, 16 Dec 2013 18:58:12 +0000 -Subject: [PATCH 16/84] CGUIFontTTFBase::RenderCharacter can now append to +Subject: [PATCH 13/88] 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 7cf321191658dde76c622274a3ac630f0d808697 Mon Sep 17 00:00:00 2001 +From aad9ee727fde44ffdbc74e76f645c902b5d60afb Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 17:18:38 +0000 -Subject: [PATCH 17/84] Add a cache of font glyph bounding box vertices. +Subject: [PATCH 14/88] 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 @@ -1339,7 +1339,7 @@ applicable transformation matrices permit the use of hardware clipping. create mode 100644 xbmc/guilib/GUIFontCache.h diff --git a/Kodi.xcodeproj/project.pbxproj b/Kodi.xcodeproj/project.pbxproj -index bf49f64..35ef214 100644 +index 5a81f22..debdf4e 100644 --- a/Kodi.xcodeproj/project.pbxproj +++ b/Kodi.xcodeproj/project.pbxproj @@ -168,6 +168,9 @@ @@ -1395,7 +1395,7 @@ index bf49f64..35ef214 100644 E4991321174E5DAD00741B6D /* imagefactory.cpp in Sources */, E4991322174E5DAD00741B6D /* IWindowManagerCallback.cpp in Sources */, diff --git a/project/VS2010Express/XBMC.vcxproj b/project/VS2010Express/XBMC.vcxproj -index c29fb2f..78e83c4 100644 +index 9c36fae..d2b8d9a 100644 --- a/project/VS2010Express/XBMC.vcxproj +++ b/project/VS2010Express/XBMC.vcxproj @@ -427,6 +427,7 @@ @@ -1415,7 +1415,7 @@ index c29fb2f..78e83c4 100644 diff --git a/project/VS2010Express/XBMC.vcxproj.filters b/project/VS2010Express/XBMC.vcxproj.filters -index dbb9b9d..64f4d76 100644 +index b570d6b..4990605 100644 --- a/project/VS2010Express/XBMC.vcxproj.filters +++ b/project/VS2010Express/XBMC.vcxproj.filters @@ -994,6 +994,9 @@ @@ -2076,10 +2076,10 @@ index f351c99..9036ba9 100644 + return !operator==(a, b); +} -From b20df31af65e041007f8af8e75c479b31ad0ef0c Mon Sep 17 00:00:00 2001 +From 8c949e7c50b3cfb5fce3778e561a91642414a64a Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 23 Jan 2014 22:24:17 +0000 -Subject: [PATCH 18/84] Lay the groundwork for hardware clipping. +Subject: [PATCH 15/88] 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 @@ -2249,7 +2249,7 @@ index f7b5d9a..fdf7452 100644 #endif // GUI_SHADER_H diff --git a/xbmc/guilib/GraphicContext.cpp b/xbmc/guilib/GraphicContext.cpp -index 991ae5b..282792c 100644 +index d40e7a7..3cb5587 100644 --- a/xbmc/guilib/GraphicContext.cpp +++ b/xbmc/guilib/GraphicContext.cpp @@ -167,6 +167,16 @@ void CGraphicContext::ClipRect(CRect &vertex, CRect &texture, CRect *texture2) @@ -2341,10 +2341,10 @@ index 98e398a..81ee49e 100644 virtual void ResetScissors(); -From 2ea5644b7bfbe0c9ef308cf17d3c5ad885a77ddc Mon Sep 17 00:00:00 2001 +From be50a74d88cec088a99c7cb6f2b881e6777bf953 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 23 Jan 2014 16:42:22 +0000 -Subject: [PATCH 19/84] Increase font cache hit rate by keying on the +Subject: [PATCH 16/88] 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 a0726e3ddc0e874f4d514a788bd39038f72b14ff Mon Sep 17 00:00:00 2001 +From e3976911fadc4d63d2d4920a3940828ad94fcf92 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 8 Jan 2014 12:16:33 +0000 -Subject: [PATCH 20/84] Rewrite of scrolling text code. +Subject: [PATCH 17/88] 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 7aa10750d64e3d27d83fb8ddd53e29e546b23f98 Mon Sep 17 00:00:00 2001 +From 180e1e5b718152abd8ffec89cb76b6107b43fb3a Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Mon, 27 Jan 2014 23:21:10 +0000 -Subject: [PATCH 21/84] Move the application of the translation offsets into +Subject: [PATCH 18/88] 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 edd8c99522b8b8610ce135094df5a490b1dc0599 Mon Sep 17 00:00:00 2001 +From 3feb094818290687469c2afda70a44a9ac315717 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 15:28:06 +0000 -Subject: [PATCH 22/84] Rather than applying the translation offsets to the +Subject: [PATCH 19/88] 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 8a97a4fbf7fbe4ce2fe503fba28a01a80c682e79 Mon Sep 17 00:00:00 2001 +From 9f737cabdc74f3237d487e64216aae902e289dd3 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 29 Jan 2014 13:21:19 +0000 -Subject: [PATCH 23/84] Enable hardware clipping. +Subject: [PATCH 20/88] 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 484f10587ae2741c799894756552be5cbdb3e6d5 Mon Sep 17 00:00:00 2001 +From 71d43c1cf5feaa28bece6efff447c6098174476b Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 15:32:51 +0000 -Subject: [PATCH 24/84] Move the vertex data across to a vertex buffer object +Subject: [PATCH 21/88] 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 1231a992b2f23491b4538f5b7af792c9c9c09e06 Mon Sep 17 00:00:00 2001 +From c4e540af56ee44416d0b6c13976875a5fa29c600 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 16:04:04 +0000 -Subject: [PATCH 25/84] Move vertex data into an OpenGL VBO when the font cache +Subject: [PATCH 22/88] 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 f338b5d790f62b9849a121eaf7aca3791d8f931f Mon Sep 17 00:00:00 2001 +From b6a55c4b2a82743d3c1044cadafe5dc7b4c0a721 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 1 Nov 2014 22:15:13 +0000 -Subject: [PATCH 26/84] Switch from glDrawArrays() to glDrawElements(). +Subject: [PATCH 23/88] 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 2a7edf12816ce7bccd7bf8d2a680b62a68a40ece Mon Sep 17 00:00:00 2001 +From 6e49b6a04b4682eebb2e94c94cc7362b84fa3e59 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 1 May 2014 16:28:39 +0100 -Subject: [PATCH 27/84] Improved file buffering in CArchive +Subject: [PATCH 24/88] 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 2eb1c5c116a432340fefc73b8d04155487504877 Mon Sep 17 00:00:00 2001 +From 90b1d957c71900aa8e227d94903fd57ae95be091 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 10 Sep 2014 22:07:21 +0100 -Subject: [PATCH 28/84] [mmal] Allow mmal codec for dvd stills +Subject: [PATCH 25/88] [mmal] Allow mmal codec for dvd stills --- xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp | 4 ++++ @@ -3925,10 +3925,661 @@ index f139433..4183a2b 100644 { // If dvd is an mpeg2 and hint.stills -From a0b86b86b8170a0f47452bcbab87bcb89e3e0d16 Mon Sep 17 00:00:00 2001 +From 48e43e8adc8730edf3c77f1661f64a0f740ee56a Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 12 Aug 2014 00:31:36 +0100 +Subject: [PATCH 26/88] [omxcodec] Fix for stills with hardware codec + +Hardware codecs typically run asynchronously to the decoded frames. +The reason that hardware codecs don't work when hint.stills is true +is because DVDPlayerVideo stops calling Decode/GetPicture when there +are no more decoded frames. + +This means the still frames never get read out. +The solution is to also call Decode/GetPicture with the timeout messages +when hint.stills is true. +--- + xbmc/cores/dvdplayer/DVDPlayer.cpp | 2 +- + xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 568 ++++++++++++++++---------------- + xbmc/cores/dvdplayer/DVDPlayerVideo.h | 1 + + 3 files changed, 292 insertions(+), 279 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp +index e647078..b6963ca 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayer.cpp ++++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp +@@ -3282,7 +3282,7 @@ bool CDVDPlayer::OpenVideoStream(CDVDStreamInfo& hint, bool reset) + hint.aspect = aspect; + hint.forced_aspect = true; + } +- hint.software = true; ++ //hint.software = true; + } + + CDVDInputStream::IMenus* pMenus = dynamic_cast(m_pInputStream); +diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +index 4f35e3a..d2db7bc 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp ++++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +@@ -300,15 +300,298 @@ void CDVDPlayerVideo::OnStartup() + m_FlipTimePts = 0.0; + } + +-void CDVDPlayerVideo::Process() ++void CDVDPlayerVideo::HandleDemuxerPacket(DemuxPacket* pPacket, bool bPacketDrop, int &iDropped, double &pts, CDVDMsg* pMsg, DVDVideoPicture &picture) + { +- CLog::Log(LOGNOTICE, "running thread: video_thread"); +- +- DVDVideoPicture picture; ++ double frametime = (double)DVD_TIME_BASE / m_fFrameRate; ++ int iPriority = (m_speed == DVD_PLAYSPEED_PAUSE && m_started) ? 1 : 0; + CPulldownCorrection pulldown; + CDVDVideoPPFFmpeg mPostProcess(""); + std::string sPostProcessType; + bool bPostProcessDeint = false; ++ if (m_stalled) ++ { ++ CLog::Log(LOGINFO, "CDVDPlayerVideo - Stillframe left, switching to normal playback"); ++ m_stalled = false; ++ ++ //don't allow the first frames after a still to be dropped ++ //sometimes we get multiple stills (long duration frames) after each other ++ //in normal mpegs ++ m_iNrOfPicturesNotToSkip = 5; ++ } ++ else if( iDropped*frametime > DVD_MSEC_TO_TIME(100) && m_iNrOfPicturesNotToSkip == 0 ) ++ { // if we dropped too many pictures in a row, insert a forced picture ++ m_iNrOfPicturesNotToSkip = 1; ++ } ++ ++ bool bRequestDrop = false; ++ int iDropDirective = CalcDropRequirement(pts); ++ if (iDropDirective & EOS_VERYLATE) ++ { ++ if (m_bAllowDrop) ++ { ++ m_pullupCorrection.Flush(); ++ bRequestDrop = true; ++ } ++ } ++ int codecControl = 0; ++ if (iDropDirective & EOS_BUFFER_LEVEL) ++ codecControl |= DVD_CODEC_CTRL_DRAIN; ++ if (m_speed > DVD_PLAYSPEED_NORMAL) ++ codecControl |= DVD_CODEC_CTRL_NO_POSTPROC; ++ m_pVideoCodec->SetCodecControl(codecControl); ++ if (iDropDirective & EOS_DROPPED) ++ { ++ m_iDroppedFrames++; ++ iDropped++; ++ } ++ ++ if (m_messageQueue.GetDataSize() == 0 ++ || m_speed < 0) ++ { ++ bRequestDrop = false; ++ m_iDroppedRequest = 0; ++ m_iLateFrames = 0; ++ } ++ ++ // if player want's us to drop this packet, do so nomatter what ++ if(bPacketDrop) ++ bRequestDrop = true; ++ ++ // tell codec if next frame should be dropped ++ // problem here, if one packet contains more than one frame ++ // both frames will be dropped in that case instead of just the first ++ // decoder still needs to provide an empty image structure, with correct flags ++ m_pVideoCodec->SetDropState(bRequestDrop); ++ ++ // ask codec to do deinterlacing if possible ++ EDEINTERLACEMODE mDeintMode = CMediaSettings::Get().GetCurrentVideoSettings().m_DeinterlaceMode; ++ EINTERLACEMETHOD mInt = g_renderManager.AutoInterlaceMethod(CMediaSettings::Get().GetCurrentVideoSettings().m_InterlaceMethod); ++ ++ unsigned int mFilters = 0; ++ ++ if (mDeintMode != VS_DEINTERLACEMODE_OFF) ++ { ++ if (mInt == VS_INTERLACEMETHOD_DEINTERLACE) ++ mFilters = CDVDVideoCodec::FILTER_DEINTERLACE_ANY; ++ else if(mInt == VS_INTERLACEMETHOD_DEINTERLACE_HALF) ++ mFilters = CDVDVideoCodec::FILTER_DEINTERLACE_ANY | CDVDVideoCodec::FILTER_DEINTERLACE_HALFED; ++ ++ if (mDeintMode == VS_DEINTERLACEMODE_AUTO && mFilters) ++ mFilters |= CDVDVideoCodec::FILTER_DEINTERLACE_FLAGGED; ++ } ++ ++ if (!g_renderManager.Supports(RENDERFEATURE_ROTATION)) ++ mFilters |= CDVDVideoCodec::FILTER_ROTATE; ++ ++ mFilters = m_pVideoCodec->SetFilters(mFilters); ++ ++ int iDecoderState; ++ if (pPacket) ++ { ++ iDecoderState = m_pVideoCodec->Decode(pPacket->pData, pPacket->iSize, pPacket->dts, pPacket->pts); ++ m_videoStats.AddSampleBytes(pPacket->iSize); ++ } ++ else ++ { ++ iDecoderState = m_pVideoCodec->Decode(NULL, 0, DVD_NOPTS_VALUE, DVD_NOPTS_VALUE); ++ } ++ ++ // buffer packets so we can recover should decoder flush for some reason ++ if(m_pVideoCodec->GetConvergeCount() > 0) ++ { ++ m_packets.push_back(DVDMessageListItem(pMsg, 0)); ++ if(m_packets.size() > m_pVideoCodec->GetConvergeCount() ++ || m_packets.size() * frametime > DVD_SEC_TO_TIME(10)) ++ m_packets.pop_front(); ++ } ++ ++ // reset the request, the following while loop may break before ++ // setting the flag to a new value ++ bRequestDrop = false; ++ ++ // loop while no error ++ while (!m_bStop) ++ { ++ ++ // if decoder was flushed, we need to seek back again to resume rendering ++ if (iDecoderState & VC_FLUSHED) ++ { ++ CLog::Log(LOGDEBUG, "CDVDPlayerVideo - video decoder was flushed"); ++ while(!m_packets.empty()) ++ { ++ CDVDMsgDemuxerPacket* msg = (CDVDMsgDemuxerPacket*)m_packets.front().message->Acquire(); ++ m_packets.pop_front(); ++ ++ // all packets except the last one should be dropped ++ // if prio packets and current packet should be dropped, this is likely a new reset ++ msg->m_drop = !m_packets.empty() || (iPriority > 0 && bPacketDrop); ++ m_messageQueue.Put(msg, iPriority + 10); ++ } ++ ++ m_pVideoCodec->Reset(); ++ m_packets.clear(); ++ picture.iFlags &= ~DVP_FLAG_ALLOCATED; ++ g_renderManager.DiscardBuffer(); ++ break; ++ } ++ ++ // if decoder had an error, tell it to reset to avoid more problems ++ if (iDecoderState & VC_ERROR) ++ { ++ CLog::Log(LOGDEBUG, "CDVDPlayerVideo - video decoder returned error"); ++ break; ++ } ++ ++ // check for a new picture ++ if (iDecoderState & VC_PICTURE) ++ { ++ ++ // try to retrieve the picture (should never fail!), unless there is a demuxer bug ofcours ++ m_pVideoCodec->ClearPicture(&picture); ++ if (m_pVideoCodec->GetPicture(&picture)) ++ { ++ sPostProcessType.clear(); ++ ++ if(picture.iDuration == 0.0) ++ picture.iDuration = frametime; ++ ++ if(bPacketDrop) ++ picture.iFlags |= DVP_FLAG_DROPPED; ++ ++ if (m_iNrOfPicturesNotToSkip > 0) ++ { ++ picture.iFlags |= DVP_FLAG_NOSKIP; ++ m_iNrOfPicturesNotToSkip--; ++ } ++ ++ // validate picture timing, ++ // if both dts/pts invalid, use pts calulated from picture.iDuration ++ // if pts invalid use dts, else use picture.pts as passed ++ if (picture.dts == DVD_NOPTS_VALUE && picture.pts == DVD_NOPTS_VALUE) ++ picture.pts = pts; ++ else if (picture.pts == DVD_NOPTS_VALUE) ++ picture.pts = picture.dts; ++ ++ /* use forced aspect if any */ ++ if( m_fForcedAspectRatio != 0.0f ) ++ picture.iDisplayWidth = (int) (picture.iDisplayHeight * m_fForcedAspectRatio); ++ ++ //Deinterlace if codec said format was interlaced or if we have selected we want to deinterlace ++ //this video ++ if ((mDeintMode == VS_DEINTERLACEMODE_AUTO && (picture.iFlags & DVP_FLAG_INTERLACED)) || mDeintMode == VS_DEINTERLACEMODE_FORCE) ++ { ++ if(mInt == VS_INTERLACEMETHOD_SW_BLEND) ++ { ++ if (!sPostProcessType.empty()) ++ sPostProcessType += ","; ++ sPostProcessType += g_advancedSettings.m_videoPPFFmpegDeint; ++ bPostProcessDeint = true; ++ } ++ } ++ ++ if (CMediaSettings::Get().GetCurrentVideoSettings().m_PostProcess) ++ { ++ if (!sPostProcessType.empty()) ++ sPostProcessType += ","; ++ // This is what mplayer uses for its "high-quality filter combination" ++ sPostProcessType += g_advancedSettings.m_videoPPFFmpegPostProc; ++ } ++ ++ if (!sPostProcessType.empty()) ++ { ++ mPostProcess.SetType(sPostProcessType, bPostProcessDeint); ++ if (mPostProcess.Process(&picture)) ++ mPostProcess.GetPicture(&picture); ++ } ++ ++ /* if frame has a pts (usually originiating from demux packet), use that */ ++ if(picture.pts != DVD_NOPTS_VALUE) ++ { ++ if(pulldown.enabled()) ++ picture.pts += pulldown.pts(); ++ ++ pts = picture.pts; ++ } ++ ++ if(pulldown.enabled()) ++ { ++ picture.iDuration = pulldown.dur(); ++ pulldown.next(); ++ } ++ ++ if (picture.iRepeatPicture) ++ picture.iDuration *= picture.iRepeatPicture + 1; ++ ++ int iResult = OutputPicture(&picture, pts); ++ ++ frametime = (double)DVD_TIME_BASE/m_fFrameRate; ++ ++ if(m_started == false) ++ { ++ m_codecname = m_pVideoCodec->GetName(); ++ m_started = true; ++ m_messageParent.Put(new CDVDMsgInt(CDVDMsg::PLAYER_STARTED, DVDPLAYER_VIDEO)); ++ } ++ ++ // guess next frame pts. iDuration is always valid ++ if (m_speed != 0) ++ pts += picture.iDuration * m_speed / abs(m_speed); ++ ++ if( iResult & EOS_ABORT ) ++ { ++ //if we break here and we directly try to decode again wihout ++ //flushing the video codec things break for some reason ++ //i think the decoder (libmpeg2 atleast) still has a pointer ++ //to the data, and when the packet is freed that will fail. ++ iDecoderState = m_pVideoCodec->Decode(NULL, 0, DVD_NOPTS_VALUE, DVD_NOPTS_VALUE); ++ break; ++ } ++ ++ if( (iResult & EOS_DROPPED) && !bPacketDrop ) ++ { ++ m_iDroppedFrames++; ++ iDropped++; ++ } ++ else ++ iDropped = 0; ++ ++ bRequestDrop = (iResult & EOS_VERYLATE) == EOS_VERYLATE; ++ } ++ else ++ { ++ CLog::Log(LOGWARNING, "Decoder Error getting videoPicture."); ++ m_pVideoCodec->Reset(); ++ } ++ } ++ ++ /* ++ if (iDecoderState & VC_USERDATA) ++ { ++ // found some userdata while decoding a frame ++ // could be closed captioning ++ DVDVideoUserData videoUserData; ++ if (m_pVideoCodec->GetUserData(&videoUserData)) ++ { ++ ProcessVideoUserData(&videoUserData, pts); ++ } ++ } ++ */ ++ ++ // if the decoder needs more data, we just break this loop ++ // and try to get more data from the videoQueue ++ if (iDecoderState & VC_BUFFER) ++ break; ++ ++ // the decoder didn't need more data, flush the remaning buffer ++ iDecoderState = m_pVideoCodec->Decode(NULL, 0, DVD_NOPTS_VALUE, DVD_NOPTS_VALUE); ++ } ++} ++ ++void CDVDPlayerVideo::Process() ++{ ++ CLog::Log(LOGNOTICE, "running thread: video_thread"); ++ ++ DVDVideoPicture picture; + + memset(&picture, 0, sizeof(DVDVideoPicture)); + +@@ -316,8 +599,6 @@ void CDVDPlayerVideo::Process() + double frametime = (double)DVD_TIME_BASE / m_fFrameRate; + + int iDropped = 0; //frames dropped in a row +- bool bRequestDrop = false; +- int iDropDirective; + + m_videoStats.Start(); + m_droppingStats.Reset(); +@@ -360,7 +641,8 @@ void CDVDPlayerVideo::Process() + OutputPicture(&picture, pts); + pts+= frametime; + } +- ++ if (m_hints.stills) ++ HandleDemuxerPacket(NULL, 0, iDropped, pts, pMsg, picture); + continue; + } + +@@ -495,277 +777,7 @@ void CDVDPlayerVideo::Process() + { + DemuxPacket* pPacket = ((CDVDMsgDemuxerPacket*)pMsg)->GetPacket(); + bool bPacketDrop = ((CDVDMsgDemuxerPacket*)pMsg)->GetPacketDrop(); +- +- if (m_stalled) +- { +- CLog::Log(LOGINFO, "CDVDPlayerVideo - Stillframe left, switching to normal playback"); +- m_stalled = false; +- +- //don't allow the first frames after a still to be dropped +- //sometimes we get multiple stills (long duration frames) after each other +- //in normal mpegs +- m_iNrOfPicturesNotToSkip = 5; +- } +- else if( iDropped*frametime > DVD_MSEC_TO_TIME(100) && m_iNrOfPicturesNotToSkip == 0 ) +- { // if we dropped too many pictures in a row, insert a forced picture +- m_iNrOfPicturesNotToSkip = 1; +- } +- +- bRequestDrop = false; +- iDropDirective = CalcDropRequirement(pts); +- if (iDropDirective & EOS_VERYLATE) +- { +- if (m_bAllowDrop) +- { +- m_pullupCorrection.Flush(); +- bRequestDrop = true; +- } +- } +- int codecControl = 0; +- if (iDropDirective & EOS_BUFFER_LEVEL) +- codecControl |= DVD_CODEC_CTRL_DRAIN; +- if (m_speed > DVD_PLAYSPEED_NORMAL) +- codecControl |= DVD_CODEC_CTRL_NO_POSTPROC; +- m_pVideoCodec->SetCodecControl(codecControl); +- if (iDropDirective & EOS_DROPPED) +- { +- m_iDroppedFrames++; +- iDropped++; +- } +- +- if (m_messageQueue.GetDataSize() == 0 +- || m_speed < 0) +- { +- bRequestDrop = false; +- m_iDroppedRequest = 0; +- m_iLateFrames = 0; +- } +- +- // if player want's us to drop this packet, do so nomatter what +- if(bPacketDrop) +- bRequestDrop = true; +- +- // tell codec if next frame should be dropped +- // problem here, if one packet contains more than one frame +- // both frames will be dropped in that case instead of just the first +- // decoder still needs to provide an empty image structure, with correct flags +- m_pVideoCodec->SetDropState(bRequestDrop); +- +- // ask codec to do deinterlacing if possible +- EDEINTERLACEMODE mDeintMode = CMediaSettings::Get().GetCurrentVideoSettings().m_DeinterlaceMode; +- EINTERLACEMETHOD mInt = g_renderManager.AutoInterlaceMethod(CMediaSettings::Get().GetCurrentVideoSettings().m_InterlaceMethod); +- +- unsigned int mFilters = 0; +- +- if (mDeintMode != VS_DEINTERLACEMODE_OFF) +- { +- if (mInt == VS_INTERLACEMETHOD_DEINTERLACE) +- mFilters = CDVDVideoCodec::FILTER_DEINTERLACE_ANY; +- else if(mInt == VS_INTERLACEMETHOD_DEINTERLACE_HALF) +- mFilters = CDVDVideoCodec::FILTER_DEINTERLACE_ANY | CDVDVideoCodec::FILTER_DEINTERLACE_HALFED; +- +- if (mDeintMode == VS_DEINTERLACEMODE_AUTO && mFilters) +- mFilters |= CDVDVideoCodec::FILTER_DEINTERLACE_FLAGGED; +- } +- +- if (!g_renderManager.Supports(RENDERFEATURE_ROTATION)) +- mFilters |= CDVDVideoCodec::FILTER_ROTATE; +- +- mFilters = m_pVideoCodec->SetFilters(mFilters); +- +- int iDecoderState = m_pVideoCodec->Decode(pPacket->pData, pPacket->iSize, pPacket->dts, pPacket->pts); +- +- // buffer packets so we can recover should decoder flush for some reason +- if(m_pVideoCodec->GetConvergeCount() > 0) +- { +- m_packets.push_back(DVDMessageListItem(pMsg, 0)); +- if(m_packets.size() > m_pVideoCodec->GetConvergeCount() +- || m_packets.size() * frametime > DVD_SEC_TO_TIME(10)) +- m_packets.pop_front(); +- } +- +- m_videoStats.AddSampleBytes(pPacket->iSize); +- +- // reset the request, the following while loop may break before +- // setting the flag to a new value +- bRequestDrop = false; +- +- // loop while no error +- while (!m_bStop) +- { +- +- // if decoder was flushed, we need to seek back again to resume rendering +- if (iDecoderState & VC_FLUSHED) +- { +- CLog::Log(LOGDEBUG, "CDVDPlayerVideo - video decoder was flushed"); +- while(!m_packets.empty()) +- { +- CDVDMsgDemuxerPacket* msg = (CDVDMsgDemuxerPacket*)m_packets.front().message->Acquire(); +- m_packets.pop_front(); +- +- // all packets except the last one should be dropped +- // if prio packets and current packet should be dropped, this is likely a new reset +- msg->m_drop = !m_packets.empty() || (iPriority > 0 && bPacketDrop); +- m_messageQueue.Put(msg, iPriority + 10); +- } +- +- m_pVideoCodec->Reset(); +- m_packets.clear(); +- picture.iFlags &= ~DVP_FLAG_ALLOCATED; +- g_renderManager.DiscardBuffer(); +- break; +- } +- +- // if decoder had an error, tell it to reset to avoid more problems +- if (iDecoderState & VC_ERROR) +- { +- CLog::Log(LOGDEBUG, "CDVDPlayerVideo - video decoder returned error"); +- break; +- } +- +- // check for a new picture +- if (iDecoderState & VC_PICTURE) +- { +- +- // try to retrieve the picture (should never fail!), unless there is a demuxer bug ofcours +- m_pVideoCodec->ClearPicture(&picture); +- if (m_pVideoCodec->GetPicture(&picture)) +- { +- sPostProcessType.clear(); +- +- if(picture.iDuration == 0.0) +- picture.iDuration = frametime; +- +- if(bPacketDrop) +- picture.iFlags |= DVP_FLAG_DROPPED; +- +- if (m_iNrOfPicturesNotToSkip > 0) +- { +- picture.iFlags |= DVP_FLAG_NOSKIP; +- m_iNrOfPicturesNotToSkip--; +- } +- +- // validate picture timing, +- // if both dts/pts invalid, use pts calulated from picture.iDuration +- // if pts invalid use dts, else use picture.pts as passed +- if (picture.dts == DVD_NOPTS_VALUE && picture.pts == DVD_NOPTS_VALUE) +- picture.pts = pts; +- else if (picture.pts == DVD_NOPTS_VALUE) +- picture.pts = picture.dts; +- +- /* use forced aspect if any */ +- if( m_fForcedAspectRatio != 0.0f ) +- picture.iDisplayWidth = (int) (picture.iDisplayHeight * m_fForcedAspectRatio); +- +- //Deinterlace if codec said format was interlaced or if we have selected we want to deinterlace +- //this video +- if ((mDeintMode == VS_DEINTERLACEMODE_AUTO && (picture.iFlags & DVP_FLAG_INTERLACED)) || mDeintMode == VS_DEINTERLACEMODE_FORCE) +- { +- if(mInt == VS_INTERLACEMETHOD_SW_BLEND) +- { +- if (!sPostProcessType.empty()) +- sPostProcessType += ","; +- sPostProcessType += g_advancedSettings.m_videoPPFFmpegDeint; +- bPostProcessDeint = true; +- } +- } +- +- if (CMediaSettings::Get().GetCurrentVideoSettings().m_PostProcess) +- { +- if (!sPostProcessType.empty()) +- sPostProcessType += ","; +- // This is what mplayer uses for its "high-quality filter combination" +- sPostProcessType += g_advancedSettings.m_videoPPFFmpegPostProc; +- } +- +- if (!sPostProcessType.empty()) +- { +- mPostProcess.SetType(sPostProcessType, bPostProcessDeint); +- if (mPostProcess.Process(&picture)) +- mPostProcess.GetPicture(&picture); +- } +- +- /* if frame has a pts (usually originiating from demux packet), use that */ +- if(picture.pts != DVD_NOPTS_VALUE) +- { +- if(pulldown.enabled()) +- picture.pts += pulldown.pts(); +- +- pts = picture.pts; +- } +- +- if(pulldown.enabled()) +- { +- picture.iDuration = pulldown.dur(); +- pulldown.next(); +- } +- +- if (picture.iRepeatPicture) +- picture.iDuration *= picture.iRepeatPicture + 1; +- +- int iResult = OutputPicture(&picture, pts); +- +- frametime = (double)DVD_TIME_BASE/m_fFrameRate; +- +- if(m_started == false) +- { +- m_codecname = m_pVideoCodec->GetName(); +- m_started = true; +- m_messageParent.Put(new CDVDMsgInt(CDVDMsg::PLAYER_STARTED, DVDPLAYER_VIDEO)); +- } +- +- // guess next frame pts. iDuration is always valid +- if (m_speed != 0) +- pts += picture.iDuration * m_speed / abs(m_speed); +- +- if( iResult & EOS_ABORT ) +- { +- //if we break here and we directly try to decode again wihout +- //flushing the video codec things break for some reason +- //i think the decoder (libmpeg2 atleast) still has a pointer +- //to the data, and when the packet is freed that will fail. +- iDecoderState = m_pVideoCodec->Decode(NULL, 0, DVD_NOPTS_VALUE, DVD_NOPTS_VALUE); +- break; +- } +- +- if( (iResult & EOS_DROPPED) && !bPacketDrop ) +- { +- m_iDroppedFrames++; +- iDropped++; +- } +- else +- iDropped = 0; +- +- bRequestDrop = (iResult & EOS_VERYLATE) == EOS_VERYLATE; +- } +- else +- { +- CLog::Log(LOGWARNING, "Decoder Error getting videoPicture."); +- m_pVideoCodec->Reset(); +- } +- } +- +- /* +- if (iDecoderState & VC_USERDATA) +- { +- // found some userdata while decoding a frame +- // could be closed captioning +- DVDVideoUserData videoUserData; +- if (m_pVideoCodec->GetUserData(&videoUserData)) +- { +- ProcessVideoUserData(&videoUserData, pts); +- } +- } +- */ +- +- // if the decoder needs more data, we just break this loop +- // and try to get more data from the videoQueue +- if (iDecoderState & VC_BUFFER) +- break; +- +- // the decoder didn't need more data, flush the remaning buffer +- iDecoderState = m_pVideoCodec->Decode(NULL, 0, DVD_NOPTS_VALUE, DVD_NOPTS_VALUE); +- } ++ HandleDemuxerPacket(pPacket, bPacketDrop, iDropped, pts, pMsg, picture); + } + + // all data is used by the decoder, we can safely free it now +diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.h b/xbmc/cores/dvdplayer/DVDPlayerVideo.h +index a38a9c3..70b86e6 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayerVideo.h ++++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.h +@@ -133,6 +133,7 @@ class CDVDPlayerVideo : public CThread, public IDVDStreamPlayerVideo + #endif + void ProcessVideoUserData(DVDVideoUserData* pVideoUserData, double pts); + void OpenStream(CDVDStreamInfo &hint, CDVDVideoCodec* codec); ++ void HandleDemuxerPacket(DemuxPacket* pPacket, bool bPacketDrop, int &iDropped, double &pts, CDVDMsg* pMsg, DVDVideoPicture &picture); + + CDVDMessageQueue m_messageQueue; + CDVDMessageQueue& m_messageParent; + + +From ec298e42b3bdfe8e246518dfd6479452a480b288 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 16 Apr 2014 21:18:06 +0100 -Subject: [PATCH 31/84] [omxplayer] Don't propagate 3d flags based on supported +Subject: [PATCH 28/88] [omxplayer] Don't propagate 3d flags based on supported 3d modes --- @@ -3981,10 +4632,10 @@ index ac838ce..605318c9 100644 unsigned int iDisplayWidth = width; unsigned int iDisplayHeight = height; -From b1f514743e289b09a7e217d1d43090245882ee6c Mon Sep 17 00:00:00 2001 +From f9ed79d711fd28be22f2682f2d4e8686c0dcbbf4 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Apr 2014 13:00:52 +0100 -Subject: [PATCH 32/84] [graphics] Don't set stereo mode based on resolution +Subject: [PATCH 29/88] [graphics] Don't set stereo mode based on resolution The resolution change should follow stereo mode --- @@ -3992,7 +4643,7 @@ The resolution change should follow stereo mode 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/xbmc/guilib/GraphicContext.cpp b/xbmc/guilib/GraphicContext.cpp -index 282792c..f1926de 100644 +index 3cb5587..fe6ebf4 100644 --- a/xbmc/guilib/GraphicContext.cpp +++ b/xbmc/guilib/GraphicContext.cpp @@ -436,26 +436,29 @@ void CGraphicContext::SetVideoResolutionInternal(RESOLUTION res, bool forceUpdat @@ -4042,10 +4693,10 @@ index 282792c..f1926de 100644 m_iScreenWidth = info_mod.iWidth; -From c848abf5a54a0d0459e0ed3e30143bb5713a4ec3 Mon Sep 17 00:00:00 2001 +From fc38f9f499a1da6ab405994a3152e9ac67d8f5fe Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Apr 2014 13:01:51 +0100 -Subject: [PATCH 33/84] [graphics] Allow switching to a more suitable 3D +Subject: [PATCH 30/88] [graphics] Allow switching to a more suitable 3D resolution --- @@ -4054,7 +4705,7 @@ Subject: [PATCH 33/84] [graphics] Allow switching to a more suitable 3D 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/xbmc/guilib/GraphicContext.cpp b/xbmc/guilib/GraphicContext.cpp -index f1926de..e7e8321 100644 +index fe6ebf4..04d0756 100644 --- a/xbmc/guilib/GraphicContext.cpp +++ b/xbmc/guilib/GraphicContext.cpp @@ -35,6 +35,7 @@ @@ -4131,10 +4782,10 @@ index 2904c1b..8d3774f 100644 void ResetOverscan(RESOLUTION_INFO &resinfo); void ResetScreenParameters(RESOLUTION res); -From 3199f48cc4a6e4e95ccd1fe9d6b66d1ea0740877 Mon Sep 17 00:00:00 2001 +From 5f10a87afee8e27877bd227dce8e3eb3cf434d23 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Apr 2014 13:38:55 +0100 -Subject: [PATCH 34/84] [3D] Support switching to 3D resolutions +Subject: [PATCH 31/88] [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. @@ -4216,10 +4867,10 @@ index 83c3adb..8076e76 100644 return current; } -From b8e92436f7474a9d2f4e59b39af65aa29b612280 Mon Sep 17 00:00:00 2001 +From 5ad43039dfa3b10b6e3201f93af519a107d2512f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 23 Apr 2014 00:05:07 +0100 -Subject: [PATCH 35/84] [graphics] Make pixel ratio for 3d modes consistent +Subject: [PATCH 32/88] [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. @@ -4279,7 +4930,7 @@ index 8076e76..9118cb0 100644 continue; diff --git a/xbmc/guilib/GraphicContext.cpp b/xbmc/guilib/GraphicContext.cpp -index e7e8321..d4f0346 100644 +index 04d0756..93bd207 100644 --- a/xbmc/guilib/GraphicContext.cpp +++ b/xbmc/guilib/GraphicContext.cpp @@ -747,32 +747,33 @@ void CGraphicContext::ApplyStateBlock() @@ -4422,10 +5073,401 @@ index c58c28a..bf1e589 100644 AddUniqueResolution(res2, resolutions); -From 19d4ceef1f582257a00bd73ae2aca668280158da Mon Sep 17 00:00:00 2001 +From b3a2287d1acd4cbdb6618d85862b7af18151a449 Mon Sep 17 00:00:00 2001 +From: da-anda +Date: Sun, 17 Aug 2014 21:09:59 +0200 +Subject: [PATCH 33/88] handle stereoscopic mode of videos in mixed playlists + +--- + language/English/strings.po | 2 +- + xbmc/guilib/StereoscopicsManager.cpp | 76 +++++++++++++++++++++++------------- + 2 files changed, 49 insertions(+), 29 deletions(-) + +diff --git a/language/English/strings.po b/language/English/strings.po +index 770586a..55ff13d 100755 +--- a/language/English/strings.po ++++ b/language/English/strings.po +@@ -15751,7 +15751,7 @@ msgstr "" + #. Description of setting "Videos -> Playback -> Disable stereoscopic mode when playback is stopped" with label #36526 + #: system/settings/settings.xml + msgctxt "#36538" +-msgid "[Enabled] Switch GUI (and some TVs) back to 2D mode when playback ended. [Disabled] GUI and TV will stay in stereoscopic 3D mode. For video playlists the stereoscopic 3D mode won't change between videos, not even for non stereoscopic ones." ++msgid "[Enabled] Switch GUI (and some TVs) back to 2D mode when playback ended - also between videos in a playlist if necessary. [Disabled] GUI and TV will stay in stereoscopic 3D mode. For video playlists the stereoscopic 3D mode won't change between videos, not even for non stereoscopic ones." + msgstr "" + + #. Description of setting "System -> Video output -> Stereoscopic mode (current)" with label #36500 +diff --git a/xbmc/guilib/StereoscopicsManager.cpp b/xbmc/guilib/StereoscopicsManager.cpp +index 35ba597..b013942 100644 +--- a/xbmc/guilib/StereoscopicsManager.cpp ++++ b/xbmc/guilib/StereoscopicsManager.cpp +@@ -123,13 +123,23 @@ RENDER_STEREO_MODE CStereoscopicsManager::GetStereoMode(void) + void CStereoscopicsManager::SetStereoMode(const RENDER_STEREO_MODE &mode) + { + RENDER_STEREO_MODE currentMode = GetStereoMode(); +- if (mode != currentMode && mode >= RENDER_STEREO_MODE_OFF) ++ RENDER_STEREO_MODE applyMode = mode; ++ ++ // resolve automatic mode before applying ++ if (mode == RENDER_STEREO_MODE_AUTO) + { +- if(!g_Windowing.SupportsStereo(mode)) +- return; ++ if (g_infoManager.EvaluateBool("videoplayer.isstereoscopic")) ++ applyMode = GetStereoModeOfPlayingVideo(); ++ else ++ applyMode = RENDER_STEREO_MODE_OFF; ++ } + ++ if (applyMode != currentMode && applyMode >= RENDER_STEREO_MODE_OFF) ++ { ++ if (!g_Windowing.SupportsStereo(applyMode)) ++ return; + m_lastStereoMode = currentMode; +- CSettings::Get().SetInt("videoscreen.stereoscopicmode", mode); ++ CSettings::Get().SetInt("videoscreen.stereoscopicmode", applyMode); + } + } + +@@ -210,6 +220,12 @@ RENDER_STEREO_MODE CStereoscopicsManager::GetStereoModeByUserChoice(const CStdSt + if (mode == selectableMode) + pDlgSelect->SetSelected( label ); + } ++ // inject AUTO pseudo mode after OFF ++ if (i == RENDER_STEREO_MODE_OFF) ++ { ++ selectableModes.push_back(RENDER_STEREO_MODE_AUTO); ++ pDlgSelect->Add(GetLabelForStereoMode(RENDER_STEREO_MODE_AUTO)); ++ } + } + + pDlgSelect->DoModal(); +@@ -248,20 +264,7 @@ CStdString CStereoscopicsManager::GetLabelForStereoMode(const RENDER_STEREO_MODE + + RENDER_STEREO_MODE CStereoscopicsManager::GetPreferredPlaybackMode(void) + { +- RENDER_STEREO_MODE playbackMode = m_lastStereoMode; +- int preferredMode = CSettings::Get().GetInt("videoscreen.preferedstereoscopicmode"); +- if (preferredMode == RENDER_STEREO_MODE_AUTO) // automatic mode, detect by movie +- { +- if (g_infoManager.EvaluateBool("videoplayer.isstereoscopic")) +- playbackMode = GetStereoModeOfPlayingVideo(); +- else if (playbackMode == RENDER_STEREO_MODE_OFF) +- playbackMode = GetNextSupportedStereoMode(RENDER_STEREO_MODE_OFF); +- } +- else // predefined mode +- { +- playbackMode = (RENDER_STEREO_MODE) preferredMode; +- } +- return playbackMode; ++ return (RENDER_STEREO_MODE) CSettings::Get().GetInt("videoscreen.preferedstereoscopicmode"); + } + + int CStereoscopicsManager::ConvertVideoToGuiStereoMode(const std::string &mode) +@@ -450,9 +453,6 @@ void CStereoscopicsManager::ApplyStereoMode(const RENDER_STEREO_MODE &mode, bool + + void CStereoscopicsManager::OnPlaybackStarted(void) + { +- if (!g_infoManager.EvaluateBool("videoplayer.isstereoscopic")) +- return; +- + STEREOSCOPIC_PLAYBACK_MODE playbackMode = (STEREOSCOPIC_PLAYBACK_MODE) CSettings::Get().GetInt("videoplayer.stereoscopicplaybackmode"); + RENDER_STEREO_MODE mode = GetStereoMode(); + +@@ -460,8 +460,31 @@ void CStereoscopicsManager::OnPlaybackStarted(void) + if (playbackMode == STEREOSCOPIC_PLAYBACK_MODE_IGNORE && mode == RENDER_STEREO_MODE_OFF) + return; + +- if (mode != RENDER_STEREO_MODE_OFF) ++ if (!g_infoManager.EvaluateBool("videoplayer.isstereoscopic")) ++ { ++ // exit stereo mode if started item is not stereoscopic ++ // and if user prefers to stop 3D playback when movie is finished ++ if (mode != RENDER_STEREO_MODE_OFF && CSettings::Get().GetBool("videoplayer.quitstereomodeonstop")) ++ SetStereoMode(RENDER_STEREO_MODE_OFF); + return; ++ } ++ ++ RENDER_STEREO_MODE preferred = GetPreferredPlaybackMode(); ++ RENDER_STEREO_MODE playing = GetStereoModeOfPlayingVideo(); ++ ++ if (mode != RENDER_STEREO_MODE_OFF) ++ { ++ // don't change mode if user selected to not exit stereomode on playback stop ++ // users selecting this option usually have to manually switch their TV into 3D mode ++ // and would be annoyed by having to switch TV modes when next movies comes up ++ // @todo probably add a new setting for just this behavior ++ if (CSettings::Get().GetBool("videoplayer.quitstereomodeonstop") == false) ++ return; ++ ++ // only change to new stereo mode if not yet in preferred stereo mode ++ if (mode == preferred || (preferred == RENDER_STEREO_MODE_AUTO && mode == playing)) ++ return; ++ } + + switch (playbackMode) + { +@@ -473,9 +496,6 @@ void CStereoscopicsManager::OnPlaybackStarted(void) + pDlgSelect->Reset(); + pDlgSelect->SetHeading(g_localizeStrings.Get(36527).c_str()); + +- RENDER_STEREO_MODE preferred = GetPreferredPlaybackMode(); +- RENDER_STEREO_MODE playing = GetStereoModeOfPlayingVideo(); +- + int idx_playing = -1 + , idx_mono = -1; + +@@ -488,7 +508,7 @@ void CStereoscopicsManager::OnPlaybackStarted(void) + + idx_mono = pDlgSelect->Add(GetLabelForStereoMode(RENDER_STEREO_MODE_MONO)); // mono / 2d + +- if(playing != RENDER_STEREO_MODE_OFF && playing != preferred && g_Windowing.SupportsStereo(playing)) ++ if (playing != RENDER_STEREO_MODE_OFF && playing != preferred && preferred != RENDER_STEREO_MODE_AUTO && g_Windowing.SupportsStereo(playing)) // same as movie + idx_playing = pDlgSelect->Add((CStdString)g_localizeStrings.Get(36532) + + " (" + + GetLabelForStereoMode(playing) +@@ -503,7 +523,7 @@ void CStereoscopicsManager::OnPlaybackStarted(void) + int iItem = pDlgSelect->GetSelectedLabel(); + if (iItem == idx_preferred) mode = preferred; + else if (iItem == idx_mono) mode = RENDER_STEREO_MODE_MONO; +- else if (iItem == idx_playing) mode = playing; ++ else if (iItem == idx_playing) mode = RENDER_STEREO_MODE_AUTO; + else if (iItem == idx_select) mode = GetStereoModeByUserChoice(); + + SetStereoMode(mode); +@@ -513,7 +533,7 @@ void CStereoscopicsManager::OnPlaybackStarted(void) + } + break; + case STEREOSCOPIC_PLAYBACK_MODE_PREFERRED: // Stereoscopic +- SetStereoMode( GetPreferredPlaybackMode() ); ++ SetStereoMode( preferred ); + break; + case 2: // Mono + SetStereoMode( RENDER_STEREO_MODE_MONO ); + +From e9d284a353a8d2bfd6480610fd0d682bd9234ef0 Mon Sep 17 00:00:00 2001 +From: da-anda +Date: Sat, 16 Aug 2014 11:20:54 +0200 +Subject: [PATCH 34/88] remember user selected 3D modes between videos until + playback ended + +--- + xbmc/guilib/StereoscopicsManager.cpp | 79 ++++++++++++++++++++++++++---------- + xbmc/guilib/StereoscopicsManager.h | 6 ++- + xbmc/rendering/RenderSystem.h | 1 + + 3 files changed, 63 insertions(+), 23 deletions(-) + +diff --git a/xbmc/guilib/StereoscopicsManager.cpp b/xbmc/guilib/StereoscopicsManager.cpp +index b013942..3db8eaa 100644 +--- a/xbmc/guilib/StereoscopicsManager.cpp ++++ b/xbmc/guilib/StereoscopicsManager.cpp +@@ -95,7 +95,8 @@ static const struct StereoModeMap StringToGuiModeMap[] = + + CStereoscopicsManager::CStereoscopicsManager(void) + { +- m_lastStereoMode = RENDER_STEREO_MODE_OFF; ++ m_stereoModeSetByUser = RENDER_STEREO_MODE_UNDEFINED; ++ m_lastStereoModeSetByUser = RENDER_STEREO_MODE_UNDEFINED; + } + + CStereoscopicsManager::~CStereoscopicsManager(void) +@@ -110,7 +111,6 @@ CStereoscopicsManager& CStereoscopicsManager::Get(void) + + void CStereoscopicsManager::Initialize(void) + { +- m_lastStereoMode = GetStereoMode(); + // turn off stereo mode on XBMC startup + SetStereoMode(RENDER_STEREO_MODE_OFF); + } +@@ -120,6 +120,16 @@ RENDER_STEREO_MODE CStereoscopicsManager::GetStereoMode(void) + return (RENDER_STEREO_MODE) CSettings::Get().GetInt("videoscreen.stereoscopicmode"); + } + ++void CStereoscopicsManager::SetStereoModeByUser(const RENDER_STEREO_MODE &mode) ++{ ++ // only update last user mode if desired mode is different from current ++ if (mode != m_stereoModeSetByUser) ++ m_lastStereoModeSetByUser = m_stereoModeSetByUser; ++ ++ m_stereoModeSetByUser = mode; ++ SetStereoMode(mode); ++} ++ + void CStereoscopicsManager::SetStereoMode(const RENDER_STEREO_MODE &mode) + { + RENDER_STEREO_MODE currentMode = GetStereoMode(); +@@ -138,7 +148,6 @@ void CStereoscopicsManager::SetStereoMode(const RENDER_STEREO_MODE &mode) + { + if (!g_Windowing.SupportsStereo(applyMode)) + return; +- m_lastStereoMode = currentMode; + CSettings::Get().SetInt("videoscreen.stereoscopicmode", applyMode); + } + } +@@ -384,46 +393,65 @@ bool CStereoscopicsManager::OnAction(const CAction &action) + + if (action.GetID() == ACTION_STEREOMODE_NEXT) + { +- SetStereoMode(GetNextSupportedStereoMode(mode)); ++ SetStereoModeByUser(GetNextSupportedStereoMode(mode)); + return true; + } + else if (action.GetID() == ACTION_STEREOMODE_PREVIOUS) + { +- SetStereoMode(GetNextSupportedStereoMode(mode, RENDER_STEREO_MODE_COUNT - 1)); ++ SetStereoModeByUser(GetNextSupportedStereoMode(mode, RENDER_STEREO_MODE_COUNT - 1)); + return true; + } + else if (action.GetID() == ACTION_STEREOMODE_TOGGLE) + { + if (mode == RENDER_STEREO_MODE_OFF) + { +- RENDER_STEREO_MODE targetMode = m_lastStereoMode; +- if (targetMode == RENDER_STEREO_MODE_OFF) +- targetMode = GetPreferredPlaybackMode(); +- SetStereoMode(targetMode); ++ RENDER_STEREO_MODE targetMode = GetPreferredPlaybackMode(); ++ ++ // if user selected a specific mode before, make sure to ++ // switch back into that mode on toggle. ++ if (m_stereoModeSetByUser != RENDER_STEREO_MODE_UNDEFINED) ++ { ++ // if user mode is set to OFF, he manually turned it off before. In this case use the last user applied mode ++ if (m_stereoModeSetByUser != RENDER_STEREO_MODE_OFF) ++ targetMode = m_stereoModeSetByUser; ++ else if (m_lastStereoModeSetByUser != RENDER_STEREO_MODE_UNDEFINED && m_lastStereoModeSetByUser != RENDER_STEREO_MODE_OFF) ++ targetMode = m_lastStereoModeSetByUser; ++ } ++ ++ SetStereoModeByUser(targetMode); + } + else + { +- SetStereoMode(RENDER_STEREO_MODE_OFF); ++ SetStereoModeByUser(RENDER_STEREO_MODE_OFF); + } + return true; + } + else if (action.GetID() == ACTION_STEREOMODE_SELECT) + { +- SetStereoMode(GetStereoModeByUserChoice()); ++ SetStereoModeByUser(GetStereoModeByUserChoice()); + return true; + } + else if (action.GetID() == ACTION_STEREOMODE_TOMONO) + { + if (mode == RENDER_STEREO_MODE_MONO) + { +- RENDER_STEREO_MODE targetMode = m_lastStereoMode; +- if (targetMode == RENDER_STEREO_MODE_OFF) +- targetMode = GetPreferredPlaybackMode(); +- SetStereoMode(targetMode); ++ RENDER_STEREO_MODE targetMode = GetPreferredPlaybackMode(); ++ ++ // if we have an old userdefined steremode, use that one as toggle target ++ if (m_stereoModeSetByUser != RENDER_STEREO_MODE_UNDEFINED) ++ { ++ // if user mode is set to OFF, he manually turned it off before. In this case use the last user applied mode ++ if (m_stereoModeSetByUser != RENDER_STEREO_MODE_OFF && m_stereoModeSetByUser != mode) ++ targetMode = m_stereoModeSetByUser; ++ else if (m_lastStereoModeSetByUser != RENDER_STEREO_MODE_UNDEFINED && m_lastStereoModeSetByUser != RENDER_STEREO_MODE_OFF && m_lastStereoModeSetByUser != mode) ++ targetMode = m_lastStereoModeSetByUser; ++ } ++ ++ SetStereoModeByUser(targetMode); + } + else + { +- SetStereoMode(RENDER_STEREO_MODE_MONO); ++ SetStereoModeByUser(RENDER_STEREO_MODE_MONO); + } + return true; + } +@@ -431,7 +459,7 @@ bool CStereoscopicsManager::OnAction(const CAction &action) + { + int stereoMode = ConvertStringToGuiStereoMode(action.GetName()); + if (stereoMode > -1) +- SetStereoMode( (RENDER_STEREO_MODE) stereoMode); ++ SetStereoModeByUser( (RENDER_STEREO_MODE) stereoMode ); + return true; + } + +@@ -469,6 +497,13 @@ void CStereoscopicsManager::OnPlaybackStarted(void) + return; + } + ++ // if we're not in stereomode yet, restore previously selected stereo mode in case it was user selected ++ if (m_stereoModeSetByUser != RENDER_STEREO_MODE_UNDEFINED) ++ { ++ SetStereoMode(m_stereoModeSetByUser); ++ return; ++ } ++ + RENDER_STEREO_MODE preferred = GetPreferredPlaybackMode(); + RENDER_STEREO_MODE playing = GetStereoModeOfPlayingVideo(); + +@@ -526,7 +561,7 @@ void CStereoscopicsManager::OnPlaybackStarted(void) + else if (iItem == idx_playing) mode = RENDER_STEREO_MODE_AUTO; + else if (iItem == idx_select) mode = GetStereoModeByUserChoice(); + +- SetStereoMode(mode); ++ SetStereoModeByUser( mode ); + } + + CApplicationMessenger::Get().MediaUnPause(); +@@ -546,8 +581,10 @@ void CStereoscopicsManager::OnPlaybackStarted(void) + void CStereoscopicsManager::OnPlaybackStopped(void) + { + RENDER_STEREO_MODE mode = GetStereoMode(); +- if (CSettings::Get().GetBool("videoplayer.quitstereomodeonstop") == true && mode != RENDER_STEREO_MODE_OFF) +- { ++ if (CSettings::Get().GetBool("videoplayer.quitstereomodeonstop") && mode != RENDER_STEREO_MODE_OFF) + SetStereoMode(RENDER_STEREO_MODE_OFF); +- } ++ // reset user modes on playback end to start over new on next playback and not end up in a probably unwanted mode ++ if (m_stereoModeSetByUser != RENDER_STEREO_MODE_OFF) ++ m_lastStereoModeSetByUser = m_stereoModeSetByUser; ++ m_stereoModeSetByUser = RENDER_STEREO_MODE_UNDEFINED; + } +diff --git a/xbmc/guilib/StereoscopicsManager.h b/xbmc/guilib/StereoscopicsManager.h +index 422cba2..6e9c36d 100644 +--- a/xbmc/guilib/StereoscopicsManager.h ++++ b/xbmc/guilib/StereoscopicsManager.h +@@ -54,8 +54,9 @@ class CStereoscopicsManager : public ISettingCallback, + static CStereoscopicsManager& Get(void); + + void Initialize(void); +- void SetStereoMode(const RENDER_STEREO_MODE &mode); + RENDER_STEREO_MODE GetStereoMode(void); ++ void SetStereoModeByUser(const RENDER_STEREO_MODE &mode); ++ void SetStereoMode(const RENDER_STEREO_MODE &mode); + RENDER_STEREO_MODE GetNextSupportedStereoMode(const RENDER_STEREO_MODE ¤tMode, int step = 1); + std::string DetectStereoModeByString(const std::string &needle); + RENDER_STEREO_MODE GetStereoModeByUserChoice(const CStdString &heading = ""); +@@ -92,5 +93,6 @@ class CStereoscopicsManager : public ISettingCallback, + void OnPlaybackStarted(void); + void OnPlaybackStopped(void); + +- RENDER_STEREO_MODE m_lastStereoMode; ++ RENDER_STEREO_MODE m_stereoModeSetByUser; ++ RENDER_STEREO_MODE m_lastStereoModeSetByUser; + }; +diff --git a/xbmc/rendering/RenderSystem.h b/xbmc/rendering/RenderSystem.h +index c1dfb93..cb54bd0 100644 +--- a/xbmc/rendering/RenderSystem.h ++++ b/xbmc/rendering/RenderSystem.h +@@ -81,6 +81,7 @@ enum RENDER_STEREO_MODE + + // psuevdo modes + RENDER_STEREO_MODE_AUTO = 100, ++ RENDER_STEREO_MODE_UNDEFINED = 999, + }; + + + +From 1d96714758e0a36cacaa309aaf038444656894bf Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 10 Aug 2014 16:45:16 +0100 -Subject: [PATCH 36/84] filesystem: Make support of browsing into archives +Subject: [PATCH 35/88] 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. @@ -4441,10 +5483,10 @@ Add a settings option to enable this feature and default to disabled on Pi 4 files changed, 28 insertions(+) diff --git a/language/English/strings.po b/language/English/strings.po -index a27daa0..92c958b 100755 +index 55ff13d..9aa583b 100755 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -16080,4 +16080,13 @@ msgstr "" +@@ -16082,4 +16082,13 @@ msgstr "" #: system/settings/rbp.xml msgctxt "#38010" msgid "GPU accelerated" @@ -4479,7 +5521,7 @@ index f572eed..f3c8a01 100644 diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index 25c2007..5e0e659 100644 +index 90d0fab..a18d889 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -226,6 +226,11 @@ @@ -4524,10 +5566,10 @@ index 2fd8777..3b294cd 100644 { // XBMC Smart playlist - just XML renamed to XSP // read the name of the playlist in -From 9dc76036947d4676c10dc2bab8c421868c3f1a97 Mon Sep 17 00:00:00 2001 +From e9f80dea7cd86caf75b5ace125b8fcbd51bd03fb Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 11 Aug 2014 22:56:13 +0100 -Subject: [PATCH 38/84] [omxplayer] Add option to choose omxplayer/dvdplayer +Subject: [PATCH 37/88] [omxplayer] Add option to choose omxplayer/dvdplayer automatically On Helix dvdplayer is pretty usable on the Pi, and is the only option @@ -4540,52 +5582,42 @@ omxplayer does not support software codecs Expecting the user to choose the right player is not ideal, so make the switch automatically for these three cases. --- - xbmc/cores/dvdplayer/DVDPlayer.cpp | 140 +++------------------- - xbmc/cores/dvdplayer/DVDPlayer.h | 1 + + xbmc/cores/dvdplayer/DVDPlayer.cpp | 146 +++++-------------------- + xbmc/cores/dvdplayer/DVDPlayer.h | 30 +++--- xbmc/cores/omxplayer/Makefile.in | 3 +- - xbmc/cores/omxplayer/OMXPlayer.cpp | 230 +++++++++++++++++++++++++++++++++++++ - 4 files changed, 246 insertions(+), 128 deletions(-) - create mode 100644 xbmc/cores/omxplayer/OMXPlayer.cpp + xbmc/cores/omxplayer/OMXHelper.cpp | 211 +++++++++++++++++++++++++++++++++++++ + xbmc/cores/omxplayer/OMXHelper.h | 28 +++++ + 5 files changed, 283 insertions(+), 135 deletions(-) + create mode 100644 xbmc/cores/omxplayer/OMXHelper.cpp + create mode 100644 xbmc/cores/omxplayer/OMXHelper.h diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index 6cd4f2d..8d5c776 100644 +index b6963ca..2a2202f 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -85,11 +85,6 @@ - #include "utils/LangCodeExpander.h" - #include "video/VideoReferenceClock.h" +@@ -89,6 +89,7 @@ + #ifdef HAS_OMXPLAYER + #include "cores/omxplayer/OMXPlayerAudio.h" + #include "cores/omxplayer/OMXPlayerVideo.h" ++#include "cores/omxplayer/OMXHelper.h" + #endif --#ifdef HAS_OMXPLAYER --#include "cores/omxplayer/OMXPlayerAudio.h" --#include "cores/omxplayer/OMXPlayerVideo.h" --#endif -- using namespace std; - using namespace PVR; - -@@ -490,17 +485,13 @@ void CSelectionStreams::Update(CDVDInputStream* input, CDVDDemux* demuxer, std:: +@@ -493,6 +494,13 @@ void CSelectionStreams::Update(CDVDInputStream* input, CDVDDemux* demuxer, std:: void CDVDPlayer::CreatePlayers() { -+ if (m_omxplayer_mode) -+ OMXCreatePlayers(); -+ ++#ifdef HAS_OMXPLAYER ++ if (m_omxplayer_mode && OMXPlayerUnsuitable(m_HasVideo, m_HasAudio, m_pDemuxer, m_pInputStream, m_SelectionStreams)) ++ { ++ DestroyPlayers(); ++ m_omxplayer_mode = false; ++ } ++#endif if (m_players_created) return; -- if (m_omxplayer_mode) -- { --#ifdef HAS_OMXPLAYER -- m_dvdPlayerVideo = new OMXPlayerVideo(&m_OmxPlayerState.av_clock, &m_overlayContainer, m_messenger); -- m_dvdPlayerAudio = new OMXPlayerAudio(&m_OmxPlayerState.av_clock, m_messenger); --#endif -- } -- else -+ if (!m_omxplayer_mode) - { - m_dvdPlayerVideo = new CDVDPlayerVideo(&m_clock, &m_overlayContainer, m_messenger); - m_dvdPlayerAudio = new CDVDPlayerAudio(&m_clock, m_messenger); -@@ -1046,120 +1037,6 @@ void CDVDPlayer::CheckBetterStream(CCurrentStream& current, CDemuxStream* stream +@@ -1049,120 +1057,6 @@ void CDVDPlayer::CheckBetterStream(CCurrentStream& current, CDemuxStream* stream OpenStream(current, stream->iId, stream->source); } @@ -4706,7 +5738,7 @@ index 6cd4f2d..8d5c776 100644 void CDVDPlayer::Process() { if (!OpenInputStream()) -@@ -1187,6 +1064,8 @@ void CDVDPlayer::Process() +@@ -1190,6 +1084,8 @@ void CDVDPlayer::Process() m_bAbortRequest = true; return; } @@ -4715,48 +5747,119 @@ index 6cd4f2d..8d5c776 100644 // allow renderer to switch to fullscreen if requested m_dvdPlayerVideo->EnableFullscreen(m_PlayerOptions.fullscreen); -@@ -4433,3 +4312,10 @@ bool CDVDPlayer::CachePVRStream(void) const - !g_PVRManager.IsPlayingRecording() && - g_advancedSettings.m_bPVRCacheInDvdPlayer; - } -+ -+// Stub functions. OMXPlayer.cpp contains the code when HAS_OMXPLAYER is enabled. -+#ifndef HAS_OMXPLAYER -+void CDVDPlayer::OMXDoProcessing() {} -+bool CDVDPlayer::OMXStillPlaying() { return false; } -+void CDVDPlayer::OMXCreatePlayers() {} +@@ -1292,9 +1188,15 @@ void CDVDPlayer::Process() + + while (!m_bAbortRequest) + { +- if (m_omxplayer_mode) +- OMXDoProcessing(); +- ++#ifdef HAS_OMXPLAYER ++ if (m_omxplayer_mode && OMXDoProcessing(m_OmxPlayerState, m_playSpeed, m_dvdPlayerVideo, m_dvdPlayerAudio, m_CurrentAudio, m_CurrentVideo, m_HasVideo, m_HasAudio)) ++ { ++ CloseStream(m_CurrentVideo, false); ++ OpenStream(m_CurrentVideo, m_CurrentVideo.id, m_CurrentVideo.source); ++ if (m_State.canseek) ++ m_messenger.Put(new CDVDMsgPlayerSeek(GetTime(), true, true, true, true, true)); ++ } +#endif + // handle messages send to this thread, like seek or demuxer reset requests + HandleMessages(); + +@@ -1460,12 +1362,18 @@ void CDVDPlayer::Process() + + // while players are still playing, keep going to allow seekbacks + if(m_dvdPlayerAudio->HasData() +- || m_dvdPlayerVideo->HasData() +- || OMXStillPlaying()) ++ || m_dvdPlayerVideo->HasData()) + { + Sleep(100); + continue; + } ++#ifdef HAS_OMXPLAYER ++ if (m_omxplayer_mode && OMXStillPlaying(m_OmxPlayerState.bOmxWaitVideo, m_OmxPlayerState.bOmxWaitAudio, m_dvdPlayerVideo->IsEOS(), m_dvdPlayerAudio->IsEOS())) ++ { ++ Sleep(100); ++ continue; ++ } ++#endif + + if (!m_pInputStream->IsEOF()) + CLog::Log(LOGINFO, "%s - eof reading from demuxer", __FUNCTION__); diff --git a/xbmc/cores/dvdplayer/DVDPlayer.h b/xbmc/cores/dvdplayer/DVDPlayer.h -index dac00e9..92d471d 100644 +index dac00e9..9f75ccf 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.h +++ b/xbmc/cores/dvdplayer/DVDPlayer.h -@@ -299,6 +299,7 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer +@@ -71,6 +71,20 @@ class OMXClock + }; + #endif + ++struct SOmxPlayerState ++{ ++ OMXClock av_clock; // openmax clock component ++ EDEINTERLACEMODE current_deinterlace; // whether deinterlace is currently enabled ++ bool bOmxWaitVideo; // whether we need to wait for video to play out on EOS ++ bool bOmxWaitAudio; // whether we need to wait for audio to play out on EOS ++ bool bOmxSentEOFs; // flag if we've send EOFs to audio/video players ++ float threshold; // current fifo threshold required to come out of buffering ++ int video_fifo; // video fifo to gpu level ++ int audio_fifo; // audio fifo to gpu level ++ double last_check_time; // we periodically check for gpu underrun ++ double stamp; // last media timestamp ++}; ++ + class CDVDInputStream; + + class CDVDDemux; +@@ -297,8 +311,6 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer + + void CreatePlayers(); void DestroyPlayers(); - void OMXDoProcessing(); - bool OMXStillPlaying(); -+ void OMXCreatePlayers(); +- void OMXDoProcessing(); +- bool OMXStillPlaying(); bool OpenStream(CCurrentStream& current, int iStream, int source, bool reset = true); bool OpenStreamPlayer(CCurrentStream& current, CDVDStreamInfo& hint, bool reset); +@@ -537,18 +549,6 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer + bool m_DemuxerPausePending; + + // omxplayer variables +- struct SOmxPlayerState +- { +- OMXClock av_clock; // openmax clock component +- EDEINTERLACEMODE current_deinterlace; // whether deinterlace is currently enabled +- bool bOmxWaitVideo; // whether we need to wait for video to play out on EOS +- bool bOmxWaitAudio; // whether we need to wait for audio to play out on EOS +- bool bOmxSentEOFs; // flag if we've send EOFs to audio/video players +- float threshold; // current fifo threshold required to come out of buffering +- int video_fifo; // video fifo to gpu level +- int audio_fifo; // audio fifo to gpu level +- double last_check_time; // we periodically check for gpu underrun +- double stamp; // last media timestamp +- } m_OmxPlayerState; ++ struct SOmxPlayerState m_OmxPlayerState; + bool m_omxplayer_mode; // using omxplayer acceleration + }; diff --git a/xbmc/cores/omxplayer/Makefile.in b/xbmc/cores/omxplayer/Makefile.in -index 77c25aa..e5cad70 100644 +index 77c25aa..5852cba 100644 --- a/xbmc/cores/omxplayer/Makefile.in +++ b/xbmc/cores/omxplayer/Makefile.in @@ -1,6 +1,7 @@ CXXFLAGS += -D__STDC_FORMAT_MACROS -SRCS = OMXAudio.cpp -+SRCS = OMXPlayer.cpp ++SRCS = OMXHelper.cpp +SRCS += OMXAudio.cpp SRCS += OMXVideo.cpp SRCS += OMXAudioCodecOMX.cpp SRCS += OMXPlayerAudio.cpp -diff --git a/xbmc/cores/omxplayer/OMXPlayer.cpp b/xbmc/cores/omxplayer/OMXPlayer.cpp +diff --git a/xbmc/cores/omxplayer/OMXHelper.cpp b/xbmc/cores/omxplayer/OMXHelper.cpp new file mode 100644 -index 0000000..562208a +index 0000000..cd383be --- /dev/null -+++ b/xbmc/cores/omxplayer/OMXPlayer.cpp -@@ -0,0 +1,230 @@ ++++ b/xbmc/cores/omxplayer/OMXHelper.cpp +@@ -0,0 +1,211 @@ +/* + * Copyright (C) 2014 Team XBMC + * http://xbmc.org @@ -4801,21 +5904,21 @@ index 0000000..562208a + return false; +} + -+void CDVDPlayer::OMXCreatePlayers() ++bool OMXPlayerUnsuitable(bool m_HasVideo, bool m_HasAudio, CDVDDemux* m_pDemuxer, CDVDInputStream* m_pInputStream, CSelectionStreams &m_SelectionStreams) +{ -+ bool omxplayer_mode = m_omxplayer_mode; -+ bool autoomx = CSettings::Get().GetBool("videoplayer.usemmal"); ++ // if no MMAL acceleration stick with omxplayer regardless ++ if (!CSettings::Get().GetBool("videoplayer.usemmal")) ++ return false; + + // omxplayer only handles Pi sink -+ if (autoomx && m_omxplayer_mode && -+ CSettings::Get().GetString("audiooutput.audiodevice") != "PI:Analogue" && ++ if (CSettings::Get().GetString("audiooutput.audiodevice") != "PI:Analogue" && + CSettings::Get().GetString("audiooutput.audiodevice") != "PI:HDMI" && + CSettings::Get().GetString("audiooutput.audiodevice") != "PI:Both") + { -+ CLog::Log(LOGNOTICE, "COMXPlayer::%s OMXPlayer unsuitable due to audio sink", __func__); -+ m_omxplayer_mode = false; ++ CLog::Log(LOGNOTICE, "%s OMXPlayer unsuitable due to audio sink", __func__); ++ return true; + } -+ if (autoomx && m_pDemuxer && m_omxplayer_mode) ++ if (m_pDemuxer) + { + // find video stream + int num_supported = 0, num_unsupported = 0; @@ -4846,44 +5949,30 @@ index 0000000..562208a + } + if (num_unsupported > 0 && num_supported == 0) + { -+ CLog::Log(LOGNOTICE, "COMXPlayer::%s OMXPlayer unsuitable due to video codec (%x:%d/%d)", __func__, codec, num_supported, num_unsupported); -+ m_omxplayer_mode = false; ++ CLog::Log(LOGNOTICE, "%s OMXPlayer unsuitable due to video codec (%x:%d/%d)", __func__, codec, num_supported, num_unsupported); ++ return true; + } + } -+ if (autoomx && m_pInputStream && m_pInputStream->IsStreamType(DVDSTREAM_TYPE_DVD)) ++ if (m_pInputStream && m_pInputStream->IsStreamType(DVDSTREAM_TYPE_DVD)) + { -+ CLog::Log(LOGNOTICE, "COMXPlayer::%s OMXPlayer unsuitable due to dvd menus", __func__); -+ m_omxplayer_mode = false; -+ } -+ -+ if (m_omxplayer_mode != omxplayer_mode) -+ DestroyPlayers(); -+ -+ if (m_players_created) -+ return; -+ -+ if (m_omxplayer_mode) -+ { -+ m_dvdPlayerVideo = new OMXPlayerVideo(&m_OmxPlayerState.av_clock, &m_overlayContainer, m_messenger); -+ m_dvdPlayerAudio = new OMXPlayerAudio(&m_OmxPlayerState.av_clock, m_messenger); -+ } -+ else -+ { -+ m_dvdPlayerVideo = new CDVDPlayerVideo(&m_clock, &m_overlayContainer, m_messenger); -+ m_dvdPlayerAudio = new CDVDPlayerAudio(&m_clock, m_messenger); ++ CLog::Log(LOGNOTICE, "%s OMXPlayer unsuitable due to dvd menus", __func__); ++ return true; + } ++ return false; +} + -+void CDVDPlayer::OMXDoProcessing() ++bool OMXDoProcessing(struct SOmxPlayerState &m_OmxPlayerState, int m_playSpeed, IDVDStreamPlayerVideo *m_dvdPlayerVideo, IDVDStreamPlayerAudio *m_dvdPlayerAudio, ++ CCurrentStream m_CurrentAudio, CCurrentStream m_CurrentVideo, bool m_HasVideo, bool m_HasAudio) +{ ++ bool reopen_stream = false; + double now = CDVDClock::GetAbsoluteClock(); + if (m_OmxPlayerState.last_check_time == 0.0 || m_OmxPlayerState.last_check_time + DVD_MSEC_TO_TIME(20) <= now) + { + m_OmxPlayerState.last_check_time = now; + m_OmxPlayerState.stamp = m_OmxPlayerState.av_clock.OMXMediaTime(); + const bool m_Pause = m_playSpeed == DVD_PLAYSPEED_PAUSE; -+ const bool not_accepts_data = (!m_dvdPlayerAudio->AcceptsData() && m_CurrentAudio.id >= 0) || -+ (!m_dvdPlayerVideo->AcceptsData() && m_CurrentVideo.id >= 0); ++ const bool not_accepts_data = (!m_dvdPlayerAudio->AcceptsData() && m_HasAudio) || ++ (!m_dvdPlayerVideo->AcceptsData() && m_HasVideo >= 0); + /* when the video/audio fifos are low, we pause clock, when high we resume */ + double audio_pts = floor(m_dvdPlayerAudio->GetCurrentPts()); + double video_pts = floor(m_dvdPlayerVideo->GetCurrentPts()); @@ -4896,11 +5985,8 @@ index 0000000..562208a + // if deinterlace setting has changed, we should close and open video + if (m_OmxPlayerState.current_deinterlace != CMediaSettings::Get().GetCurrentVideoSettings().m_DeinterlaceMode) + { -+ CloseStream(m_CurrentVideo, false); -+ OpenStream(m_CurrentVideo, m_CurrentVideo.id, m_CurrentVideo.source); -+ if (m_State.canseek) -+ m_messenger.Put(new CDVDMsgPlayerSeek(GetTime(), true, true, true, true, true)); + m_OmxPlayerState.current_deinterlace = CMediaSettings::Get().GetCurrentVideoSettings().m_DeinterlaceMode; ++ reopen_stream = true; + } + + m_OmxPlayerState.video_fifo = (int)(100.0*(m_dvdPlayerVideo->GetDecoderBufferSize()-m_dvdPlayerVideo->GetDecoderFreeSpace())/m_dvdPlayerVideo->GetDecoderBufferSize()); @@ -4944,7 +6030,8 @@ index 0000000..562208a + + #ifdef _DEBUG + CLog::Log(LOGDEBUG, "%s::%s M:%.6f-%.6f (A:%.6f V:%.6f) PEF:%d%d%d S:%.2f A:%.2f V:%.2f/T:%.2f (A:%d%d V:%d%d) A:%d%% V:%d%% (%.2f,%.2f)", "CDVDPlayer", __FUNCTION__, -+ m_OmxPlayerState.stamp*1e-6, m_OmxPlayerState.av_clock.OMXClockAdjustment()*1e-6, audio_pts*1e-6, video_pts*1e-6, m_OmxPlayerState.av_clock.OMXIsPaused(), m_OmxPlayerState.bOmxSentEOFs, not_accepts_data, m_playSpeed * (1.0f/DVD_PLAYSPEED_NORMAL), ++ m_OmxPlayerState.stamp*1e-6, m_OmxPlayerState.av_clock.OMXClockAdjustment()*1e-6, audio_pts*1e-6, video_pts*1e-6, ++ m_OmxPlayerState.av_clock.OMXIsPaused(), m_OmxPlayerState.bOmxSentEOFs, not_accepts_data, m_playSpeed * (1.0f/DVD_PLAYSPEED_NORMAL), + audio_pts == DVD_NOPTS_VALUE ? 0.0:audio_fifo, video_pts == DVD_NOPTS_VALUE ? 0.0:video_fifo, m_OmxPlayerState.threshold, + audio_fifo_low, audio_fifo_high, video_fifo_low, video_fifo_high, + m_dvdPlayerAudio->GetLevel(), m_dvdPlayerVideo->GetLevel(), m_dvdPlayerAudio->GetDelay(), (float)m_dvdPlayerAudio->GetCacheTotal()); @@ -4971,27 +6058,58 @@ index 0000000..562208a + } + } + } ++ return reopen_stream; +} + -+bool CDVDPlayer::OMXStillPlaying() ++bool OMXStillPlaying(bool waitVideo, bool waitAudio, bool eosVideo, bool eosAudio) +{ -+ if (m_omxplayer_mode) -+ { -+ // wait for omx components to finish -+ if(m_OmxPlayerState.bOmxWaitVideo && !m_dvdPlayerVideo->IsEOS()) -+ return true; -+ if(m_OmxPlayerState.bOmxWaitAudio && !m_dvdPlayerAudio->IsEOS()) -+ return true; -+ } -+ return false; ++ // wait for omx components to finish ++ if (waitVideo && !eosVideo) ++ return true; ++ if (waitAudio && !eosAudio) ++ return true; +} + +#endif +diff --git a/xbmc/cores/omxplayer/OMXHelper.h b/xbmc/cores/omxplayer/OMXHelper.h +new file mode 100644 +index 0000000..ef12051 +--- /dev/null ++++ b/xbmc/cores/omxplayer/OMXHelper.h +@@ -0,0 +1,28 @@ ++/* ++ * Copyright (C) 2014 Team XBMC ++ * http://xbmc.org ++ * ++ * This Program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2, or (at your option) ++ * any later version. ++ * ++ * This Program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with XBMC; see the file COPYING. If not, see ++ * . ++ * ++ */ ++ ++#pragma once ++ ++#include "system.h" ++ ++bool OMXPlayerUnsuitable(bool m_HasVideo, bool m_HasAudio, CDVDDemux* m_pDemuxer, CDVDInputStream* m_pInputStream, CSelectionStreams &m_SelectionStreams); ++bool OMXDoProcessing(struct SOmxPlayerState &m_OmxPlayerState, int m_playSpeed, IDVDStreamPlayerVideo *m_dvdPlayerVideo, IDVDStreamPlayerAudio *m_dvdPlayerAudio, ++ CCurrentStream m_CurrentAudio, CCurrentStream m_CurrentVideo, bool m_HasVideo, bool m_HasAudio); ++bool OMXStillPlaying(bool waitVideo, bool waitAudio, bool eosVideo, bool eosAudio); -From 8f7d7983d27d40d79b2d825cab1e14cc70d43bb4 Mon Sep 17 00:00:00 2001 +From 17ee98a879d8929d9c5cf4ade5b568653f2e0fc6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 27 Oct 2014 13:06:57 +0000 -Subject: [PATCH 39/84] [rbp] Make cachemembuffersize default depend on memory +Subject: [PATCH 38/88] [rbp] Make cachemembuffersize default depend on memory size --- @@ -5048,10 +6166,10 @@ index 7d04872..ca2d33c 100644 // as multiply of the default data read rate -From fd2eb889da0192e4432507301b31689964a68de3 Mon Sep 17 00:00:00 2001 +From 91a06aa3d399a72bf31ffdcccd3a2d5d381bcef3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 16 Jun 2014 19:06:00 +0100 -Subject: [PATCH 41/84] [experimental] Disable quiet-noise generation +Subject: [PATCH 40/88] [experimental] Disable quiet-noise generation --- xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp | 2 ++ @@ -5078,10 +6196,10 @@ index c6272cc..9111593 100644 void CActiveAESink::SetSilenceTimer() -From bfc0bf7ce1679fbf49e76f07b05dc44f2146b3d9 Mon Sep 17 00:00:00 2001 +From 50350740bab517dbe5a1ce19bbebae3c43f0f587 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 30 May 2014 14:58:43 +0100 -Subject: [PATCH 42/84] [settings] Experiment: Report DESKTOP resolution in +Subject: [PATCH 41/88] [settings] Experiment: Report DESKTOP resolution in video settings --- @@ -5103,10 +6221,10 @@ index 6902f83..50c5f97 100644 StringUtils::Format("%dx%d%s", resolution->width, resolution->height, ModeFlagsToString(resolution->flags, false).c_str()), -From 0f32cb56a27b67230812564ba2f9dd48a33c61ae Mon Sep 17 00:00:00 2001 +From 09169ff5a2794e4456b606f55f5e37410392ccae Mon Sep 17 00:00:00 2001 From: macrule Date: Thu, 11 Apr 2013 18:24:42 +0200 -Subject: [PATCH 43/84] Added some vc_tv_* functions that were missing in +Subject: [PATCH 42/88] Added some vc_tv_* functions that were missing in DllBCM. --- @@ -5141,10 +6259,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 c1b97c0fc05d206b619ec437bf7b609f418ee4e5 Mon Sep 17 00:00:00 2001 +From 18647b15e92e3e41c09e67d8dd2b02d8f739ac1e Mon Sep 17 00:00:00 2001 From: macrule Date: Thu, 11 Apr 2013 18:29:03 +0200 -Subject: [PATCH 44/84] Added private utility function to map a float display +Subject: [PATCH 43/88] Added private utility function to map a float display aspect, to the respective SDTV_ASPECT_* enum value. --- @@ -5182,10 +6300,10 @@ index bf1e589..518a87d 100644 bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &resolutions) -From d2b586f8dd1e5fe997ebdd93c3379db815ac5728 Mon Sep 17 00:00:00 2001 +From e18ffe3825f9e188b7cf12a50f0b94ebacc181fb Mon Sep 17 00:00:00 2001 From: macrule Date: Thu, 11 Apr 2013 19:50:58 +0200 -Subject: [PATCH 45/84] Changed SDTV resolutions to be treated similarly to +Subject: [PATCH 44/88] 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. @@ -5282,10 +6400,10 @@ index 59401f5..a0acb1a 100644 int m_width; int m_height; -From 0da9914c6a192bab9675b1b0b56431c244cd7697 Mon Sep 17 00:00:00 2001 +From e35fa3ed5e20e15b190f91ca80fc0b5ac27f68f9 Mon Sep 17 00:00:00 2001 From: macrule Date: Thu, 11 Apr 2013 19:54:59 +0200 -Subject: [PATCH 46/84] Added methods SuspendVideoOutput() and +Subject: [PATCH 45/88] 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. @@ -5349,10 +6467,10 @@ index 9dc39d5..ca36082 100644 CEGLNativeTypeRaspberryPI::CEGLNativeTypeRaspberryPI() { -From 15b66d80f48eccb4126a1c9a997c8337743b123e Mon Sep 17 00:00:00 2001 +From 3a2ef0a5d9d77cab51e708e4a53283fc095bb199 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 11 Aug 2013 15:03:36 +0100 -Subject: [PATCH 47/84] PowerManager (and its IPowerSyscall instance) now gets +Subject: [PATCH 46/88] 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. @@ -5445,10 +6563,10 @@ index 0b1f10a..e42b143 100644 void OnSleep(); void OnWake(); -From fcfadef47de52c6691d057e88b49d13122500d87 Mon Sep 17 00:00:00 2001 +From 6117b40fc764890ee3cbfa39fe2aa35221dc074d Mon Sep 17 00:00:00 2001 From: macrule Date: Wed, 17 Apr 2013 13:23:01 +0200 -Subject: [PATCH 48/84] Added CPowerSyscallVirtualSleep class, which acts as a +Subject: [PATCH 47/88] 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. @@ -5624,10 +6742,10 @@ index 0000000..ef6e682 + +#endif // _POWER_SYSCALL_VIRTUAL_SLEEP_H_ -From 041dadd68855d2dc59ce068eb081b77836420e53 Mon Sep 17 00:00:00 2001 +From f93c56c38837df334babbb86a85704147d7c2747 Mon Sep 17 00:00:00 2001 From: macrule Date: Wed, 17 Apr 2013 13:24:22 +0200 -Subject: [PATCH 49/84] Added power management support for the Raspberry Pi. +Subject: [PATCH 48/88] 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. @@ -5773,10 +6891,10 @@ index 0000000..fd1d67c + +#endif // _RASPBERRY_PI_POWER_SYSCALL_H_ -From 47a6a21243c0559ab2881abf13619b43660500e2 Mon Sep 17 00:00:00 2001 +From 5d57c79efc6dbd4e53e443d00cd311db36ee4c00 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Mar 2014 16:16:29 +0000 -Subject: [PATCH 50/84] [power] hack - don't kill lirc or cec +Subject: [PATCH 49/88] [power] hack - don't kill lirc or cec --- xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 37 +++++++++++++++++++++++ @@ -5860,10 +6978,10 @@ index 2d8c750..901f449 100644 CBuiltins::Execute("LIRC.Start"); #endif -From 1ab9c6b73ed7d793f728749a1f9d3eb70396483b Mon Sep 17 00:00:00 2001 +From 0f345d5255c0ba3eaa3de4d5e3edafa8b9ee1353 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Mar 2014 16:47:54 +0000 -Subject: [PATCH 51/84] [power] hack - wake on any action +Subject: [PATCH 50/88] [power] hack - wake on any action --- xbmc/powermanagement/PowerSyscallVirtualSleep.cpp | 6 +++--- @@ -5892,10 +7010,10 @@ index 6a1e47b..a717a09 100644 if(VirtualWake()) { -From 9cbf2f371f474c13a838730c1536686e3a72cd9c Mon Sep 17 00:00:00 2001 +From 7eda27088504039e1aa86dc73ed5303e84cad7ca Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Mar 2014 17:30:07 +0000 -Subject: [PATCH 52/84] [power] hack - Make suspend toggle suspend state +Subject: [PATCH 51/88] [power] hack - Make suspend toggle suspend state --- xbmc/powermanagement/PowerSyscallVirtualSleep.cpp | 5 +++++ @@ -5918,10 +7036,10 @@ index a717a09..d39c3ed 100644 return false; } -From 7a3661be824a636926f6ea163f3de5d8a27d0327 Mon Sep 17 00:00:00 2001 +From f74a34032d6a15d74d357a2da9df26c82fb18c14 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 4 Mar 2014 19:33:44 +0000 -Subject: [PATCH 53/84] [power] Add back in powerdown and reboot +Subject: [PATCH 52/88] [power] Add back in powerdown and reboot --- .../linux/RaspberryPIPowerSyscall.cpp | 34 ++++++++++++++++++++++ @@ -5999,10 +7117,10 @@ index fd1d67c..062132e 100644 virtual bool CanReboot() { return true; } -From 37bb35f10e4af3ae5de7ac8d5f81362ef9be04a1 Mon Sep 17 00:00:00 2001 +From 49c8eeecb99941aa2ba5b14f45e6ebcdc324ac9a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 26 Apr 2014 17:27:52 +0100 -Subject: [PATCH 54/84] [cec] Don't suspend pi on tv switch off - it can't wake +Subject: [PATCH 53/88] [cec] Don't suspend pi on tv switch off - it can't wake up --- @@ -6023,10 +7141,10 @@ index a67dc2f..680863e 100644 -From 3a0fe40bf7d89c4d2aa87b7a256f3a30a6b6643d Mon Sep 17 00:00:00 2001 +From 70db53f6198e3c33692992e81c808e24e0c515d6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 27 Jun 2014 00:01:05 +0100 -Subject: [PATCH 55/84] [rbp] Resume video output on startup +Subject: [PATCH 54/88] [rbp] Resume video output on startup --- xbmc/linux/RBP.cpp | 3 +++ @@ -6047,10 +7165,10 @@ index cb87b77..34866f6 100644 m_omx_image_init = true; return true; -From cd169945ad5ca652235b1251a7121dfb5b5825ca Mon Sep 17 00:00:00 2001 +From 738d2617a7e78b92cccf72da2a5057e2ee4eb90d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 16 Aug 2014 21:01:42 +0100 -Subject: [PATCH 56/84] omxrender: Hacks to reduce GUI rendering rate when +Subject: [PATCH 55/88] omxrender: Hacks to reduce GUI rendering rate when playing video --- @@ -6060,10 +7178,10 @@ Subject: [PATCH 56/84] omxrender: Hacks to reduce GUI rendering rate when 3 files changed, 60 insertions(+) diff --git a/language/English/strings.po b/language/English/strings.po -index 92c958b..941ebea 100755 +index 9aa583b..6f6c761 100755 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -16090,3 +16090,30 @@ msgstr "" +@@ -16092,3 +16092,30 @@ msgstr "" msgctxt "#38021" msgid "Allow viewing and playing files in archives (e.g. zip, rar)" msgstr "" @@ -6150,10 +7268,10 @@ index 77fce2e..3c7b202 100644 int vsync_mode = CSettings::Get().GetInt("videoscreen.vsync"); -From 230e15144ab95aad90b2326a1cba36245e0eb0a4 Mon Sep 17 00:00:00 2001 +From 4b3ba7e45469e0ff462602bd5038355a314216e9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 9 Sep 2014 12:04:26 +0100 -Subject: [PATCH 57/84] egl: Treat unknown display aspect ratio as square pixel +Subject: [PATCH 56/88] egl: Treat unknown display aspect ratio as square pixel --- xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 4 ++-- @@ -6182,10 +7300,10 @@ index ca36082..1529045 100644 SetResolutionString(m_desktopRes); -From 50f665a8fc360edd978327e6ea887590e5a8480c Mon Sep 17 00:00:00 2001 +From 75ec9b8b5952b8f209a26b033fbffcc22a59f8b2 Mon Sep 17 00:00:00 2001 From: anaconda Date: Thu, 11 Sep 2014 21:30:43 +0200 -Subject: [PATCH 58/84] Disable textbox autoscrolling while on screensaver. +Subject: [PATCH 57/88] Disable textbox autoscrolling while on screensaver. SQUASH: only if dim or black --- @@ -6246,10 +7364,10 @@ index b7ef051..e149418 100644 if (m_lastRenderTime) m_autoScrollDelayTime += currentTime - m_lastRenderTime; -From b7fc33db7a9e57cf0bf27599d33d1b866e502a90 Mon Sep 17 00:00:00 2001 +From c2fd03068cd4a7dcd669a2297f3c89ff379840b7 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 18 Sep 2014 14:24:56 +0100 -Subject: [PATCH 59/84] [omxplayer] Only enable audio clock master when A/V +Subject: [PATCH 58/88] [omxplayer] Only enable audio clock master when A/V sync method is set to audio clock --- @@ -6280,10 +7398,10 @@ index 549700c..db0886e 100644 OMX_CONFIG_BOOLEANTYPE configBool; OMX_INIT_STRUCTURE(configBool); -From a09ca0ad8c371795aa8ebaa5bf66b31f82e38e5e Mon Sep 17 00:00:00 2001 +From 0d76f7659bf9785028263ccb17ab800bcbfcbfdd Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 19 Sep 2014 11:54:49 +0100 -Subject: [PATCH 60/84] [dvdplayer/rbp] Add pi specific option to maintain +Subject: [PATCH 59/88] [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". @@ -6302,10 +7420,10 @@ Needed updated firmware 7 files changed, 76 insertions(+), 3 deletions(-) diff --git a/language/English/strings.po b/language/English/strings.po -index 941ebea..27fb08a 100755 +index 6f6c761..725205a 100755 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -16117,3 +16117,8 @@ msgstr "" +@@ -16119,3 +16119,8 @@ msgstr "" msgctxt "#38005" msgid "24 fps" msgstr "" @@ -6360,10 +7478,10 @@ index 782a9ba..3e0390c 100644 struct AEDelayStatus diff --git a/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp b/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp -index 98da461..bb2c375 100644 +index f567518..5e9a6d3 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp -@@ -112,6 +112,7 @@ CDVDPlayerAudio::CDVDPlayerAudio(CDVDClock* pClock, CDVDMessageQueue& parent) +@@ -113,6 +113,7 @@ CDVDPlayerAudio::CDVDPlayerAudio(CDVDClock* pClock, CDVDMessageQueue& parent) m_started = false; m_silence = false; m_resampleratio = 1.0; @@ -6371,7 +7489,7 @@ index 98da461..bb2c375 100644 m_synctype = SYNC_DISCON; m_setsynctype = SYNC_DISCON; m_prevsynctype = -1; -@@ -472,6 +473,8 @@ void CDVDPlayerAudio::UpdatePlayerInfo() +@@ -475,6 +476,8 @@ void CDVDPlayerAudio::UpdatePlayerInfo() //if the resample ratio is 0.5, then we're playing twice as fast if (m_synctype == SYNC_RESAMPLE) s << ", rr:" << fixed << setprecision(5) << 1.0 / m_resampleratio; @@ -6380,7 +7498,7 @@ index 98da461..bb2c375 100644 s << ", att:" << fixed << setprecision(1) << log(GetCurrentAttenuation()) * 20.0f << " dB"; -@@ -622,8 +625,8 @@ void CDVDPlayerAudio::SetSyncType(bool passthrough) +@@ -627,8 +630,8 @@ void CDVDPlayerAudio::SetSyncType(bool passthrough) if (m_synctype != m_prevsynctype) { @@ -6391,7 +7509,7 @@ index 98da461..bb2c375 100644 CLog::Log(LOGDEBUG, "CDVDPlayerAudio:: synctype set to %i: %s", m_synctype, synctypes[synctype]); m_prevsynctype = m_synctype; } -@@ -697,6 +700,31 @@ void CDVDPlayerAudio::HandleSyncError(double duration) +@@ -702,6 +705,31 @@ void CDVDPlayerAudio::HandleSyncError(double duration) } m_resampleratio = 1.0 / m_pClock->GetClockSpeed() + proportional + m_integral; } @@ -6423,7 +7541,7 @@ index 98da461..bb2c375 100644 } } -@@ -735,6 +763,10 @@ bool CDVDPlayerAudio::OutputPacket(DVDAudioFrame &audioframe) +@@ -740,6 +768,10 @@ bool CDVDPlayerAudio::OutputPacket(DVDAudioFrame &audioframe) m_dvdAudio.SetResampleRatio(m_resampleratio); m_dvdAudio.AddPackets(audioframe); } @@ -6481,10 +7599,10 @@ index f947acc..606c24f 100644 void SuspendVideoOutput(); void ResumeVideoOutput(); -From 7f5d27a9a0406d05987b3d58bca83a8d5e4ebfae Mon Sep 17 00:00:00 2001 +From c4e58556721b7a82e2ef1f7939d5f4932bf8febb Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 21 Sep 2014 18:31:31 +0100 -Subject: [PATCH 61/84] hack: revert squash: don't update originaldts when +Subject: [PATCH 60/88] hack: revert squash: don't update originaldts when marked as invalid --- @@ -6492,10 +7610,10 @@ Subject: [PATCH 61/84] hack: revert squash: don't update originaldts when 1 file changed, 1 insertion(+) diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index 8d5c776..39cd96f 100644 +index 2a2202f..3ab62c2 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -1927,6 +1927,7 @@ void CDVDPlayer::CheckContinuity(CCurrentStream& current, DemuxPacket* pPacket) +@@ -1959,6 +1959,7 @@ void CDVDPlayer::CheckContinuity(CCurrentStream& current, DemuxPacket* pPacket) // not sure yet - flags the packets as unknown until we get confirmation on another audio/video packet pPacket->dts = DVD_NOPTS_VALUE; pPacket->pts = DVD_NOPTS_VALUE; @@ -6504,10 +7622,10 @@ index 8d5c776..39cd96f 100644 } else -From 4bd3f761adccd7108d592c6d699e7837b9fe0fcf Mon Sep 17 00:00:00 2001 +From 2dd0aab99a4b25807d04823f23b7e16ba04b7eec Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 27 Sep 2014 15:27:04 +0100 -Subject: [PATCH 62/84] [omxplayer] Don't sync up to passthrough audio packets +Subject: [PATCH 61/88] [omxplayer] Don't sync up to passthrough audio packets - let GPU handle it This code was just broken. @@ -6765,10 +7883,10 @@ index 7cf10ad..f014364 100644 OMX_AUDIO_CODINGTYPE m_eEncoding; uint8_t *m_extradata; -From c577e54a5671508911906aac4c5c19cd7fc175e3 Mon Sep 17 00:00:00 2001 +From 4769ff56b3626216eb3afe23a27777210d39acf6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 27 Sep 2014 15:32:37 +0100 -Subject: [PATCH 63/84] [dvdplayer] exerimental: don't raise priority of audio +Subject: [PATCH 62/88] [dvdplayer] exerimental: don't raise priority of audio thread --- @@ -6776,10 +7894,10 @@ Subject: [PATCH 63/84] [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 39cd96f..cefbada 100644 +index 3ab62c2..6bb9ede 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -3141,7 +3141,11 @@ bool CDVDPlayer::OpenAudioStream(CDVDStreamInfo& hint, bool reset) +@@ -3176,7 +3176,11 @@ bool CDVDPlayer::OpenAudioStream(CDVDStreamInfo& hint, bool reset) m_dvdPlayerAudio->SendMessage(new CDVDMsg(CDVDMsg::PLAYER_STARTED), 1); /* audio normally won't consume full cpu, so let it have prio */ @@ -6792,401 +7910,10 @@ index 39cd96f..cefbada 100644 } -From 5a33b8386118c07456e9017c519e21f63ba5b9df Mon Sep 17 00:00:00 2001 -From: da-anda -Date: Sun, 17 Aug 2014 21:09:59 +0200 -Subject: [PATCH 64/84] handle stereoscopic mode of videos in mixed playlists - ---- - language/English/strings.po | 2 +- - xbmc/guilib/StereoscopicsManager.cpp | 76 +++++++++++++++++++++++------------- - 2 files changed, 49 insertions(+), 29 deletions(-) - -diff --git a/language/English/strings.po b/language/English/strings.po -index 27fb08a..78965a2 100755 ---- a/language/English/strings.po -+++ b/language/English/strings.po -@@ -15751,7 +15751,7 @@ msgstr "" - #. Description of setting "Videos -> Playback -> Disable stereoscopic mode when playback is stopped" with label #36526 - #: system/settings/settings.xml - msgctxt "#36538" --msgid "[Enabled] Switch GUI (and some TVs) back to 2D mode when playback ended. [Disabled] GUI and TV will stay in stereoscopic 3D mode. For video playlists the stereoscopic 3D mode won't change between videos, not even for non stereoscopic ones." -+msgid "[Enabled] Switch GUI (and some TVs) back to 2D mode when playback ended - also between videos in a playlist if necessary. [Disabled] GUI and TV will stay in stereoscopic 3D mode. For video playlists the stereoscopic 3D mode won't change between videos, not even for non stereoscopic ones." - msgstr "" - - #. Description of setting "System -> Video output -> Stereoscopic mode (current)" with label #36500 -diff --git a/xbmc/guilib/StereoscopicsManager.cpp b/xbmc/guilib/StereoscopicsManager.cpp -index 35ba597..b013942 100644 ---- a/xbmc/guilib/StereoscopicsManager.cpp -+++ b/xbmc/guilib/StereoscopicsManager.cpp -@@ -123,13 +123,23 @@ RENDER_STEREO_MODE CStereoscopicsManager::GetStereoMode(void) - void CStereoscopicsManager::SetStereoMode(const RENDER_STEREO_MODE &mode) - { - RENDER_STEREO_MODE currentMode = GetStereoMode(); -- if (mode != currentMode && mode >= RENDER_STEREO_MODE_OFF) -+ RENDER_STEREO_MODE applyMode = mode; -+ -+ // resolve automatic mode before applying -+ if (mode == RENDER_STEREO_MODE_AUTO) - { -- if(!g_Windowing.SupportsStereo(mode)) -- return; -+ if (g_infoManager.EvaluateBool("videoplayer.isstereoscopic")) -+ applyMode = GetStereoModeOfPlayingVideo(); -+ else -+ applyMode = RENDER_STEREO_MODE_OFF; -+ } - -+ if (applyMode != currentMode && applyMode >= RENDER_STEREO_MODE_OFF) -+ { -+ if (!g_Windowing.SupportsStereo(applyMode)) -+ return; - m_lastStereoMode = currentMode; -- CSettings::Get().SetInt("videoscreen.stereoscopicmode", mode); -+ CSettings::Get().SetInt("videoscreen.stereoscopicmode", applyMode); - } - } - -@@ -210,6 +220,12 @@ RENDER_STEREO_MODE CStereoscopicsManager::GetStereoModeByUserChoice(const CStdSt - if (mode == selectableMode) - pDlgSelect->SetSelected( label ); - } -+ // inject AUTO pseudo mode after OFF -+ if (i == RENDER_STEREO_MODE_OFF) -+ { -+ selectableModes.push_back(RENDER_STEREO_MODE_AUTO); -+ pDlgSelect->Add(GetLabelForStereoMode(RENDER_STEREO_MODE_AUTO)); -+ } - } - - pDlgSelect->DoModal(); -@@ -248,20 +264,7 @@ CStdString CStereoscopicsManager::GetLabelForStereoMode(const RENDER_STEREO_MODE - - RENDER_STEREO_MODE CStereoscopicsManager::GetPreferredPlaybackMode(void) - { -- RENDER_STEREO_MODE playbackMode = m_lastStereoMode; -- int preferredMode = CSettings::Get().GetInt("videoscreen.preferedstereoscopicmode"); -- if (preferredMode == RENDER_STEREO_MODE_AUTO) // automatic mode, detect by movie -- { -- if (g_infoManager.EvaluateBool("videoplayer.isstereoscopic")) -- playbackMode = GetStereoModeOfPlayingVideo(); -- else if (playbackMode == RENDER_STEREO_MODE_OFF) -- playbackMode = GetNextSupportedStereoMode(RENDER_STEREO_MODE_OFF); -- } -- else // predefined mode -- { -- playbackMode = (RENDER_STEREO_MODE) preferredMode; -- } -- return playbackMode; -+ return (RENDER_STEREO_MODE) CSettings::Get().GetInt("videoscreen.preferedstereoscopicmode"); - } - - int CStereoscopicsManager::ConvertVideoToGuiStereoMode(const std::string &mode) -@@ -450,9 +453,6 @@ void CStereoscopicsManager::ApplyStereoMode(const RENDER_STEREO_MODE &mode, bool - - void CStereoscopicsManager::OnPlaybackStarted(void) - { -- if (!g_infoManager.EvaluateBool("videoplayer.isstereoscopic")) -- return; -- - STEREOSCOPIC_PLAYBACK_MODE playbackMode = (STEREOSCOPIC_PLAYBACK_MODE) CSettings::Get().GetInt("videoplayer.stereoscopicplaybackmode"); - RENDER_STEREO_MODE mode = GetStereoMode(); - -@@ -460,8 +460,31 @@ void CStereoscopicsManager::OnPlaybackStarted(void) - if (playbackMode == STEREOSCOPIC_PLAYBACK_MODE_IGNORE && mode == RENDER_STEREO_MODE_OFF) - return; - -- if (mode != RENDER_STEREO_MODE_OFF) -+ if (!g_infoManager.EvaluateBool("videoplayer.isstereoscopic")) -+ { -+ // exit stereo mode if started item is not stereoscopic -+ // and if user prefers to stop 3D playback when movie is finished -+ if (mode != RENDER_STEREO_MODE_OFF && CSettings::Get().GetBool("videoplayer.quitstereomodeonstop")) -+ SetStereoMode(RENDER_STEREO_MODE_OFF); - return; -+ } -+ -+ RENDER_STEREO_MODE preferred = GetPreferredPlaybackMode(); -+ RENDER_STEREO_MODE playing = GetStereoModeOfPlayingVideo(); -+ -+ if (mode != RENDER_STEREO_MODE_OFF) -+ { -+ // don't change mode if user selected to not exit stereomode on playback stop -+ // users selecting this option usually have to manually switch their TV into 3D mode -+ // and would be annoyed by having to switch TV modes when next movies comes up -+ // @todo probably add a new setting for just this behavior -+ if (CSettings::Get().GetBool("videoplayer.quitstereomodeonstop") == false) -+ return; -+ -+ // only change to new stereo mode if not yet in preferred stereo mode -+ if (mode == preferred || (preferred == RENDER_STEREO_MODE_AUTO && mode == playing)) -+ return; -+ } - - switch (playbackMode) - { -@@ -473,9 +496,6 @@ void CStereoscopicsManager::OnPlaybackStarted(void) - pDlgSelect->Reset(); - pDlgSelect->SetHeading(g_localizeStrings.Get(36527).c_str()); - -- RENDER_STEREO_MODE preferred = GetPreferredPlaybackMode(); -- RENDER_STEREO_MODE playing = GetStereoModeOfPlayingVideo(); -- - int idx_playing = -1 - , idx_mono = -1; - -@@ -488,7 +508,7 @@ void CStereoscopicsManager::OnPlaybackStarted(void) - - idx_mono = pDlgSelect->Add(GetLabelForStereoMode(RENDER_STEREO_MODE_MONO)); // mono / 2d - -- if(playing != RENDER_STEREO_MODE_OFF && playing != preferred && g_Windowing.SupportsStereo(playing)) -+ if (playing != RENDER_STEREO_MODE_OFF && playing != preferred && preferred != RENDER_STEREO_MODE_AUTO && g_Windowing.SupportsStereo(playing)) // same as movie - idx_playing = pDlgSelect->Add((CStdString)g_localizeStrings.Get(36532) - + " (" - + GetLabelForStereoMode(playing) -@@ -503,7 +523,7 @@ void CStereoscopicsManager::OnPlaybackStarted(void) - int iItem = pDlgSelect->GetSelectedLabel(); - if (iItem == idx_preferred) mode = preferred; - else if (iItem == idx_mono) mode = RENDER_STEREO_MODE_MONO; -- else if (iItem == idx_playing) mode = playing; -+ else if (iItem == idx_playing) mode = RENDER_STEREO_MODE_AUTO; - else if (iItem == idx_select) mode = GetStereoModeByUserChoice(); - - SetStereoMode(mode); -@@ -513,7 +533,7 @@ void CStereoscopicsManager::OnPlaybackStarted(void) - } - break; - case STEREOSCOPIC_PLAYBACK_MODE_PREFERRED: // Stereoscopic -- SetStereoMode( GetPreferredPlaybackMode() ); -+ SetStereoMode( preferred ); - break; - case 2: // Mono - SetStereoMode( RENDER_STEREO_MODE_MONO ); - -From c99fd0c13ba5fb22fde25dea5ac1b2596450bd78 Mon Sep 17 00:00:00 2001 -From: da-anda -Date: Sat, 16 Aug 2014 11:20:54 +0200 -Subject: [PATCH 65/84] remember user selected 3D modes between videos until - playback ended - ---- - xbmc/guilib/StereoscopicsManager.cpp | 79 ++++++++++++++++++++++++++---------- - xbmc/guilib/StereoscopicsManager.h | 6 ++- - xbmc/rendering/RenderSystem.h | 1 + - 3 files changed, 63 insertions(+), 23 deletions(-) - -diff --git a/xbmc/guilib/StereoscopicsManager.cpp b/xbmc/guilib/StereoscopicsManager.cpp -index b013942..3db8eaa 100644 ---- a/xbmc/guilib/StereoscopicsManager.cpp -+++ b/xbmc/guilib/StereoscopicsManager.cpp -@@ -95,7 +95,8 @@ static const struct StereoModeMap StringToGuiModeMap[] = - - CStereoscopicsManager::CStereoscopicsManager(void) - { -- m_lastStereoMode = RENDER_STEREO_MODE_OFF; -+ m_stereoModeSetByUser = RENDER_STEREO_MODE_UNDEFINED; -+ m_lastStereoModeSetByUser = RENDER_STEREO_MODE_UNDEFINED; - } - - CStereoscopicsManager::~CStereoscopicsManager(void) -@@ -110,7 +111,6 @@ CStereoscopicsManager& CStereoscopicsManager::Get(void) - - void CStereoscopicsManager::Initialize(void) - { -- m_lastStereoMode = GetStereoMode(); - // turn off stereo mode on XBMC startup - SetStereoMode(RENDER_STEREO_MODE_OFF); - } -@@ -120,6 +120,16 @@ RENDER_STEREO_MODE CStereoscopicsManager::GetStereoMode(void) - return (RENDER_STEREO_MODE) CSettings::Get().GetInt("videoscreen.stereoscopicmode"); - } - -+void CStereoscopicsManager::SetStereoModeByUser(const RENDER_STEREO_MODE &mode) -+{ -+ // only update last user mode if desired mode is different from current -+ if (mode != m_stereoModeSetByUser) -+ m_lastStereoModeSetByUser = m_stereoModeSetByUser; -+ -+ m_stereoModeSetByUser = mode; -+ SetStereoMode(mode); -+} -+ - void CStereoscopicsManager::SetStereoMode(const RENDER_STEREO_MODE &mode) - { - RENDER_STEREO_MODE currentMode = GetStereoMode(); -@@ -138,7 +148,6 @@ void CStereoscopicsManager::SetStereoMode(const RENDER_STEREO_MODE &mode) - { - if (!g_Windowing.SupportsStereo(applyMode)) - return; -- m_lastStereoMode = currentMode; - CSettings::Get().SetInt("videoscreen.stereoscopicmode", applyMode); - } - } -@@ -384,46 +393,65 @@ bool CStereoscopicsManager::OnAction(const CAction &action) - - if (action.GetID() == ACTION_STEREOMODE_NEXT) - { -- SetStereoMode(GetNextSupportedStereoMode(mode)); -+ SetStereoModeByUser(GetNextSupportedStereoMode(mode)); - return true; - } - else if (action.GetID() == ACTION_STEREOMODE_PREVIOUS) - { -- SetStereoMode(GetNextSupportedStereoMode(mode, RENDER_STEREO_MODE_COUNT - 1)); -+ SetStereoModeByUser(GetNextSupportedStereoMode(mode, RENDER_STEREO_MODE_COUNT - 1)); - return true; - } - else if (action.GetID() == ACTION_STEREOMODE_TOGGLE) - { - if (mode == RENDER_STEREO_MODE_OFF) - { -- RENDER_STEREO_MODE targetMode = m_lastStereoMode; -- if (targetMode == RENDER_STEREO_MODE_OFF) -- targetMode = GetPreferredPlaybackMode(); -- SetStereoMode(targetMode); -+ RENDER_STEREO_MODE targetMode = GetPreferredPlaybackMode(); -+ -+ // if user selected a specific mode before, make sure to -+ // switch back into that mode on toggle. -+ if (m_stereoModeSetByUser != RENDER_STEREO_MODE_UNDEFINED) -+ { -+ // if user mode is set to OFF, he manually turned it off before. In this case use the last user applied mode -+ if (m_stereoModeSetByUser != RENDER_STEREO_MODE_OFF) -+ targetMode = m_stereoModeSetByUser; -+ else if (m_lastStereoModeSetByUser != RENDER_STEREO_MODE_UNDEFINED && m_lastStereoModeSetByUser != RENDER_STEREO_MODE_OFF) -+ targetMode = m_lastStereoModeSetByUser; -+ } -+ -+ SetStereoModeByUser(targetMode); - } - else - { -- SetStereoMode(RENDER_STEREO_MODE_OFF); -+ SetStereoModeByUser(RENDER_STEREO_MODE_OFF); - } - return true; - } - else if (action.GetID() == ACTION_STEREOMODE_SELECT) - { -- SetStereoMode(GetStereoModeByUserChoice()); -+ SetStereoModeByUser(GetStereoModeByUserChoice()); - return true; - } - else if (action.GetID() == ACTION_STEREOMODE_TOMONO) - { - if (mode == RENDER_STEREO_MODE_MONO) - { -- RENDER_STEREO_MODE targetMode = m_lastStereoMode; -- if (targetMode == RENDER_STEREO_MODE_OFF) -- targetMode = GetPreferredPlaybackMode(); -- SetStereoMode(targetMode); -+ RENDER_STEREO_MODE targetMode = GetPreferredPlaybackMode(); -+ -+ // if we have an old userdefined steremode, use that one as toggle target -+ if (m_stereoModeSetByUser != RENDER_STEREO_MODE_UNDEFINED) -+ { -+ // if user mode is set to OFF, he manually turned it off before. In this case use the last user applied mode -+ if (m_stereoModeSetByUser != RENDER_STEREO_MODE_OFF && m_stereoModeSetByUser != mode) -+ targetMode = m_stereoModeSetByUser; -+ else if (m_lastStereoModeSetByUser != RENDER_STEREO_MODE_UNDEFINED && m_lastStereoModeSetByUser != RENDER_STEREO_MODE_OFF && m_lastStereoModeSetByUser != mode) -+ targetMode = m_lastStereoModeSetByUser; -+ } -+ -+ SetStereoModeByUser(targetMode); - } - else - { -- SetStereoMode(RENDER_STEREO_MODE_MONO); -+ SetStereoModeByUser(RENDER_STEREO_MODE_MONO); - } - return true; - } -@@ -431,7 +459,7 @@ bool CStereoscopicsManager::OnAction(const CAction &action) - { - int stereoMode = ConvertStringToGuiStereoMode(action.GetName()); - if (stereoMode > -1) -- SetStereoMode( (RENDER_STEREO_MODE) stereoMode); -+ SetStereoModeByUser( (RENDER_STEREO_MODE) stereoMode ); - return true; - } - -@@ -469,6 +497,13 @@ void CStereoscopicsManager::OnPlaybackStarted(void) - return; - } - -+ // if we're not in stereomode yet, restore previously selected stereo mode in case it was user selected -+ if (m_stereoModeSetByUser != RENDER_STEREO_MODE_UNDEFINED) -+ { -+ SetStereoMode(m_stereoModeSetByUser); -+ return; -+ } -+ - RENDER_STEREO_MODE preferred = GetPreferredPlaybackMode(); - RENDER_STEREO_MODE playing = GetStereoModeOfPlayingVideo(); - -@@ -526,7 +561,7 @@ void CStereoscopicsManager::OnPlaybackStarted(void) - else if (iItem == idx_playing) mode = RENDER_STEREO_MODE_AUTO; - else if (iItem == idx_select) mode = GetStereoModeByUserChoice(); - -- SetStereoMode(mode); -+ SetStereoModeByUser( mode ); - } - - CApplicationMessenger::Get().MediaUnPause(); -@@ -546,8 +581,10 @@ void CStereoscopicsManager::OnPlaybackStarted(void) - void CStereoscopicsManager::OnPlaybackStopped(void) - { - RENDER_STEREO_MODE mode = GetStereoMode(); -- if (CSettings::Get().GetBool("videoplayer.quitstereomodeonstop") == true && mode != RENDER_STEREO_MODE_OFF) -- { -+ if (CSettings::Get().GetBool("videoplayer.quitstereomodeonstop") && mode != RENDER_STEREO_MODE_OFF) - SetStereoMode(RENDER_STEREO_MODE_OFF); -- } -+ // reset user modes on playback end to start over new on next playback and not end up in a probably unwanted mode -+ if (m_stereoModeSetByUser != RENDER_STEREO_MODE_OFF) -+ m_lastStereoModeSetByUser = m_stereoModeSetByUser; -+ m_stereoModeSetByUser = RENDER_STEREO_MODE_UNDEFINED; - } -diff --git a/xbmc/guilib/StereoscopicsManager.h b/xbmc/guilib/StereoscopicsManager.h -index 422cba2..6e9c36d 100644 ---- a/xbmc/guilib/StereoscopicsManager.h -+++ b/xbmc/guilib/StereoscopicsManager.h -@@ -54,8 +54,9 @@ class CStereoscopicsManager : public ISettingCallback, - static CStereoscopicsManager& Get(void); - - void Initialize(void); -- void SetStereoMode(const RENDER_STEREO_MODE &mode); - RENDER_STEREO_MODE GetStereoMode(void); -+ void SetStereoModeByUser(const RENDER_STEREO_MODE &mode); -+ void SetStereoMode(const RENDER_STEREO_MODE &mode); - RENDER_STEREO_MODE GetNextSupportedStereoMode(const RENDER_STEREO_MODE ¤tMode, int step = 1); - std::string DetectStereoModeByString(const std::string &needle); - RENDER_STEREO_MODE GetStereoModeByUserChoice(const CStdString &heading = ""); -@@ -92,5 +93,6 @@ class CStereoscopicsManager : public ISettingCallback, - void OnPlaybackStarted(void); - void OnPlaybackStopped(void); - -- RENDER_STEREO_MODE m_lastStereoMode; -+ RENDER_STEREO_MODE m_stereoModeSetByUser; -+ RENDER_STEREO_MODE m_lastStereoModeSetByUser; - }; -diff --git a/xbmc/rendering/RenderSystem.h b/xbmc/rendering/RenderSystem.h -index c1dfb93..cb54bd0 100644 ---- a/xbmc/rendering/RenderSystem.h -+++ b/xbmc/rendering/RenderSystem.h -@@ -81,6 +81,7 @@ enum RENDER_STEREO_MODE - - // psuevdo modes - RENDER_STEREO_MODE_AUTO = 100, -+ RENDER_STEREO_MODE_UNDEFINED = 999, - }; - - - -From ac892f139b4633dafeb2d7535cbb60fcdc1af2e4 Mon Sep 17 00:00:00 2001 +From 2b54d8b0578c8f9419fc10be88ef56b589615539 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 28 Sep 2014 19:28:17 +0100 -Subject: [PATCH 66/84] [mmalcodec] Introduce a preroll period to buffer up +Subject: [PATCH 63/88] [mmalcodec] Introduce a preroll period to buffer up frames on startup --- @@ -7323,23 +8050,23 @@ index b4aa571..4f81bbd 100644 MMAL_COMPONENT_T *m_dec; MMAL_PORT_T *m_dec_input; -From 0acabc2e7c55c81381ff491d7e0bd840c3a10103 Mon Sep 17 00:00:00 2001 +From 0b7ee27d74501abb8e6f62a97fb53c6d5cbb6d5d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 11 Apr 2014 16:12:27 +0100 -Subject: [PATCH 67/84] [omxplayer] Add ability to log more timestamp info in +Subject: [PATCH 64/88] [omxplayer] Add ability to log more timestamp info in extra debug settings --- language/English/strings.po | 5 +++++ xbmc/commons/ilog.h | 1 + - xbmc/cores/omxplayer/OMXPlayer.cpp | 12 +++++++----- + xbmc/cores/omxplayer/OMXHelper.cpp | 12 +++++++----- xbmc/cores/omxplayer/OMXPlayerAudio.cpp | 8 ++++---- xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 9 +++++---- xbmc/settings/AdvancedSettings.cpp | 3 +++ 6 files changed, 25 insertions(+), 13 deletions(-) diff --git a/language/English/strings.po b/language/English/strings.po -index 78965a2..a3d7ac3 100755 +index 725205a..56cdcb4 100755 --- a/language/English/strings.po +++ b/language/English/strings.po @@ -2887,6 +2887,11 @@ msgctxt "#679" @@ -7366,10 +8093,10 @@ index 92e2835..ad02d95 100644 #include "utils/params_check_macros.h" -diff --git a/xbmc/cores/omxplayer/OMXPlayer.cpp b/xbmc/cores/omxplayer/OMXPlayer.cpp -index 562208a..df449e8 100644 ---- a/xbmc/cores/omxplayer/OMXPlayer.cpp -+++ b/xbmc/cores/omxplayer/OMXPlayer.cpp +diff --git a/xbmc/cores/omxplayer/OMXHelper.cpp b/xbmc/cores/omxplayer/OMXHelper.cpp +index cd383be..575c709 100644 +--- a/xbmc/cores/omxplayer/OMXHelper.cpp ++++ b/xbmc/cores/omxplayer/OMXHelper.cpp @@ -23,6 +23,7 @@ #ifdef HAS_OMXPLAYER @@ -7378,7 +8105,7 @@ index 562208a..df449e8 100644 #include "settings/Settings.h" #include "settings/MediaSettings.h" #include "DVDInputStreams/DVDInputStream.h" -@@ -147,7 +148,8 @@ void CDVDPlayer::OMXDoProcessing() +@@ -130,7 +131,8 @@ bool OMXDoProcessing(struct SOmxPlayerState &m_OmxPlayerState, int m_playSpeed, m_OmxPlayerState.video_fifo = (int)(100.0*(m_dvdPlayerVideo->GetDecoderBufferSize()-m_dvdPlayerVideo->GetDecoderFreeSpace())/m_dvdPlayerVideo->GetDecoderBufferSize()); m_OmxPlayerState.audio_fifo = (int)(100.0*audio_fifo/m_dvdPlayerAudio->GetCacheTotal()); @@ -7388,7 +8115,7 @@ index 562208a..df449e8 100644 static unsigned count; if ((count++ & 7) == 0) { -@@ -167,7 +169,7 @@ void CDVDPlayer::OMXDoProcessing() +@@ -150,7 +152,7 @@ bool OMXDoProcessing(struct SOmxPlayerState &m_OmxPlayerState, int m_playSpeed, vc_gencmd(response, sizeof response, "render_bar 7 audio_queue %d %d %d %d", m_dvdPlayerAudio->GetLevel(), 0, 0, 100); } @@ -7397,7 +8124,7 @@ index 562208a..df449e8 100644 if (audio_pts != DVD_NOPTS_VALUE) { audio_fifo_low = m_HasAudio && audio_fifo < threshold; -@@ -183,14 +185,14 @@ void CDVDPlayer::OMXDoProcessing() +@@ -166,15 +168,15 @@ bool OMXDoProcessing(struct SOmxPlayerState &m_OmxPlayerState, int m_playSpeed, if (!m_HasVideo && m_HasAudio) video_fifo_high = true; @@ -7405,7 +8132,8 @@ index 562208a..df449e8 100644 + if (g_advancedSettings.CanLogComponent(LOGOMXPLAYER)) + { CLog::Log(LOGDEBUG, "%s::%s M:%.6f-%.6f (A:%.6f V:%.6f) PEF:%d%d%d S:%.2f A:%.2f V:%.2f/T:%.2f (A:%d%d V:%d%d) A:%d%% V:%d%% (%.2f,%.2f)", "CDVDPlayer", __FUNCTION__, - m_OmxPlayerState.stamp*1e-6, m_OmxPlayerState.av_clock.OMXClockAdjustment()*1e-6, audio_pts*1e-6, video_pts*1e-6, m_OmxPlayerState.av_clock.OMXIsPaused(), m_OmxPlayerState.bOmxSentEOFs, not_accepts_data, m_playSpeed * (1.0f/DVD_PLAYSPEED_NORMAL), + m_OmxPlayerState.stamp*1e-6, m_OmxPlayerState.av_clock.OMXClockAdjustment()*1e-6, audio_pts*1e-6, video_pts*1e-6, + m_OmxPlayerState.av_clock.OMXIsPaused(), m_OmxPlayerState.bOmxSentEOFs, not_accepts_data, m_playSpeed * (1.0f/DVD_PLAYSPEED_NORMAL), audio_pts == DVD_NOPTS_VALUE ? 0.0:audio_fifo, video_pts == DVD_NOPTS_VALUE ? 0.0:video_fifo, m_OmxPlayerState.threshold, audio_fifo_low, audio_fifo_high, video_fifo_low, video_fifo_high, m_dvdPlayerAudio->GetLevel(), m_dvdPlayerVideo->GetLevel(), m_dvdPlayerAudio->GetDelay(), (float)m_dvdPlayerAudio->GetCacheTotal()); @@ -7416,10 +8144,10 @@ index 562208a..df449e8 100644 { if (m_OmxPlayerState.av_clock.OMXIsPaused()) diff --git a/xbmc/cores/omxplayer/OMXPlayerAudio.cpp b/xbmc/cores/omxplayer/OMXPlayerAudio.cpp -index f1208e6..f6ef16f 100644 +index a83fda8..f2bb9a2 100644 --- a/xbmc/cores/omxplayer/OMXPlayerAudio.cpp +++ b/xbmc/cores/omxplayer/OMXPlayerAudio.cpp -@@ -362,10 +362,10 @@ void OMXPlayerAudio::Process() +@@ -366,10 +366,10 @@ void OMXPlayerAudio::Process() DemuxPacket* pPacket = ((CDVDMsgDemuxerPacket*)pMsg)->GetPacket(); bool bPacketDrop = ((CDVDMsgDemuxerPacket*)pMsg)->GetPacketDrop(); @@ -7476,10 +8204,10 @@ index ca2d33c..997ed38 100644 void CAdvancedSettings::setExtraLogLevel(const std::vector &components) -From a78854f9e915423dd8e76800b30a77cd82d240c4 Mon Sep 17 00:00:00 2001 +From bb9411f2fc37ecfac5babc2244a6ef36339df487 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 23:13:55 +0100 -Subject: [PATCH 68/84] [omxplayer] Add ability to dump out audio/video data +Subject: [PATCH 65/88] [omxplayer] Add ability to dump out audio/video data for later debugging --- @@ -7491,7 +8219,7 @@ Subject: [PATCH 68/84] [omxplayer] Add ability to dump out audio/video data 5 files changed, 112 insertions(+) diff --git a/language/English/strings.po b/language/English/strings.po -index a3d7ac3..5dff38e 100755 +index 56cdcb4..3ce3fb6 100755 --- a/language/English/strings.po +++ b/language/English/strings.po @@ -2892,6 +2892,16 @@ msgctxt "#697" @@ -7721,17 +8449,17 @@ index 997ed38..7d2aa35 100644 void CAdvancedSettings::setExtraLogLevel(const std::vector &components) -From 4727dba883271771bab806bf8c2d3df7a39ae16b Mon Sep 17 00:00:00 2001 +From 10d222a97792d727f74287316adc40148f9ec4b9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 Oct 2014 22:45:09 +0100 -Subject: [PATCH 69/84] [mmalrenderer] Add choice of 3 deinterlace schemes +Subject: [PATCH 66/88] [mmalrenderer] Add choice of 3 deinterlace schemes --- xbmc/cores/VideoRenderers/MMALRenderer.cpp | 4 ++++ xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 4 +++- xbmc/cores/dvdplayer/DVDPlayer.cpp | 1 + xbmc/cores/dvdplayer/DVDPlayer.h | 1 + - xbmc/cores/omxplayer/OMXPlayer.cpp | 10 +++++++++- + xbmc/cores/omxplayer/OMXHelper.cpp | 10 +++++++++- xbmc/cores/omxplayer/OMXVideo.cpp | 11 ++++++++--- 6 files changed, 26 insertions(+), 5 deletions(-) @@ -7766,10 +8494,10 @@ index 42886b3..0498ec7 100644 if (status != MMAL_SUCCESS) { diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index cefbada..c8fd0d7 100644 +index 6bb9ede..8a31513 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -553,6 +553,7 @@ CDVDPlayer::CDVDPlayer(IPlayerCallback& callback) +@@ -573,6 +573,7 @@ CDVDPlayer::CDVDPlayer(IPlayerCallback& callback) m_OmxPlayerState.bOmxSentEOFs = false; m_OmxPlayerState.threshold = 0.2f; m_OmxPlayerState.current_deinterlace = CMediaSettings::Get().GetCurrentVideoSettings().m_DeinterlaceMode; @@ -7778,22 +8506,22 @@ index cefbada..c8fd0d7 100644 m_omxplayer_mode = CSettings::Get().GetBool("videoplayer.useomxplayer"); #else diff --git a/xbmc/cores/dvdplayer/DVDPlayer.h b/xbmc/cores/dvdplayer/DVDPlayer.h -index 92d471d..7aa18cf 100644 +index 9f75ccf..5fc3d01 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.h +++ b/xbmc/cores/dvdplayer/DVDPlayer.h -@@ -542,6 +542,7 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer - { - OMXClock av_clock; // openmax clock component - EDEINTERLACEMODE current_deinterlace; // whether deinterlace is currently enabled -+ EINTERLACEMETHOD interlace_method; // current deinterlace method - bool bOmxWaitVideo; // whether we need to wait for video to play out on EOS - bool bOmxWaitAudio; // whether we need to wait for audio to play out on EOS - bool bOmxSentEOFs; // flag if we've send EOFs to audio/video players -diff --git a/xbmc/cores/omxplayer/OMXPlayer.cpp b/xbmc/cores/omxplayer/OMXPlayer.cpp -index df449e8..0092d13 100644 ---- a/xbmc/cores/omxplayer/OMXPlayer.cpp -+++ b/xbmc/cores/omxplayer/OMXPlayer.cpp -@@ -135,14 +135,22 @@ void CDVDPlayer::OMXDoProcessing() +@@ -75,6 +75,7 @@ struct SOmxPlayerState + { + OMXClock av_clock; // openmax clock component + EDEINTERLACEMODE current_deinterlace; // whether deinterlace is currently enabled ++ EINTERLACEMETHOD interlace_method; // current deinterlace method + bool bOmxWaitVideo; // whether we need to wait for video to play out on EOS + bool bOmxWaitAudio; // whether we need to wait for audio to play out on EOS + bool bOmxSentEOFs; // flag if we've send EOFs to audio/video players +diff --git a/xbmc/cores/omxplayer/OMXHelper.cpp b/xbmc/cores/omxplayer/OMXHelper.cpp +index 575c709..3ae612a 100644 +--- a/xbmc/cores/omxplayer/OMXHelper.cpp ++++ b/xbmc/cores/omxplayer/OMXHelper.cpp +@@ -121,10 +121,18 @@ bool OMXDoProcessing(struct SOmxPlayerState &m_OmxPlayerState, int m_playSpeed, float threshold = 0.1f; bool audio_fifo_low = false, video_fifo_low = false, audio_fifo_high = false, video_fifo_high = false; @@ -7808,15 +8536,11 @@ index df449e8..0092d13 100644 + CLog::Log(LOGERROR, "%s - Reopen stream due to interlace change (%d,%d,%d,%d)", __FUNCTION__, m_OmxPlayerState.current_deinterlace, CMediaSettings::Get().GetCurrentVideoSettings().m_DeinterlaceMode, + m_OmxPlayerState.interlace_method, g_renderManager.AutoInterlaceMethod(CMediaSettings::Get().GetCurrentVideoSettings().m_InterlaceMethod)); + - CloseStream(m_CurrentVideo, false); - OpenStream(m_CurrentVideo, m_CurrentVideo.id, m_CurrentVideo.source); - if (m_State.canseek) - m_messenger.Put(new CDVDMsgPlayerSeek(GetTime(), true, true, true, true, true)); m_OmxPlayerState.current_deinterlace = CMediaSettings::Get().GetCurrentVideoSettings().m_DeinterlaceMode; + m_OmxPlayerState.interlace_method = g_renderManager.AutoInterlaceMethod(CMediaSettings::Get().GetCurrentVideoSettings().m_InterlaceMethod); + reopen_stream = true; } - m_OmxPlayerState.video_fifo = (int)(100.0*(m_dvdPlayerVideo->GetDecoderBufferSize()-m_dvdPlayerVideo->GetDecoderFreeSpace())/m_dvdPlayerVideo->GetDecoderBufferSize()); diff --git a/xbmc/cores/omxplayer/OMXVideo.cpp b/xbmc/cores/omxplayer/OMXVideo.cpp index 6cfb148..37765b1 100644 --- a/xbmc/cores/omxplayer/OMXVideo.cpp @@ -7855,10 +8579,10 @@ index 6cfb148..37765b1 100644 image_filter.eImageFilter = OMX_ImageFilterDeInterlaceFast; else -From df03904a9d5e7d071735cefeea073786f4a37aa6 Mon Sep 17 00:00:00 2001 +From c281ce7162c96c9bee36315fc27c884b74819ccc Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 24 Sep 2014 23:13:52 +0100 -Subject: [PATCH 70/84] [audio] Add settings option to boost centre channel +Subject: [PATCH 67/88] [audio] Add settings option to boost centre channel when downmixing This allows a dB volume increase to be added to centre channel. @@ -7876,10 +8600,10 @@ Should work with Pi Sink (dvdplayer/paplayer) and omxplayer 5 files changed, 45 insertions(+) diff --git a/language/English/strings.po b/language/English/strings.po -index 5dff38e..d8ae1f5 100755 +index 3ce3fb6..bb5dd3b 100755 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -16137,3 +16137,17 @@ msgstr "" +@@ -16139,3 +16139,17 @@ msgstr "" msgctxt "#38006" msgid "Adjust PLL" msgstr "" @@ -7898,7 +8622,7 @@ index 5dff38e..d8ae1f5 100755 +msgctxt "#38009" +msgid "%i dB" diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index 5e0e659..7fb6708 100644 +index a18d889..e5f08c7 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -2451,6 +2451,18 @@ @@ -7921,7 +8645,7 @@ index 5e0e659..7fb6708 100644 HAS_AE_QUALITY_LEVELS 2 diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp -index 26f0140..2e3ef91 100644 +index f856fd5..40e8c8b 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp @@ -20,6 +20,7 @@ @@ -7980,10 +8704,10 @@ index b5e86ae..00bae83 100644 // stereo upmix if (upmix && m_src_channels == 2 && m_dst_channels > 2) -From 536617d3f3dfc7719dc7a75737542d139a185a98 Mon Sep 17 00:00:00 2001 +From d5bd989d0f7094fe45bd7c228af7797e229a8ecf Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 3 Oct 2014 18:38:07 +0100 -Subject: [PATCH 71/84] [omxcore] Skip out of flush on error +Subject: [PATCH 68/88] [omxcore] Skip out of flush on error --- xbmc/linux/OMXCore.cpp | 4 ++-- @@ -8012,10 +8736,10 @@ index 4ae29ba..4caa304 100644 OMX_ERRORTYPE omx_err = OMX_ErrorNone; -From 4e005fa986338da8ec05692d0e1071303762d6db Mon Sep 17 00:00:00 2001 +From 39b1d20267d6409046d340ca85cefdf64ed25ab7 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 3 Oct 2014 18:40:06 +0100 -Subject: [PATCH 72/84] [SinkPi] Handle multichannel layout more like OMXAudio +Subject: [PATCH 69/88] [SinkPi] Handle multichannel layout more like OMXAudio --- xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp | 14 +++++++------- @@ -8074,10 +8798,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 4d5273974445b0dd87bc7d56b734b05779e1677b Mon Sep 17 00:00:00 2001 +From 496f37420fffe365663d22f86f4b656160c606fb Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 5 Oct 2014 14:05:25 +0100 -Subject: [PATCH 73/84] [PiSink] Allow audio output latency to be set in +Subject: [PATCH 70/88] [PiSink] Allow audio output latency to be set in settings --- @@ -8088,10 +8812,10 @@ Subject: [PATCH 73/84] [PiSink] Allow audio output latency to be set in 4 files changed, 36 insertions(+), 5 deletions(-) diff --git a/language/English/strings.po b/language/English/strings.po -index d8ae1f5..e3e2e03 100755 +index bb5dd3b..a6fb044 100755 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -16151,3 +16151,18 @@ msgstr "" +@@ -16153,3 +16153,18 @@ msgstr "" #: system/settings/settings.xml msgctxt "#38009" msgid "%i dB" @@ -8205,10 +8929,10 @@ index 5c57999..cac5051 100644 bool m_Initialized; uint32_t m_submitted; -From 422d0c4312c44eef4d0a826f940b54dd0d5fdb54 Mon Sep 17 00:00:00 2001 +From 041f198591bf07421fcbf1ccd5e5605e75446d04 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 19 Oct 2014 13:43:46 +0100 -Subject: [PATCH 74/84] Revert "hack: revert squash: don't update originaldts +Subject: [PATCH 71/88] Revert "hack: revert squash: don't update originaldts when marked as invalid" This reverts commit 4085c67b535627e1723ca8d7f82f3cdeaa67f54e. @@ -8217,10 +8941,10 @@ This reverts commit 4085c67b535627e1723ca8d7f82f3cdeaa67f54e. 1 file changed, 1 deletion(-) diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index c8fd0d7..a12a749 100644 +index 8a31513..83b92e0 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -1928,7 +1928,6 @@ void CDVDPlayer::CheckContinuity(CCurrentStream& current, DemuxPacket* pPacket) +@@ -1960,7 +1960,6 @@ void CDVDPlayer::CheckContinuity(CCurrentStream& current, DemuxPacket* pPacket) // not sure yet - flags the packets as unknown until we get confirmation on another audio/video packet pPacket->dts = DVD_NOPTS_VALUE; pPacket->pts = DVD_NOPTS_VALUE; @@ -8229,10 +8953,10 @@ index c8fd0d7..a12a749 100644 } else -From e9706bde5eef577e597260027a23265e6571f6fa Mon Sep 17 00:00:00 2001 +From b4a2047041bddf552152fc325b5eac8d4508fbe3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 18 Aug 2014 19:09:32 +0100 -Subject: [PATCH 75/84] rbp: Use new dispmanx function for vsync callbacks +Subject: [PATCH 72/88] rbp: Use new dispmanx function for vsync callbacks --- xbmc/linux/RBP.cpp | 85 ++++++++++++++----------- @@ -8444,10 +9168,10 @@ index 1529045..b6bf1fc 100644 } DLOG("CEGLNativeTypeRaspberryPI::DestroyDispmaxWindow\n"); -From acb17cab3258ba839c2c4b3a6418c95d666f2e5b Mon Sep 17 00:00:00 2001 +From 825f7d09c08f895e1da047d630daaef75612457f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 19 Aug 2014 17:56:45 +0100 -Subject: [PATCH 76/84] Revert "rbp: Use new dispmanx function for vsync +Subject: [PATCH 73/88] Revert "rbp: Use new dispmanx function for vsync callbacks" This reverts commit afbf8fbceaa6649fb4a6bbd9a1cee6087590412b. @@ -8661,10 +9385,10 @@ index b6bf1fc..1529045 100644 } DLOG("CEGLNativeTypeRaspberryPI::DestroyDispmaxWindow\n"); -From d17545d6ad47b87b7165026966b62adbb151da4d Mon Sep 17 00:00:00 2001 +From e11908616435899712dc9748650c184bd97e58df Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 27 Oct 2014 15:23:51 +0000 -Subject: [PATCH 77/84] [rbp] Default extract thumbnails to false +Subject: [PATCH 74/88] [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 @@ -8695,10 +9419,10 @@ index b8e6e59..40be71e 100644
-From b455f4245bab8fd7df5ec1335a98fb23a72642c5 Mon Sep 17 00:00:00 2001 +From 1a54fc03e9922b9bff13b7c9253fd708497159e3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Nov 2014 17:16:54 +0000 -Subject: [PATCH 79/84] Revert "[omxplayer] Add ability to dump out audio/video +Subject: [PATCH 76/88] Revert "[omxplayer] Add ability to dump out audio/video data for later debugging" This reverts commit 417416bd29d00f1b42c77488d06e9e6840b8c4f4. @@ -8711,7 +9435,7 @@ This reverts commit 417416bd29d00f1b42c77488d06e9e6840b8c4f4. 5 files changed, 112 deletions(-) diff --git a/language/English/strings.po b/language/English/strings.po -index 35048a5..fda9370 100755 +index 4c33d22..348a746 100755 --- a/language/English/strings.po +++ b/language/English/strings.po @@ -2892,16 +2892,6 @@ msgctxt "#697" @@ -8941,10 +9665,10 @@ index 7d2aa35..997ed38 100644 void CAdvancedSettings::setExtraLogLevel(const std::vector &components) -From 87b41d3a0f4959b4e4248a5cd784c90c7caeefd4 Mon Sep 17 00:00:00 2001 +From b79ffd4c0bd7a900dbad7aa6742c419cbc17c0ba Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 23:13:55 +0100 -Subject: [PATCH 80/84] [omxplayer] Add ability to dump out audio/video data +Subject: [PATCH 77/88] [omxplayer] Add ability to dump out audio/video data for later debugging --- @@ -8955,7 +9679,7 @@ Subject: [PATCH 80/84] [omxplayer] Add ability to dump out audio/video data 4 files changed, 79 insertions(+) diff --git a/language/English/strings.po b/language/English/strings.po -index fda9370..35048a5 100755 +index 348a746..4c33d22 100755 --- a/language/English/strings.po +++ b/language/English/strings.po @@ -2892,6 +2892,16 @@ msgctxt "#697" @@ -8989,10 +9713,10 @@ index ad02d95..be40370 100644 #include "utils/params_check_macros.h" diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index a12a749..037f10b 100644 +index 83b92e0..3036eb9 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -88,6 +88,61 @@ +@@ -95,6 +95,61 @@ using namespace std; using namespace PVR; @@ -9054,7 +9778,7 @@ index a12a749..037f10b 100644 void CSelectionStreams::Clear(StreamType type, StreamSource source) { CSingleLock lock(m_section); -@@ -915,6 +970,12 @@ bool CDVDPlayer::ReadPacket(DemuxPacket*& packet, CDemuxStream*& stream) +@@ -935,6 +990,12 @@ bool CDVDPlayer::ReadPacket(DemuxPacket*& packet, CDemuxStream*& stream) return true; } @@ -9067,7 +9791,7 @@ index a12a749..037f10b 100644 UpdateCorrection(packet, m_offset_pts); if(packet->iStreamId < 0) -@@ -3257,6 +3318,8 @@ bool CDVDPlayer::CloseStream(CCurrentStream& current, bool bWaitForBuffers) +@@ -3292,6 +3353,8 @@ bool CDVDPlayer::CloseStream(CCurrentStream& current, bool bWaitForBuffers) if(bWaitForBuffers) SetCaching(CACHESTATE_DONE); @@ -9093,11 +9817,10 @@ index 997ed38..7d2aa35 100644 void CAdvancedSettings::setExtraLogLevel(const std::vector &components) - -From 5979033267d217df157faf9677a9e3aa0d2434e8 Mon Sep 17 00:00:00 2001 +From 3628b9e2e1b81b6aedf05491c0c49bf446b2404b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 5 Nov 2014 14:51:16 +0000 -Subject: [PATCH 83/84] [DVDMessageQueue] Remove pi specific logging ifdef +Subject: [PATCH 80/88] [DVDMessageQueue] Remove pi specific logging ifdef --- xbmc/cores/dvdplayer/DVDMessageQueue.cpp | 2 -- @@ -9118,10 +9841,10 @@ index 92fa67a..f6ad8d0 100644 } -From bf844e9a224e312ec02a6aa5d7433ea13fa42f82 Mon Sep 17 00:00:00 2001 +From 7d4a9702644a6467a1380c07edb4d7c5b6cf2c09 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 6 Nov 2014 16:20:30 +0000 -Subject: [PATCH 84/84] [ResamplePi] Add support for formats that need shifting +Subject: [PATCH 81/88] [ResamplePi] Add support for formats that need shifting This case is triggered by HiFiBerry's 24-bit format. Requires updated firmware @@ -9222,3 +9945,411 @@ index dfa3e4a..25588d4 100644 int m_src_dither_bits, m_dst_dither_bits; OMX_AUDIO_PARAM_PCMMODETYPE m_pcm_input; + +From 98d8078b67423741b9d3c448e9ac8aaf2d5e4969 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 9 Nov 2014 13:53:34 +0000 +Subject: [PATCH 82/88] [curl] Avoid busy spinning when socket timeout is too + low + +This is an RFC as I don't know this code well, but my investigation may provoke a better fix. +See: http://forum.kodi.tv/showthread.php?tid=201797&pid=1771808#pid1771808 + +Summary: when streaming audio through http the cpu usage starts low and creeps higher and higher. + +For first minute, the CPU usage of FileCache thread is a few percent. +As time goes by the cpu usage for this thread increases until it hits about 60% and we start stuttering. + +Disabling the filecache (buffermode=3) avoids the high cpu issue. + +I've tracked down where the cpu is occurring. +CCurlFile::CReadState::FillBuffer is called with want=1. +After a while, g_curlInterface.multi_timeout returns smaller and smaller timeouts, +until it it just returning 0 and 1 for timeout. This results in busy spinning in this function. +The small timeouts mean small amounts of data are read and so FillBuffer gets called more often. + +My fix just ensures the timeout is never less than 200ms. +Now stream plays for a long time without stuttering and FileCache task remains at about 1% CPU. +--- + xbmc/filesystem/CurlFile.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/filesystem/CurlFile.cpp b/xbmc/filesystem/CurlFile.cpp +index 8408762..7a83564 100644 +--- a/xbmc/filesystem/CurlFile.cpp ++++ b/xbmc/filesystem/CurlFile.cpp +@@ -1549,7 +1549,7 @@ bool CCurlFile::CReadState::FillBuffer(unsigned int want) + g_curlInterface.multi_fdset(m_multiHandle, &fdread, &fdwrite, &fdexcep, &maxfd); + + long timeout = 0; +- if (CURLM_OK != g_curlInterface.multi_timeout(m_multiHandle, &timeout) || timeout == -1) ++ if (CURLM_OK != g_curlInterface.multi_timeout(m_multiHandle, &timeout) || timeout == -1 || timeout < 200) + timeout = 200; + + XbmcThreads::EndTime endTime(timeout); + +From 79c68b0d2bfeee8469f94809221dba16f13d4aa5 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 9 Nov 2014 14:41:48 +0000 +Subject: [PATCH 83/88] [dvdplayer] Allow new timestamp correction code to be + disabled with an advancedsetting + +In video section of advancedsettings.xml add reverttimestampchange=1 for old behaviour +--- + xbmc/cores/dvdplayer/DVDPlayer.cpp | 2 ++ + xbmc/settings/AdvancedSettings.cpp | 3 +++ + xbmc/settings/AdvancedSettings.h | 1 + + 3 files changed, 6 insertions(+) + +diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp +index 3036eb9..48c2024 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayer.cpp ++++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp +@@ -2021,6 +2021,8 @@ void CDVDPlayer::CheckContinuity(CCurrentStream& current, DemuxPacket* pPacket) + // not sure yet - flags the packets as unknown until we get confirmation on another audio/video packet + pPacket->dts = DVD_NOPTS_VALUE; + pPacket->pts = DVD_NOPTS_VALUE; ++ if (g_advancedSettings.m_revertTimestampChange) ++ current.originaldts = pPacket->dts; + } + } + else +diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp +index 7d2aa35..65ed7ad 100644 +--- a/xbmc/settings/AdvancedSettings.cpp ++++ b/xbmc/settings/AdvancedSettings.cpp +@@ -117,6 +117,7 @@ void CAdvancedSettings::Initialize() + + m_omxHWAudioDecode = false; + m_omxDecodeStartWithValidFrame = false; ++ m_revertTimestampChange = false; + + m_karaokeSyncDelayCDG = 0.0f; + m_karaokeSyncDelayLRC = 0.0f; +@@ -568,6 +569,8 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file) + XMLUtils::GetInt(pElement, "percentseekforwardbig", m_videoPercentSeekForwardBig, 0, 100); + XMLUtils::GetInt(pElement, "percentseekbackwardbig", m_videoPercentSeekBackwardBig, -100, 0); + ++ XMLUtils::GetBoolean(pElement, "reverttimestampchange", m_revertTimestampChange); ++ + TiXmlElement* pVideoExcludes = pElement->FirstChildElement("excludefromlisting"); + if (pVideoExcludes) + GetCustomRegexps(pVideoExcludes, m_videoExcludeFromListingRegExps); +diff --git a/xbmc/settings/AdvancedSettings.h b/xbmc/settings/AdvancedSettings.h +index 7df586e..07434347 100644 +--- a/xbmc/settings/AdvancedSettings.h ++++ b/xbmc/settings/AdvancedSettings.h +@@ -145,6 +145,7 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler + + bool m_omxHWAudioDecode; + bool m_omxDecodeStartWithValidFrame; ++ bool m_revertTimestampChange; + + float m_videoSubsDelayRange; + float m_videoAudioDelayRange; + +From d56620f59f78adc10384464b5a5cc95b84b4ff95 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 9 Nov 2014 15:58:24 +0000 +Subject: [PATCH 84/88] [dvdplayer] Try resetting the demuxer if audio and + video remain out of sync + +--- + xbmc/cores/dvdplayer/DVDPlayer.cpp | 12 ++++++++++++ + xbmc/cores/dvdplayer/DVDPlayer.h | 1 + + 2 files changed, 13 insertions(+) + +diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp +index 48c2024..52eec33 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayer.cpp ++++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp +@@ -615,6 +615,7 @@ CDVDPlayer::CDVDPlayer(IPlayerCallback& callback) + m_caching = CACHESTATE_DONE; + m_HasVideo = false; + m_HasAudio = false; ++ m_discontinuity_start.SetInfinite(); + + memset(&m_SpeedState, 0, sizeof(m_SpeedState)); + +@@ -2015,10 +2016,21 @@ void CDVDPlayer::CheckContinuity(CCurrentStream& current, DemuxPacket* pPacket) + m_offset_pts += correction; + UpdateCorrection(pPacket, correction); + current.originaldts = pPacket->dts; ++ m_discontinuity_start.SetInfinite(); + } + else + { + // not sure yet - flags the packets as unknown until we get confirmation on another audio/video packet ++ if (m_discontinuity_start.IsInfinite()) ++ m_discontinuity_start.Set(2000); ++ else if (m_discontinuity_start.IsTimePast()) ++ { ++ CLog::Log(LOGNOTICE, "CDVDPlayer::CheckContinuity - Audio and Video out of sync - resetting demuxer (this:%f that:%f)", this_dts, that_dts); ++ if (m_pDemuxer) ++ m_pDemuxer->Reset(); ++ // avoid resetting demuxer every iteration, hopefully it will be resolved before next iteration ++ m_discontinuity_start.Set(2000); ++ } + pPacket->dts = DVD_NOPTS_VALUE; + pPacket->pts = DVD_NOPTS_VALUE; + if (g_advancedSettings.m_revertTimestampChange) +diff --git a/xbmc/cores/dvdplayer/DVDPlayer.h b/xbmc/cores/dvdplayer/DVDPlayer.h +index 5fc3d01..24bf89f 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayer.h ++++ b/xbmc/cores/dvdplayer/DVDPlayer.h +@@ -548,6 +548,7 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer + bool m_HasAudio; + + bool m_DemuxerPausePending; ++ XbmcThreads::EndTime m_discontinuity_start; + + // omxplayer variables + struct SOmxPlayerState m_OmxPlayerState; + +From c4e6c0de7948bc4cbd72196edd73481619d23326 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 11 Nov 2014 11:56:36 +0000 +Subject: [PATCH 85/88] squash: try with 1 second threshold for resetting + demuxer when audio/video out of sync + +--- + xbmc/cores/dvdplayer/DVDPlayer.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp +index 52eec33..157ae88 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayer.cpp ++++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp +@@ -2022,7 +2022,7 @@ void CDVDPlayer::CheckContinuity(CCurrentStream& current, DemuxPacket* pPacket) + { + // not sure yet - flags the packets as unknown until we get confirmation on another audio/video packet + if (m_discontinuity_start.IsInfinite()) +- m_discontinuity_start.Set(2000); ++ m_discontinuity_start.Set(1000); + else if (m_discontinuity_start.IsTimePast()) + { + CLog::Log(LOGNOTICE, "CDVDPlayer::CheckContinuity - Audio and Video out of sync - resetting demuxer (this:%f that:%f)", this_dts, that_dts); + +From 2e0fc979b374857397016626173150b152a63e33 Mon Sep 17 00:00:00 2001 +From: wsnipex +Date: Sat, 8 Nov 2014 10:36:20 +0100 +Subject: [PATCH 86/88] add canseek and drop unused rtmp options + +--- + .../DVDInputStreams/DVDInputStreamRTMP.cpp | 39 +++++----------------- + .../dvdplayer/DVDInputStreams/DVDInputStreamRTMP.h | 7 +++- + 2 files changed, 15 insertions(+), 31 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamRTMP.cpp b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamRTMP.cpp +index 62ddd3d..f49bc25 100644 +--- a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamRTMP.cpp ++++ b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamRTMP.cpp +@@ -63,7 +63,10 @@ extern "C" + } + } + +-CDVDInputStreamRTMP::CDVDInputStreamRTMP() : CDVDInputStream(DVDSTREAM_TYPE_RTMP) ++CDVDInputStreamRTMP::CDVDInputStreamRTMP() ++ : CDVDInputStream(DVDSTREAM_TYPE_RTMP) ++ , m_can_seek(true) ++ , m_can_pause(true) + { + if (m_libRTMP.Load()) + { +@@ -119,19 +122,6 @@ bool CDVDInputStreamRTMP::IsEOF() + #undef AVC + #define AVC(str) {(char *)str,sizeof(str)-1} + +-/* librtmp option names are slightly different */ +-static const struct { +- const char *name; +- AVal key; +-} options[] = { +- { "SWFPlayer", AVC("swfUrl") }, +- { "PageURL", AVC("pageUrl") }, +- { "PlayPath", AVC("playpath") }, +- { "TcUrl", AVC("tcUrl") }, +- { "IsLive", AVC("live") }, +- { NULL } +-}; +- + bool CDVDInputStreamRTMP::Open(const char* strFile, const std::string& content) + { + if (m_sStreamPlaying) +@@ -152,21 +142,11 @@ bool CDVDInputStreamRTMP::Open(const char* strFile, const std::string& content) + if (!m_libRTMP.SetupURL(m_rtmp, m_sStreamPlaying)) + return false; + +- // SetOpt and SetAVal copy pointers to the value. librtmp doesn't use the values until the Connect() call, +- // so value objects must stay allocated until then. To be extra safe, keep the values around until Close(), +- // in case librtmp needs them again. +- m_optionvalues.clear(); +- for (int i=0; options[i].name; i++) +- { +- std::string tmp = m_item.GetProperty(options[i].name).asString(); +- if (!tmp.empty()) +- { +- m_optionvalues.push_back(tmp); +- AVal av_tmp; +- SetAVal(av_tmp, m_optionvalues.back()); +- m_libRTMP.SetOpt(m_rtmp, &options[i].key, &av_tmp); +- } +- } ++ std::string url = strFile; ++ size_t iPosBlank = url.find(' '); ++ if (iPosBlank != string::npos && (url.find("live=true") != string::npos || url.find("live=1") != string::npos)) ++ m_can_seek=false; ++ CLog::Log(LOGDEBUG, "RTMP canseek: %s", m_can_seek ? "true" : "false"); + + if (!m_libRTMP.Connect(m_rtmp, NULL) || !m_libRTMP.ConnectStream(m_rtmp, 0)) + return false; +@@ -185,7 +165,6 @@ void CDVDInputStreamRTMP::Close() + if (m_rtmp) + m_libRTMP.Close(m_rtmp); + +- m_optionvalues.clear(); + m_eof = true; + m_bPaused = false; + } +diff --git a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamRTMP.h b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamRTMP.h +index b013f33..46f9513 100644 +--- a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamRTMP.h ++++ b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamRTMP.h +@@ -27,6 +27,7 @@ + class CDVDInputStreamRTMP + : public CDVDInputStream + , public CDVDInputStream::ISeekTime ++ , public CDVDInputStream::ISeekable + { + public: + CDVDInputStreamRTMP(); +@@ -36,17 +37,21 @@ class CDVDInputStreamRTMP + virtual int Read(uint8_t* buf, int buf_size); + virtual int64_t Seek(int64_t offset, int whence); + bool SeekTime(int iTimeInMsec); ++ bool CanSeek() { return m_can_seek; } ++ bool CanPause() { return m_can_pause; } + virtual bool Pause(double dTime); + virtual bool IsEOF(); + virtual int64_t GetLength(); + ++ + CCriticalSection m_RTMPSection; + + protected: + bool m_eof; + bool m_bPaused; ++ bool m_can_seek; ++ bool m_can_pause; + char* m_sStreamPlaying; +- std::vector m_optionvalues; + + RTMP *m_rtmp; + DllLibRTMP m_libRTMP; + +From 41d018ec14487b84c2ba035e70b60dd29da95392 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 11 Nov 2014 18:14:23 +0000 +Subject: [PATCH 87/88] [resamplepi] Try to report the same numbers as ffmpeg + +--- + .../cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp +index 84505bf..2b5bef2 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp +@@ -544,9 +544,10 @@ int CActiveAEResamplePi::Resample(uint8_t **dst_buffer, int dst_samples, uint8_t + + int64_t CActiveAEResamplePi::GetDelay(int64_t base) + { +- int ret = m_dst_rate ? 1000 * GetBufferedSamples() / m_dst_rate : 0; ++ int64_t ret = av_rescale_rnd(GetBufferedSamples(), m_dst_rate, base, AV_ROUND_UP); ++ + #ifdef DEBUG_VERBOSE +- CLog::Log(LOGINFO, "%s::%s = %d", CLASSNAME, __func__, ret); ++ CLog::Log(LOGINFO, "%s::%s = %d", CLASSNAME, __func__, (int)ret); + #endif + return ret; + } +@@ -567,7 +568,7 @@ int CActiveAEResamplePi::GetBufferedSamples() + + int CActiveAEResamplePi::CalcDstSampleCount(int src_samples, int dst_rate, int src_rate) + { +- int ret = ((long long)src_samples * dst_rate + src_rate-1) / src_rate; ++ int ret = av_rescale_rnd(src_samples, dst_rate, src_rate, AV_ROUND_UP); + #ifdef DEBUG_VERBOSE + CLog::Log(LOGINFO, "%s::%s = %d", CLASSNAME, __func__, ret); + #endif +@@ -576,7 +577,7 @@ int CActiveAEResamplePi::CalcDstSampleCount(int src_samples, int dst_rate, int s + + int CActiveAEResamplePi::GetSrcBufferSize(int samples) + { +- int ret = 0; ++ int ret = av_samples_get_buffer_size(NULL, m_src_channels, samples, m_src_fmt, 1); + #ifdef DEBUG_VERBOSE + CLog::Log(LOGINFO, "%s::%s = %d", CLASSNAME, __func__, ret); + #endif +@@ -585,7 +586,7 @@ int CActiveAEResamplePi::GetSrcBufferSize(int samples) + + int CActiveAEResamplePi::GetDstBufferSize(int samples) + { +- int ret = CalcDstSampleCount(samples, m_dst_rate, m_src_rate); ++ int ret = av_samples_get_buffer_size(NULL, m_dst_channels, samples, m_dst_fmt, 1); + #ifdef DEBUG_VERBOSE + CLog::Log(LOGINFO, "%s::%s = %d", CLASSNAME, __func__, ret); + #endif + +From 312dad9044e873653c0755b515a32d2f4040aca6 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 11 Nov 2014 20:49:30 +0000 +Subject: [PATCH 88/88] [dvdplayer] New scheme for PLL adjustment for video + clock + +--- + xbmc/cores/dvdplayer/DVDPlayerAudio.cpp | 30 +++++++++++------------------- + 1 file changed, 11 insertions(+), 19 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp b/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp +index 5e9a6d3..6ec3439 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp ++++ b/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp +@@ -708,26 +708,18 @@ void CDVDPlayerAudio::HandleSyncError(double duration) + else if (m_synctype == SYNC_PLLADJUST) + { + #if defined(TARGET_RASPBERRY_PI) +- //reset the integral on big errors, failsafe +- if (fabs(m_error) > DVD_TIME_BASE) +- m_integral = 0; +- else if (fabs(m_error) > DVD_MSEC_TO_TIME(5)) +- m_integral += m_error / DVD_TIME_BASE / INTEGRAL; +- +- double proportional = 0.0; +- +- //on big errors use more proportional +- if (fabs(m_error / DVD_TIME_BASE) > 0.0) +- { +- double proportionaldiv = PROPORTIONAL * (PROPREF / fabs(m_error / DVD_TIME_BASE)); +- if (proportionaldiv < PROPDIVMIN) proportionaldiv = PROPDIVMIN; +- else if (proportionaldiv > PROPDIVMAX) proportionaldiv = PROPDIVMAX; +- +- proportional = m_error / DVD_TIME_BASE / proportionaldiv; +- } +- m_plladjust = 1.0 / m_pClock->GetClockSpeed() + proportional + m_integral; ++ if (m_error < -DVD_MSEC_TO_TIME(50)) ++ m_plladjust = 1.0/1.001; ++ else if (m_error < -DVD_MSEC_TO_TIME(10)) ++ m_plladjust = 1.0/1.0001; ++ else if (m_error > DVD_MSEC_TO_TIME(50)) ++ m_plladjust = 1.001; ++ else if (m_error > DVD_MSEC_TO_TIME(10)) ++ m_plladjust = 1.0001; ++ else ++ m_plladjust = 1.000; + 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); ++ CLog::Log(LOGDEBUG, "CDVDPlayerAudio::%s pll:%.4f (%.4f) error:%.6f", __FUNCTION__, m_plladjust, new_adjust, m_error); + #endif + } + }