diff --git a/projects/RPi/patches/xbmc-master/xbmc-master-newclock3.patch b/projects/RPi/patches/xbmc-master/xbmc-master-newclock3.patch index 463e039265..3e6e28f397 100644 --- a/projects/RPi/patches/xbmc-master/xbmc-master-newclock3.patch +++ b/projects/RPi/patches/xbmc-master/xbmc-master-newclock3.patch @@ -1,4 +1,4 @@ -From 13b8378adee5d09762f609cb3b1ccf20b798099d Mon Sep 17 00:00:00 2001 +From 95f1a8b37a6c081793be8f1c86a92a43b5a7b94b Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 14 Nov 2013 19:48:41 +0000 Subject: [PATCH 01/83] More efficient infobool expression evaluator @@ -500,7 +500,7 @@ index 4e0faee..0a91399 100644 1.9.3 -From dbcf34de3e9ed5204dee8c5bba47ef8a94be54c1 Mon Sep 17 00:00:00 2001 +From 9c8f3e1cd443da07f238f392f65ac599be76a58a Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Mon, 24 Mar 2014 22:26:21 +0000 Subject: [PATCH 02/83] Where an infobool expression failed to parse, evaluate @@ -530,7 +530,7 @@ index db461dd..7c54064 100644 1.9.3 -From c870a027cdf8b392559d743b9f73da434847a354 Mon Sep 17 00:00:00 2001 +From a963605e64c59f03629d6b94b3e8eb85e3aec51c Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Tue, 26 Nov 2013 20:09:48 +0000 Subject: [PATCH 03/83] Add caching of infolabels @@ -746,7 +746,7 @@ index 8c1c1dc..418b2c4 100644 1.9.3 -From a90a90832b182a1d38470318913387633a2502e3 Mon Sep 17 00:00:00 2001 +From 40b0137cdcf5435743fa01d202f3cda9bbf8266c Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Tue, 10 Dec 2013 01:12:31 +0000 Subject: [PATCH 04/83] De-duplication of string cache for non-item and item @@ -889,7 +889,7 @@ index 418b2c4..6d9ebf7 100644 1.9.3 -From 8b429464f60a948944515770a5bc71e37ca0dce1 Mon Sep 17 00:00:00 2001 +From fa4732e78babd7a0b0d91f2e6ecebe490474c2a1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 21 Feb 2014 15:16:13 +0000 Subject: [PATCH 05/83] Faster and simpler portable implementation of @@ -1098,7 +1098,7 @@ index 96af9f4..0dae77d 100644 1.9.3 -From 2ec44685277c1b1c939aafb40a330675081c4cf7 Mon Sep 17 00:00:00 2001 +From f856b99e0c2da186b79b2a348a6b9262a6c422e7 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 11 Dec 2013 17:21:54 +0000 Subject: [PATCH 06/83] Move the reference-counting of Begin and End calls from @@ -1456,7 +1456,7 @@ index a0dacba..6736cf7 100644 1.9.3 -From c463ee014a96d3ba4499233e6b0cbee7c8533754 Mon Sep 17 00:00:00 2001 +From ab163dd0b07739063096b1d63b9b249d60e90252 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 11 Dec 2013 18:47:54 +0000 Subject: [PATCH 07/83] Convert CGUIFontTTFBase::m_vertex to be managed as a @@ -1641,7 +1641,7 @@ index 93b7ea6..a4e8571 100644 1.9.3 -From ababb440c75265ad8129cd76f1a78583da9cbb58 Mon Sep 17 00:00:00 2001 +From 98eeca8362b37dda75ab4bad4b4617797f4966cc Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Mon, 16 Dec 2013 18:58:12 +0000 Subject: [PATCH 08/83] CGUIFontTTFBase::RenderCharacter can now append to @@ -1720,7 +1720,7 @@ index 35e3cf9..4a6a696 100644 1.9.3 -From 1a623a32e19f38b2ae68095607cc0cde36d97db8 Mon Sep 17 00:00:00 2001 +From 0d407650eb4dcf3b87559bfe3a1f3af454dc977c Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 17:18:38 +0000 Subject: [PATCH 09/83] Add a cache of font glyph bounding box vertices. This @@ -2383,7 +2383,7 @@ index f351c99..9036ba9 100644 1.9.3 -From a9ced9f250a703ea48b033654f8453fdfd01b486 Mon Sep 17 00:00:00 2001 +From 5e4242ab8a0c4f34b866502b1c86079ca3736db4 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 23 Jan 2014 22:24:17 +0000 Subject: [PATCH 10/83] Lay the groundwork for hardware clipping. @@ -2651,7 +2651,7 @@ index 98e398a..81ee49e 100644 1.9.3 -From 710f111ec5c24473d30cfb99489e20f381818041 Mon Sep 17 00:00:00 2001 +From 5899b464bdeed40bc33261ef164455b5cc441519 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 23 Jan 2014 16:42:22 +0000 Subject: [PATCH 11/83] Increase font cache hit rate by keying on the @@ -2858,7 +2858,7 @@ index 7cb4669..78445ab 100644 1.9.3 -From e7a44feaecf29ab26eadc95fc5d783bfe48c7eb7 Mon Sep 17 00:00:00 2001 +From 43765dfc3fa30499a8d6c388a28c2c90e923a3fc Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 8 Jan 2014 12:16:33 +0000 Subject: [PATCH 12/83] Rewrite of scrolling text code. @@ -3180,7 +3180,7 @@ index 2c6f366..b74faf2 100644 1.9.3 -From f97bf020cb07cb6ba5dab59a4af7dc36eb1297d7 Mon Sep 17 00:00:00 2001 +From c6f7cf0791ff7eeaa0d1b2eb0ada543512a74ce0 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Mon, 27 Jan 2014 23:21:10 +0000 Subject: [PATCH 13/83] Move the application of the translation offsets into @@ -3379,7 +3379,7 @@ index cb56987..f6aa081 100644 1.9.3 -From 43a8a3806dce00f88b1c1b9bb42e79c8a0e5f823 Mon Sep 17 00:00:00 2001 +From a011b1e8821ca48897058bada140e663085e7d1e Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 15:28:06 +0000 Subject: [PATCH 14/83] Rather than applying the translation offsets to the @@ -3529,7 +3529,7 @@ index 81ee49e..d2f9cd1 100644 1.9.3 -From 3874d526859bbb475e28095fb2a91a3a38acaf4a Mon Sep 17 00:00:00 2001 +From 1e15bddd4df1bd6fda866e1b4b885e232e08ec71 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 29 Jan 2014 13:21:19 +0000 Subject: [PATCH 15/83] Enable hardware clipping. @@ -3608,7 +3608,7 @@ index fbffaa0..b7618e1 100644 1.9.3 -From 69fc55b7b0a7f67b6f9bd567ea4ae8a818907bcd Mon Sep 17 00:00:00 2001 +From b9c662e2a9d0253b6636b509d35110b2952662a6 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 15:32:51 +0000 Subject: [PATCH 16/83] Move the vertex data across to a vertex buffer object @@ -3665,7 +3665,7 @@ index b7618e1..0df3749 100644 1.9.3 -From 8ebdf87dbe17f7a259b91e36f5e80e6437cca9b3 Mon Sep 17 00:00:00 2001 +From 1b6fcf9424aabc726870fffd0dada2d2f4327ad8 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 16:04:04 +0000 Subject: [PATCH 17/83] Move vertex data into an OpenGL VBO when the font cache @@ -3943,7 +3943,7 @@ index 6736cf7..168fb21 100644 1.9.3 -From 910cb2e120b831b9901d334a54177eb879b535d0 Mon Sep 17 00:00:00 2001 +From 92331e5e7174c1aeaeead138c2793ef55ec2cfe4 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 16 Jan 2014 16:29:42 +0000 Subject: [PATCH 18/83] Switch from glDrawArrays() to glDrawElements(). This @@ -4169,7 +4169,7 @@ index 6de3532..258a293 100644 1.9.3 -From cf3399b12c339337663d5044938fcb79479be030 Mon Sep 17 00:00:00 2001 +From 9aced5f8c6aeb6ed0faf5251a983ebe5cf7adcab Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Tue, 4 Feb 2014 16:17:57 +0000 Subject: [PATCH 19/83] Update Windows project files @@ -4180,10 +4180,10 @@ Subject: [PATCH 19/83] Update Windows project files 2 files changed, 8 insertions(+) diff --git a/project/VS2010Express/XBMC.vcxproj b/project/VS2010Express/XBMC.vcxproj -index dd3abd1..b7622b2 100644 +index 055722f..fffbf54 100644 --- a/project/VS2010Express/XBMC.vcxproj +++ b/project/VS2010Express/XBMC.vcxproj -@@ -545,6 +545,7 @@ +@@ -425,6 +425,7 @@ @@ -4191,7 +4191,7 @@ index dd3abd1..b7622b2 100644 -@@ -2073,6 +2074,7 @@ +@@ -1743,6 +1744,7 @@ @@ -4200,10 +4200,10 @@ index dd3abd1..b7622b2 100644 diff --git a/project/VS2010Express/XBMC.vcxproj.filters b/project/VS2010Express/XBMC.vcxproj.filters -index 43c0c75..226daaf 100644 +index 2d2c5dc..68965cd 100644 --- a/project/VS2010Express/XBMC.vcxproj.filters +++ b/project/VS2010Express/XBMC.vcxproj.filters -@@ -1024,6 +1024,9 @@ +@@ -1009,6 +1009,9 @@ guilib @@ -4213,7 +4213,7 @@ index 43c0c75..226daaf 100644 guilib -@@ -3987,6 +3990,9 @@ +@@ -3927,6 +3930,9 @@ guilib @@ -4227,7 +4227,7 @@ index 43c0c75..226daaf 100644 1.9.3 -From e2f86e9ceced0252f858ca5d751d2c2840bebf03 Mon Sep 17 00:00:00 2001 +From 82db4d070392a1bae49bbd0888e4c92de0754e70 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Tue, 4 Feb 2014 16:49:45 +0000 Subject: [PATCH 20/83] Update XCode project file @@ -4237,7 +4237,7 @@ Subject: [PATCH 20/83] Update XCode project file 1 file changed, 10 insertions(+) diff --git a/XBMC.xcodeproj/project.pbxproj b/XBMC.xcodeproj/project.pbxproj -index 5e32a35..ea1828a 100644 +index eedbd8a..0d06e80 100644 --- a/XBMC.xcodeproj/project.pbxproj +++ b/XBMC.xcodeproj/project.pbxproj @@ -168,6 +168,9 @@ @@ -4250,7 +4250,7 @@ index 5e32a35..ea1828a 100644 32C631281423A90F00F18420 /* JpegIO.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32C631261423A90F00F18420 /* JpegIO.cpp */; }; 36A9443D15821E2800727135 /* DatabaseUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 36A9443B15821E2800727135 /* DatabaseUtils.cpp */; }; 36A9444115821E7C00727135 /* SortUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 36A9443F15821E7C00727135 /* SortUtils.cpp */; }; -@@ -4028,6 +4031,8 @@ +@@ -4022,6 +4025,8 @@ 1DAFDB7B16DFDCA7007F8C68 /* PeripheralBusCEC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PeripheralBusCEC.h; sourceTree = ""; }; 1DE0443315828F4B005DDB4D /* Exception.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Exception.cpp; path = commons/Exception.cpp; sourceTree = ""; }; 1DE0443415828F4B005DDB4D /* Exception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Exception.h; path = commons/Exception.h; sourceTree = ""; }; @@ -4259,7 +4259,7 @@ index 5e32a35..ea1828a 100644 32C631261423A90F00F18420 /* JpegIO.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JpegIO.cpp; sourceTree = ""; }; 32C631271423A90F00F18420 /* JpegIO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JpegIO.h; sourceTree = ""; }; 36A9443B15821E2800727135 /* DatabaseUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DatabaseUtils.cpp; sourceTree = ""; }; -@@ -6546,6 +6551,8 @@ +@@ -6536,6 +6541,8 @@ 18B7C76A1294222E009E7A26 /* GUIFixedListContainer.cpp */, 18B7C7101294222D009E7A26 /* GUIFixedListContainer.h */, 18B7C76B1294222E009E7A26 /* GUIFont.cpp */, @@ -4268,7 +4268,7 @@ index 5e32a35..ea1828a 100644 18B7C7111294222D009E7A26 /* GUIFont.h */, 18B7C76C1294222E009E7A26 /* GUIFontManager.cpp */, 18B7C7121294222D009E7A26 /* GUIFontManager.h */, -@@ -11870,6 +11877,7 @@ +@@ -11854,6 +11861,7 @@ 7CCDACB019275D1F0074CF51 /* NptStdcEnvironment.cpp in Sources */, 7CCDACC119275D790074CF51 /* NptAppleAutoreleasePool.mm in Sources */, 7CCDACCA19275D790074CF51 /* NptAppleLogConfig.mm in Sources */, @@ -4276,7 +4276,7 @@ index 5e32a35..ea1828a 100644 ); runOnlyForDeploymentPostprocessing = 0; }; -@@ -13067,6 +13075,7 @@ +@@ -13049,6 +13057,7 @@ 7CCDACB219275D1F0074CF51 /* NptStdcEnvironment.cpp in Sources */, 7CCDACC319275D790074CF51 /* NptAppleAutoreleasePool.mm in Sources */, 7CCDACCC19275D790074CF51 /* NptAppleLogConfig.mm in Sources */, @@ -4284,7 +4284,7 @@ index 5e32a35..ea1828a 100644 ); runOnlyForDeploymentPostprocessing = 0; }; -@@ -14266,6 +14275,7 @@ +@@ -14246,6 +14255,7 @@ 7CCDACB119275D1F0074CF51 /* NptStdcEnvironment.cpp in Sources */, 7CCDACC219275D790074CF51 /* NptAppleAutoreleasePool.mm in Sources */, 7CCDACCB19275D790074CF51 /* NptAppleLogConfig.mm in Sources */, @@ -4296,7 +4296,7 @@ index 5e32a35..ea1828a 100644 1.9.3 -From f13ecead9710858f84865b67aab494874dc4abaf Mon Sep 17 00:00:00 2001 +From 8347e694684e9d9c1f0e9b22db637a8d861e1f82 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Tue, 4 Feb 2014 17:44:34 +0000 Subject: [PATCH 21/83] Clang seems to be more picky than gcc about some C++ @@ -4367,7 +4367,7 @@ index 895fa72..bd84b9a 100644 1.9.3 -From 4f63ce17314bb3fc030628578d88ca90f6546494 Mon Sep 17 00:00:00 2001 +From 5fe6f1890560652a1c45818dcee077fc2f98d9de Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Tue, 4 Feb 2014 18:52:14 +0000 Subject: [PATCH 22/83] Fix header to hopefully permit iOS builds to work @@ -4399,7 +4399,7 @@ index 53bce09..86330cc 100644 1.9.3 -From 3d7db7972dd3c60284b6fff15d16847bbdebd170 Mon Sep 17 00:00:00 2001 +From d9b756de272d283f89b34ed571d2638e98f5e455 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Tue, 8 Apr 2014 18:14:55 +0100 Subject: [PATCH 23/83] Fix font display in stereoscopic modes @@ -4443,7 +4443,7 @@ index d476409..8466a81 100644 1.9.3 -From 18f6219dad05dd8a0b98565a01d1667ebf2ec516 Mon Sep 17 00:00:00 2001 +From 802f19c0964cac22f67e70b311893b24cf836dad Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 10 Jan 2014 12:10:43 +0000 Subject: [PATCH 24/83] [rbp] Don't override dvdplayer with omxplayer. @@ -4479,7 +4479,7 @@ index 27f0bec..fc12bb7 100644 1.9.3 -From f6572e7b870991de1bd939f12fafb50434ed0ee9 Mon Sep 17 00:00:00 2001 +From b43b2aa700bb684f03c663f50a0f46c868d88696 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 10 Jan 2014 15:37:41 +0000 Subject: [PATCH 25/83] [players] Use default players rather than hard coded @@ -4541,7 +4541,7 @@ index 57dfcdd..7be9799 100644 1.9.3 -From 51f412cdecaf55c5d491ba4a73825f932c61e2c0 Mon Sep 17 00:00:00 2001 +From 9a33b74039f15cedcfe66f99c5ec53356bb1dccb Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 11 Jan 2014 18:23:42 +0000 Subject: [PATCH 26/83] [rbp] Don't force dvdplayer for airplay @@ -4570,7 +4570,7 @@ index 472463d..9f86eb7 100644 1.9.3 -From 26fc732b89630fea2585b8fde188418aa68afea2 Mon Sep 17 00:00:00 2001 +From 1393df3a9e7faf5aa7fbcb3af4d031bd06135f2f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Jan 2014 13:11:06 +0000 Subject: [PATCH 27/83] [rbp] Give plugins omxplayer when they request @@ -4600,7 +4600,7 @@ index cf6693c..1170189 100644 1.9.3 -From c45299f967373d7d33cc911dfafef748f8cf4342 Mon Sep 17 00:00:00 2001 +From 0a754a6a41a3ee70ef8f750c4856dfb3b88ceb73 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 14 Jan 2014 18:04:07 +0000 Subject: [PATCH 28/83] [rbp] Allow ALSA to be chosen in addition to Pi sink @@ -4609,8 +4609,8 @@ Needs --enable-alsa in ./configure step and alsa support on platform --- configure.in | 1 - tools/depends/target/Makefile | 5 +++-- - xbmc/cores/AudioEngine/AESinkFactory.cpp | 17 +++++++++++++++-- - 3 files changed, 18 insertions(+), 5 deletions(-) + xbmc/cores/AudioEngine/AESinkFactory.cpp | 15 ++++++++++++++- + 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/configure.in b/configure.in index 1766ce1..cb4728b 100644 @@ -4643,7 +4643,7 @@ index 3e02fc0..eea2a06 100644 endif diff --git a/xbmc/cores/AudioEngine/AESinkFactory.cpp b/xbmc/cores/AudioEngine/AESinkFactory.cpp -index e493123..7df6807 100644 +index e42d973..715b4f1 100644 --- a/xbmc/cores/AudioEngine/AESinkFactory.cpp +++ b/xbmc/cores/AudioEngine/AESinkFactory.cpp @@ -27,6 +27,7 @@ @@ -4662,21 +4662,20 @@ index e493123..7df6807 100644 #elif defined(TARGET_DARWIN_IOS) driver == "DARWINIOS" || #elif defined(TARGET_DARWIN_OSX) -@@ -104,7 +106,12 @@ IAESink *CAESinkFactory::TrySink(std::string &driver, std::string &device, AEAud +@@ -105,7 +107,12 @@ IAESink *CAESinkFactory::TrySink(std::string &driver, std::string &device, AEAud #elif defined(TARGET_ANDROID) - sink = new CAESinkAUDIOTRACK(); + sink = new CAESinkAUDIOTRACK(); #elif defined(TARGET_RASPBERRY_PI) -- sink = new CAESinkPi(); -+ else if (driver == "PI") -+ sink = new CAESinkPi(); ++ if (driver == "PI") + sink = new CAESinkPi(); + #if defined(HAS_ALSA) -+ else if (driver == "ALSA") ++ if (driver == "ALSA") + sink = new CAESinkALSA(); + #endif #elif defined(TARGET_DARWIN_IOS) - sink = new CAESinkDARWINIOS(); + sink = new CAESinkDARWINIOS(); #elif defined(TARGET_DARWIN_OSX) -@@ -194,7 +201,13 @@ void CAESinkFactory::EnumerateEx(AESinkInfoList &list, bool force) +@@ -196,7 +203,13 @@ void CAESinkFactory::EnumerateEx(AESinkInfoList &list, bool force) CAESinkPi::EnumerateDevicesEx(info.m_deviceInfoList, force); if(!info.m_deviceInfoList.empty()) list.push_back(info); @@ -4695,7 +4694,7 @@ index e493123..7df6807 100644 1.9.3 -From 8473f6c8e9f065966faf6b12803ad123c92d3f7a Mon Sep 17 00:00:00 2001 +From e42fe4dfb5a88a449336aeae4169e277e24d8993 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 16 Jan 2014 01:39:29 +0000 Subject: [PATCH 29/83] [omxcodec] Add hardware decode to dvdplayer for Pi @@ -7579,10 +7578,10 @@ index e06c41d..9079c13 100644 // defined(HAVE_LIBOPENMAX) diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index 3f2e0df..e3dfa2e 100644 +index 8aaef28..744e734 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -2988,7 +2988,9 @@ bool CDVDPlayer::OpenVideoStream(int iStream, int source, bool reset) +@@ -2979,7 +2979,9 @@ bool CDVDPlayer::OpenVideoStream(int iStream, int source, bool reset) hint.aspect = aspect; hint.forced_aspect = true; } @@ -7593,10 +7592,10 @@ index 3f2e0df..e3dfa2e 100644 boost::shared_ptr client; diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 99b3155..fddb7f7 100644 +index 7e88bfc..8649a33 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -325,6 +325,9 @@ void CDVDPlayerVideo::Process() +@@ -322,6 +322,9 @@ void CDVDPlayerVideo::Process() while (!m_bStop) { @@ -7606,7 +7605,7 @@ index 99b3155..fddb7f7 100644 int iQueueTimeOut = (int)(m_stalled ? frametime / 4 : frametime * 10) / 1000; int iPriority = (m_speed == DVD_PLAYSPEED_PAUSE && m_started) ? 1 : 0; -@@ -361,8 +364,10 @@ void CDVDPlayerVideo::Process() +@@ -358,8 +361,10 @@ void CDVDPlayerVideo::Process() OutputPicture(&picture, pts); pts+= frametime; } @@ -7619,7 +7618,7 @@ index 99b3155..fddb7f7 100644 } if (pMsg->IsType(CDVDMsg::GENERAL_SYNCHRONIZE)) -@@ -489,9 +494,12 @@ void CDVDPlayerVideo::Process() +@@ -488,9 +493,12 @@ void CDVDPlayerVideo::Process() if (pMsg->IsType(CDVDMsg::DEMUXER_PACKET)) { @@ -7635,7 +7634,7 @@ index 99b3155..fddb7f7 100644 if (m_stalled) { CLog::Log(LOGINFO, "CDVDPlayerVideo - Stillframe left, switching to normal playback"); -@@ -749,7 +757,8 @@ void CDVDPlayerVideo::Process() +@@ -748,7 +756,8 @@ void CDVDPlayerVideo::Process() } // all data is used by the decoder, we can safely free it now @@ -7754,7 +7753,7 @@ index 1b24fc1..2f1e8a9 100644 1.9.3 -From 660f02293891e09419be65ecb68aa8bc7495e8fd Mon Sep 17 00:00:00 2001 +From 36a6a4472ca92275c98dd382f5696f82de6ea505 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 20 Jan 2014 16:03:40 +0000 Subject: [PATCH 30/83] [omxcodec] Enable for dvd menus @@ -7782,7 +7781,7 @@ index b61f616..526581a 100644 1.9.3 -From e7de1e07ab547617f9a625505a1779f17047591b Mon Sep 17 00:00:00 2001 +From 590614518f6a5cc10017f7b01f5facd006c669d3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Feb 2014 22:27:44 +0000 Subject: [PATCH 31/83] [omxcodec] Add omx specific texture @@ -7863,7 +7862,7 @@ index 5a6a2be..52df291 100644 1.9.3 -From 5ef286e734b1ac596ab1a9799dc6dbcfd55f180f Mon Sep 17 00:00:00 2001 +From 3df31e476a168116bf6d58d75e676c34418f89af Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Feb 2014 22:50:43 +0000 Subject: [PATCH 32/83] [omxcodec] Add shared pointer to delay shutdown of @@ -8047,7 +8046,7 @@ index 9079c13..0975e8a 100644 1.9.3 -From 1948299e952d200e7246d281dc76f2fb0e8eb5cd Mon Sep 17 00:00:00 2001 +From c3ade5c15d8d856914d216a3332409d0bd409d41 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Feb 2014 23:11:31 +0000 Subject: [PATCH 33/83] [omxcodec] Fix for aspect ratio in non-square pixel @@ -8139,7 +8138,7 @@ index 0975e8a..9138a20 100644 1.9.3 -From 03f2627fdece679f63571be0670977f61492f82c Mon Sep 17 00:00:00 2001 +From 6e542b9f419797e507a44bc4506d9b790f8d7793 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Feb 2014 23:19:22 +0000 Subject: [PATCH 34/83] [omxcodec] Report error when codec not enabled @@ -8187,7 +8186,7 @@ index 7e23c87..2ae722b 100644 1.9.3 -From 29821d2bc9e7f8ecd5370c72faa228cf58ca19cb Mon Sep 17 00:00:00 2001 +From 393f56e01f1930f5f56df46fbac757b6194f340f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 4 Feb 2014 17:29:37 +0000 Subject: [PATCH 35/83] [omxcodec] Add deinterlace support @@ -8427,7 +8426,7 @@ index 9138a20..c8ad4d8 100644 1.9.3 -From a5680463506e0115aa646635122b05aa3bb01243 Mon Sep 17 00:00:00 2001 +From 5fb48625e00a18916a2bc169c3c025bae568575f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 5 Feb 2014 11:46:33 +0000 Subject: [PATCH 36/83] [rbp/settings] Allow av sync type to be enabled @@ -8459,7 +8458,7 @@ index 2b7d0a6..1429256 100644 1.9.3 -From 0dad6fb7d5bece6e8c08312f5c2214562691909b Mon Sep 17 00:00:00 2001 +From f3927eb3cdfeded159688825e923ea27942dcc9f Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 1 May 2014 16:28:39 +0100 Subject: [PATCH 37/83] Improved file buffering in CArchive @@ -8525,7 +8524,7 @@ index 1618237..d525761 100644 1.9.3 -From 76c2fe5d00ab298f61e63d62ddd2f1965a78c7a1 Mon Sep 17 00:00:00 2001 +From a25da3b42496495d104ea9feff59f25ed163b1f0 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 16 Feb 2014 17:38:05 +0000 Subject: [PATCH 38/83] [omxcodec] Only do essential calls in texture thread @@ -8878,690 +8877,10 @@ index c8ad4d8..f234f6d 100644 1.9.3 -From c5c72dd03675040584b7417bed4301b772a6bd29 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sat, 1 Mar 2014 14:24:08 +0000 -Subject: [PATCH 39/83] [omxplayer] Allow small audio packets to be - concatenated to make better use of audio fifo - -Some audio codecs produce small packets which causes a high overhead when submitting to GPU, and doesn't make full use of GPU side buffering. -TrueHD in particular can produce packets with 40 samples (so 1200 packets per second) which causes very high overhead. - -What this aims to do is to concatenate audio packets until they approach the ideal audio packet size, -and then deal with the awkardness of concatenated planar formats. ---- - xbmc/cores/omxplayer/OMXAudio.cpp | 67 +++++++++++++++++++--------- - xbmc/cores/omxplayer/OMXAudio.h | 3 +- - xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp | 74 +++++++++++++++++++++---------- - xbmc/cores/omxplayer/OMXAudioCodecOMX.h | 9 +++- - xbmc/cores/omxplayer/OMXPlayerAudio.cpp | 9 ++-- - 5 files changed, 111 insertions(+), 51 deletions(-) - -diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp -index 233dfbc..f9db0f2 100644 ---- a/xbmc/cores/omxplayer/OMXAudio.cpp -+++ b/xbmc/cores/omxplayer/OMXAudio.cpp -@@ -47,6 +47,10 @@ extern "C" { - - using namespace std; - -+// the size of the audio_render output port buffers -+#define AUDIO_DECODE_OUTPUT_BUFFER (32*1024) -+static const char rounded_up_channels_shift[] = {0,0,1,2,2,3,3,3,3}; -+ - static const uint16_t AC3Bitrates[] = {32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 448, 512, 576, 640}; - static const uint16_t AC3FSCod [] = {48000, 44100, 32000, 0}; - -@@ -65,6 +69,7 @@ COMXAudio::COMXAudio() : - m_Passthrough (false ), - m_HWDecode (false ), - m_BytesPerSec (0 ), -+ m_InputBytesPerSec(0 ), - m_BufferLen (0 ), - m_ChunkLen (0 ), - m_InputChannels (0 ), -@@ -491,11 +496,15 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo - - m_SampleRate = m_format.m_sampleRate; - m_BitsPerSample = CAEUtil::DataFormatToBits(m_format.m_dataFormat); -- m_BufferLen = m_BytesPerSec = m_format.m_sampleRate * (16 >> 3) * m_InputChannels; -- m_BufferLen *= AUDIO_BUFFER_SECONDS; -+ m_BytesPerSec = m_SampleRate * 2 << rounded_up_channels_shift[m_InputChannels]; -+ m_BufferLen = m_BytesPerSec * AUDIO_BUFFER_SECONDS; -+ m_InputBytesPerSec = m_SampleRate * m_BitsPerSample * m_InputChannels >> 3; -+ -+ // should be big enough that common formats (e.g. 6 channel DTS) fit in a single packet. -+ // we don't mind less common formats being split (e.g. ape/wma output large frames) - // the audio_decode output buffer size is 32K, and typically we convert from -- // 6 channel 32bpp float to 8 channel 16bpp in, so a full 48K input buffer will fit the outbut buffer -- m_ChunkLen = 48*1024; -+ // 6 channel 32bpp float to 8 channel 16bpp in, so a full 48K input buffer will fit the output buffer -+ m_ChunkLen = AUDIO_DECODE_OUTPUT_BUFFER * (m_InputChannels * m_BitsPerSample) >> (rounded_up_channels_shift[m_InputChannels] + 4); - - m_wave_header.Samples.wSamplesPerBlock = 0; - m_wave_header.Format.nChannels = m_InputChannels; -@@ -683,7 +692,7 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo - m_maxLevel = 0.0f; - - CLog::Log(LOGDEBUG, "COMXAudio::Initialize Input bps %d samplerate %d channels %d buffer size %d bytes per second %d", -- (int)m_pcm_input.nBitPerSample, (int)m_pcm_input.nSamplingRate, (int)m_pcm_input.nChannels, m_BufferLen, m_BytesPerSec); -+ (int)m_pcm_input.nBitPerSample, (int)m_pcm_input.nSamplingRate, (int)m_pcm_input.nChannels, m_BufferLen, m_InputBytesPerSec); - PrintPCM(&m_pcm_input, std::string("input")); - CLog::Log(LOGDEBUG, "COMXAudio::Initialize device passthrough %d hwdecode %d", - m_Passthrough, m_HWDecode); -@@ -864,11 +873,11 @@ bool COMXAudio::ApplyVolume(void) - //*********************************************************************************************** - unsigned int COMXAudio::AddPackets(const void* data, unsigned int len) - { -- return AddPackets(data, len, 0, 0); -+ return AddPackets(data, len, 0, 0, 0); - } - - //*********************************************************************************************** --unsigned int COMXAudio::AddPackets(const void* data, unsigned int len, double dts, double pts) -+unsigned int COMXAudio::AddPackets(const void* data, unsigned int len, double dts, double pts, unsigned int frame_size) - { - CSingleLock lock (m_critSection); - -@@ -915,24 +924,40 @@ unsigned int COMXAudio::AddPackets(const void* data, unsigned int len, double dt - omx_buffer->nOffset = 0; - omx_buffer->nFlags = 0; - -+ // we want audio_decode output buffer size to be no more than AUDIO_DECODE_OUTPUT_BUFFER. -+ // it will be 16-bit and rounded up to next power of 2 in channels -+ unsigned int max_buffer = AUDIO_DECODE_OUTPUT_BUFFER * (m_InputChannels * m_BitsPerSample) >> (rounded_up_channels_shift[m_InputChannels] + 4); -+ - unsigned int remaining = demuxer_samples-demuxer_samples_sent; -- unsigned int samples_space = omx_buffer->nAllocLen/pitch; -+ unsigned int samples_space = std::min(max_buffer, omx_buffer->nAllocLen)/pitch; - unsigned int samples = std::min(remaining, samples_space); - - omx_buffer->nFilledLen = samples * pitch; - -- if (samples < demuxer_samples && m_BitsPerSample==32 && !(m_Passthrough || m_HWDecode)) -+ unsigned int frames = frame_size ? len/frame_size:0; -+ if ((samples < demuxer_samples || frames > 1) && m_BitsPerSample==32 && !(m_Passthrough || m_HWDecode)) - { -- uint8_t *dst = omx_buffer->pBuffer; -- uint8_t *src = demuxer_content + demuxer_samples_sent * (m_BitsPerSample >> 3); -- // we need to extract samples from planar audio, so the copying needs to be done per plane -- for (int i=0; i<(int)m_InputChannels; i++) -- { -- memcpy(dst, src, omx_buffer->nFilledLen / m_InputChannels); -- dst += omx_buffer->nFilledLen / m_InputChannels; -- src += demuxer_samples * (m_BitsPerSample >> 3); -- } -- assert(dst <= omx_buffer->pBuffer + m_ChunkLen); -+ const unsigned int sample_pitch = m_BitsPerSample >> 3; -+ const unsigned int frame_samples = frame_size / pitch; -+ const unsigned int plane_size = frame_samples * sample_pitch; -+ const unsigned int out_plane_size = samples * sample_pitch; -+ //CLog::Log(LOGDEBUG, "%s::%s samples:%d/%d ps:%d ops:%d fs:%d pitch:%d filled:%d frames=%d", CLASSNAME, __func__, samples, demuxer_samples, plane_size, out_plane_size, frame_size, pitch, omx_buffer->nFilledLen, frames); -+ for (unsigned int sample = 0; sample < samples; ) -+ { -+ unsigned int frame = (demuxer_samples_sent + sample) / frame_samples; -+ unsigned int sample_in_frame = (demuxer_samples_sent + sample) - frame * frame_samples; -+ int out_remaining = std::min(std::min(frame_samples - sample_in_frame, samples), samples-sample); -+ uint8_t *src = demuxer_content + frame*frame_size + sample_in_frame * sample_pitch; -+ uint8_t *dst = (uint8_t *)omx_buffer->pBuffer + sample * sample_pitch; -+ for (unsigned int channel = 0; channel < m_InputChannels; channel++) -+ { -+ //CLog::Log(LOGDEBUG, "%s::%s copy(%d,%d,%d) (s:%d f:%d sin:%d c:%d)", CLASSNAME, __func__, dst-(uint8_t *)omx_buffer->pBuffer, src-demuxer_content, out_remaining, sample, frame, sample_in_frame, channel); -+ memcpy(dst, src, out_remaining * sample_pitch); -+ src += plane_size; -+ dst += out_plane_size; -+ } -+ sample += out_remaining; -+ } - } - else - { -@@ -1113,7 +1138,9 @@ float COMXAudio::GetCacheTime() - - float COMXAudio::GetCacheTotal() - { -- return m_BytesPerSec ? (float)m_BufferLen / (float)m_BytesPerSec : 0.0f; -+ float audioplus_buffer = m_SampleRate ? 0.0f : 32.0f * 512.0f / m_SampleRate; -+ float input_buffer = (float)m_omx_decoder.GetInputBufferSize() / (float)m_InputBytesPerSec; -+ return AUDIO_BUFFER_SECONDS + input_buffer + audioplus_buffer; - } - - //*********************************************************************************************** -diff --git a/xbmc/cores/omxplayer/OMXAudio.h b/xbmc/cores/omxplayer/OMXAudio.h -index 1c53ac5..4811788 100644 ---- a/xbmc/cores/omxplayer/OMXAudio.h -+++ b/xbmc/cores/omxplayer/OMXAudio.h -@@ -69,7 +69,7 @@ class COMXAudio - ~COMXAudio(); - - unsigned int AddPackets(const void* data, unsigned int len); -- unsigned int AddPackets(const void* data, unsigned int len, double dts, double pts); -+ unsigned int AddPackets(const void* data, unsigned int len, double dts, double pts, unsigned int frame_size); - unsigned int GetSpace(); - bool Deinitialize(); - -@@ -117,6 +117,7 @@ class COMXAudio - bool m_Passthrough; - bool m_HWDecode; - unsigned int m_BytesPerSec; -+ unsigned int m_InputBytesPerSec; - unsigned int m_BufferLen; - unsigned int m_ChunkLen; - unsigned int m_InputChannels; -diff --git a/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp b/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp -index b6a53a8..ce8a71d 100644 ---- a/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp -+++ b/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp -@@ -26,10 +26,15 @@ - - #include "cores/AudioEngine/Utils/AEUtil.h" - -+// the size of the audio_render output port buffers -+#define AUDIO_DECODE_OUTPUT_BUFFER (32*1024) -+static const char rounded_up_channels_shift[] = {0,0,1,2,2,3,3,3,3}; -+ - COMXAudioCodecOMX::COMXAudioCodecOMX() - { - m_pBufferOutput = NULL; - m_iBufferOutputAlloced = 0; -+ m_iBufferOutputUsed = 0; - - m_pCodecContext = NULL; - m_pConvert = NULL; -@@ -37,7 +42,10 @@ COMXAudioCodecOMX::COMXAudioCodecOMX() - - m_channels = 0; - m_pFrame1 = NULL; -+ m_frameSize = 0; - m_bGotFrame = false; -+ m_bNoConcatenate = false; -+ - m_iSampleFormat = AV_SAMPLE_FMT_NONE; - m_desiredSampleFormat = AV_SAMPLE_FMT_NONE; - } -@@ -47,6 +55,7 @@ COMXAudioCodecOMX::~COMXAudioCodecOMX() - av_free(m_pBufferOutput); - m_pBufferOutput = NULL; - m_iBufferOutputAlloced = 0; -+ m_iBufferOutputUsed = 0; - Dispose(); - } - -@@ -78,6 +87,10 @@ bool COMXAudioCodecOMX::Open(CDVDStreamInfo &hints) - m_pCodecContext->bit_rate = hints.bitrate; - m_pCodecContext->bits_per_coded_sample = hints.bitspersample; - -+ // vorbis has variable sized planar output, so skip concatenation -+ if (hints.codec == AV_CODEC_ID_VORBIS) -+ m_bNoConcatenate = true; -+ - if(m_pCodecContext->bits_per_coded_sample == 0) - m_pCodecContext->bits_per_coded_sample = 16; - -@@ -123,7 +136,7 @@ void COMXAudioCodecOMX::Dispose() - m_bGotFrame = false; - } - --int COMXAudioCodecOMX::Decode(BYTE* pData, int iSize) -+int COMXAudioCodecOMX::Decode(BYTE* pData, int iSize, double dts, double pts) - { - int iBytesUsed, got_frame; - if (!m_pCodecContext) return -1; -@@ -158,10 +171,15 @@ int COMXAudioCodecOMX::Decode(BYTE* pData, int iSize) - } - - m_bGotFrame = true; -+ if (!m_iBufferOutputUsed) -+ { -+ m_dts = dts; -+ m_pts = pts; -+ } - return iBytesUsed; - } - --int COMXAudioCodecOMX::GetData(BYTE** dst) -+int COMXAudioCodecOMX::GetData(BYTE** dst, double &dts, double &pts) - { - if (!m_bGotFrame) - return 0; -@@ -170,13 +188,11 @@ int COMXAudioCodecOMX::GetData(BYTE** dst) - int inputSize = av_samples_get_buffer_size(&inLineSize, m_pCodecContext->channels, m_pFrame1->nb_samples, m_pCodecContext->sample_fmt, 0); - /* output audio will be packed */ - int outputSize = av_samples_get_buffer_size(&outLineSize, m_pCodecContext->channels, m_pFrame1->nb_samples, m_desiredSampleFormat, 1); -- bool cont = !m_pFrame1->data[1] || (m_pFrame1->data[1] == m_pFrame1->data[0] + inLineSize && inLineSize == outLineSize && inLineSize * m_pCodecContext->channels == inputSize); - -- if (m_iBufferOutputAlloced < outputSize) -+ if (m_iBufferOutputAlloced < m_iBufferOutputUsed + outputSize) - { -- av_free(m_pBufferOutput); -- m_pBufferOutput = (BYTE*)av_malloc(outputSize + FF_INPUT_BUFFER_PADDING_SIZE); -- m_iBufferOutputAlloced = outputSize; -+ m_pBufferOutput = (BYTE*)av_realloc(m_pBufferOutput, m_iBufferOutputUsed + outputSize + FF_INPUT_BUFFER_PADDING_SIZE); -+ m_iBufferOutputAlloced = m_iBufferOutputUsed + outputSize; - } - *dst = m_pBufferOutput; - -@@ -208,8 +224,8 @@ int COMXAudioCodecOMX::GetData(BYTE** dst) - - /* use unaligned flag to keep output packed */ - uint8_t *out_planes[m_pCodecContext->channels]; -- if(av_samples_fill_arrays(out_planes, NULL, m_pBufferOutput, m_pCodecContext->channels, m_pFrame1->nb_samples, m_desiredSampleFormat, 1) < 0 || -- swr_convert(m_pConvert, out_planes, m_pFrame1->nb_samples, (const uint8_t **)m_pFrame1->data, m_pFrame1->nb_samples) < 0) -+ if(av_samples_fill_arrays(out_planes, NULL, m_pBufferOutput + m_iBufferOutputUsed, m_pCodecContext->channels, m_pFrame1->nb_samples, m_desiredSampleFormat, 1) < 0 || -+ m_dllSwResample.swr_convert(m_pConvert, out_planes, m_pFrame1->nb_samples, (const uint8_t **)m_pFrame1->data, m_pFrame1->nb_samples) < 0) - { - CLog::Log(LOGERROR, "COMXAudioCodecOMX::Decode - Unable to convert format %d to %d", (int)m_pCodecContext->sample_fmt, m_desiredSampleFormat); - outputSize = 0; -@@ -217,35 +233,45 @@ int COMXAudioCodecOMX::GetData(BYTE** dst) - } - else - { -- /* if it is already contiguous, just return decoded frame */ -- if (cont) -- { -- *dst = m_pFrame1->data[0]; -- } -- else -+ /* copy to a contiguous buffer */ -+ uint8_t *out_planes[m_pCodecContext->channels]; -+ if (av_samples_fill_arrays(out_planes, NULL, m_pBufferOutput + m_iBufferOutputUsed, m_pCodecContext->channels, m_pFrame1->nb_samples, m_desiredSampleFormat, 1) < 0 || -+ av_samples_copy(out_planes, m_pFrame1->data, 0, 0, m_pFrame1->nb_samples, m_pCodecContext->channels, m_desiredSampleFormat) < 0 ) - { -- /* copy to a contiguous buffer */ -- uint8_t *out_planes[m_pCodecContext->channels]; -- if (av_samples_fill_arrays(out_planes, NULL, m_pBufferOutput, m_pCodecContext->channels, m_pFrame1->nb_samples, m_desiredSampleFormat, 1) < 0 || -- av_samples_copy(out_planes, m_pFrame1->data, 0, 0, m_pFrame1->nb_samples, m_pCodecContext->channels, m_desiredSampleFormat) < 0 ) -- { -- outputSize = 0; -- } -+ outputSize = 0; - } - } -+ int desired_size = AUDIO_DECODE_OUTPUT_BUFFER * (m_pCodecContext->channels * GetBitsPerSample()) >> (rounded_up_channels_shift[m_pCodecContext->channels] + 4); - - if (m_bFirstFrame) - { -- CLog::Log(LOGDEBUG, "COMXAudioCodecOMX::GetData size=%d/%d line=%d/%d cont=%d buf=%p", inputSize, outputSize, inLineSize, outLineSize, cont, *dst); -+ CLog::Log(LOGDEBUG, "COMXAudioCodecOMX::GetData size=%d/%d line=%d/%d buf=%p, desired=%d", inputSize, outputSize, inLineSize, outLineSize, *dst, desired_size); - m_bFirstFrame = false; - } -- return outputSize; -+ m_iBufferOutputUsed += outputSize; -+ -+ if (!m_bNoConcatenate && m_pCodecContext->sample_fmt == AV_SAMPLE_FMT_FLTP && m_frameSize && (int)m_frameSize != outputSize) -+ CLog::Log(LOGERROR, "COMXAudioCodecOMX::GetData Unexpected change of size (%d->%d)", m_frameSize, outputSize); -+ m_frameSize = outputSize; -+ -+ // if next buffer submitted won't fit then flush it out -+ if (m_iBufferOutputUsed + outputSize > desired_size || m_bNoConcatenate) -+ { -+ int ret = m_iBufferOutputUsed; -+ m_bGotFrame = false; -+ m_iBufferOutputUsed = 0; -+ dts = m_dts; -+ pts = m_pts; -+ return ret; -+ } -+ return 0; - } - - void COMXAudioCodecOMX::Reset() - { - if (m_pCodecContext) avcodec_flush_buffers(m_pCodecContext); - m_bGotFrame = false; -+ m_iBufferOutputUsed = 0; - } - - int COMXAudioCodecOMX::GetChannels() -diff --git a/xbmc/cores/omxplayer/OMXAudioCodecOMX.h b/xbmc/cores/omxplayer/OMXAudioCodecOMX.h -index edfcf31..080c18f 100644 ---- a/xbmc/cores/omxplayer/OMXAudioCodecOMX.h -+++ b/xbmc/cores/omxplayer/OMXAudioCodecOMX.h -@@ -39,8 +39,8 @@ class COMXAudioCodecOMX - virtual ~COMXAudioCodecOMX(); - bool Open(CDVDStreamInfo &hints); - void Dispose(); -- int Decode(BYTE* pData, int iSize); -- int GetData(BYTE** dst); -+ int Decode(BYTE* pData, int iSize, double dts, double pts); -+ int GetData(BYTE** dst, double &dts, double &pts); - void Reset(); - int GetChannels(); - uint64_t GetChannelMap(); -@@ -48,6 +48,7 @@ class COMXAudioCodecOMX - int GetBitsPerSample(); - static const char* GetName() { return "FFmpeg"; } - int GetBitRate(); -+ unsigned int GetFrameSize() { return m_frameSize; } - - protected: - AVCodecContext* m_pCodecContext; -@@ -58,6 +59,7 @@ class COMXAudioCodecOMX - AVFrame* m_pFrame1; - - BYTE *m_pBufferOutput; -+ int m_iBufferOutputUsed; - int m_iBufferOutputAlloced; - - bool m_bOpenedCodec; -@@ -66,4 +68,7 @@ class COMXAudioCodecOMX - - bool m_bFirstFrame; - bool m_bGotFrame; -+ bool m_bNoConcatenate; -+ unsigned int m_frameSize; -+ double m_dts, m_pts; - }; -diff --git a/xbmc/cores/omxplayer/OMXPlayerAudio.cpp b/xbmc/cores/omxplayer/OMXPlayerAudio.cpp -index 8219015..a4c11777 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerAudio.cpp -+++ b/xbmc/cores/omxplayer/OMXPlayerAudio.cpp -@@ -227,9 +227,10 @@ bool OMXPlayerAudio::Decode(DemuxPacket *pkt, bool bDropPacket) - - if(!OMX_IS_RAW(m_format.m_dataFormat) && !bDropPacket) - { -+ double dts = pkt->dts, pts=pkt->pts; - while(!m_bStop && data_len > 0) - { -- int len = m_pAudioCodec->Decode((BYTE *)data_dec, data_len); -+ int len = m_pAudioCodec->Decode((BYTE *)data_dec, data_len, dts, pts); - if( (len < 0) || (len > data_len) ) - { - m_pAudioCodec->Reset(); -@@ -240,7 +241,7 @@ bool OMXPlayerAudio::Decode(DemuxPacket *pkt, bool bDropPacket) - data_len -= len; - - uint8_t *decoded; -- int decoded_size = m_pAudioCodec->GetData(&decoded); -+ int decoded_size = m_pAudioCodec->GetData(&decoded, dts, pts); - - if(decoded_size <=0) - continue; -@@ -274,7 +275,7 @@ bool OMXPlayerAudio::Decode(DemuxPacket *pkt, bool bDropPacket) - if(m_silence) - memset(decoded, 0x0, decoded_size); - -- ret = m_omxAudio.AddPackets(decoded, decoded_size, m_audioClock, m_audioClock); -+ ret = m_omxAudio.AddPackets(decoded, decoded_size, dts, pts, m_pAudioCodec->GetFrameSize()); - - if(ret != decoded_size) - { -@@ -312,7 +313,7 @@ bool OMXPlayerAudio::Decode(DemuxPacket *pkt, bool bDropPacket) - if(m_silence) - memset(pkt->pData, 0x0, pkt->iSize); - -- m_omxAudio.AddPackets(pkt->pData, pkt->iSize, m_audioClock, m_audioClock); -+ m_omxAudio.AddPackets(pkt->pData, pkt->iSize, m_audioClock, m_audioClock, 0); - } - - m_audioStats.AddSampleBytes(pkt->iSize); --- -1.9.3 - - -From a65df8146aca7ac336b211fcdd65b8c26c26cb1f Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 5 Mar 2014 22:10:01 +0000 -Subject: [PATCH 40/83] [omxplayer] Use media for determing audio delay and - cache time - -I've also added caching to the call to OMXMediaTime as the GPU round trip is expensive when called too frequently ---- - xbmc/cores/omxplayer/OMXAudio.cpp | 33 ++++++++++++++------- - xbmc/linux/OMXClock.cpp | 62 +++++++++++++++++++++++++++------------ - xbmc/linux/OMXClock.h | 2 ++ - 3 files changed, 68 insertions(+), 29 deletions(-) - -diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp -index f9db0f2..7c7ba25 100644 ---- a/xbmc/cores/omxplayer/OMXAudio.cpp -+++ b/xbmc/cores/omxplayer/OMXAudio.cpp -@@ -1117,29 +1117,40 @@ void COMXAudio::UpdateAttenuation() - //*********************************************************************************************** - unsigned int COMXAudio::GetSpace() - { -- int free = m_omx_decoder.GetInputBufferSpace(); -- return free; -+ return m_omx_decoder.GetInputBufferSpace(); - } - - float COMXAudio::GetDelay() - { -- unsigned int free = m_omx_decoder.GetInputBufferSize() - m_omx_decoder.GetInputBufferSpace(); -- return m_BytesPerSec ? (float)free / (float)m_BytesPerSec : 0.0f; -+ CSingleLock lock (m_critSection); -+ double stamp = DVD_NOPTS_VALUE; -+ double ret = 0.0; -+ if (m_last_pts != DVD_NOPTS_VALUE && m_av_clock) -+ stamp = m_av_clock->OMXMediaTime(); -+ // if possible the delay is current media time - time of last submitted packet -+ if (stamp != DVD_NOPTS_VALUE) -+ { -+ ret = (m_last_pts - stamp) * (1.0 / DVD_TIME_BASE); -+ //CLog::Log(LOGINFO, "%s::%s - %.2f %.0f %.0f", CLASSNAME, __func__, ret, stamp, m_last_pts); -+ } -+ else // just measure the input fifo -+ { -+ unsigned int used = m_omx_decoder.GetInputBufferSize() - m_omx_decoder.GetInputBufferSpace(); -+ ret = m_InputBytesPerSec ? (float)used / (float)m_InputBytesPerSec : 0.0f; -+ //CLog::Log(LOGINFO, "%s::%s - %.2f %d, %d, %d", CLASSNAME, __func__, ret, used, m_omx_decoder.GetInputBufferSize(), m_omx_decoder.GetInputBufferSpace()); -+ } -+ return ret; - } - - float COMXAudio::GetCacheTime() - { -- float fBufferLenFull = (float)m_BufferLen - (float)GetSpace(); -- if(fBufferLenFull < 0) -- fBufferLenFull = 0; -- float ret = m_BytesPerSec ? fBufferLenFull / (float)m_BytesPerSec : 0.0f; -- return ret; -+ return GetDelay(); - } - - float COMXAudio::GetCacheTotal() - { -- float audioplus_buffer = m_SampleRate ? 0.0f : 32.0f * 512.0f / m_SampleRate; -- float input_buffer = (float)m_omx_decoder.GetInputBufferSize() / (float)m_InputBytesPerSec; -+ float audioplus_buffer = m_SampleRate ? 32.0f * 512.0f / m_SampleRate : 0.0f; -+ float input_buffer = m_InputBytesPerSec ? (float)m_omx_decoder.GetInputBufferSize() / (float)m_InputBytesPerSec : 0; - return AUDIO_BUFFER_SECONDS + input_buffer + audioplus_buffer; - } - -diff --git a/xbmc/linux/OMXClock.cpp b/xbmc/linux/OMXClock.cpp -index 0bc74bb..c631ab6 100644 ---- a/xbmc/linux/OMXClock.cpp -+++ b/xbmc/linux/OMXClock.cpp -@@ -44,6 +44,8 @@ OMXClock::OMXClock() - m_eState = OMX_TIME_ClockStateStopped; - m_eClock = OMX_TIME_RefClockNone; - m_clock = NULL; -+ m_last_media_time = 0.0f; -+ m_last_media_time_read = 0.0f; - - pthread_mutex_init(&m_lock, NULL); - } -@@ -112,6 +114,7 @@ bool OMXClock::OMXSetReferenceClock(bool has_audio, bool lock /* = true */) - } - m_eClock = refClock.eClock; - } -+ m_last_media_time = 0.0f; - if(lock) - UnLock(); - -@@ -141,6 +144,7 @@ void OMXClock::OMXDeinitialize() - m_omx_clock.Deinitialize(); - - m_omx_speed = DVD_PLAYSPEED_NORMAL; -+ m_last_media_time = 0.0f; - } - - bool OMXClock::OMXStateExecute(bool lock /* = true */) -@@ -168,6 +172,7 @@ bool OMXClock::OMXStateExecute(bool lock /* = true */) - } - } - -+ m_last_media_time = 0.0f; - if(lock) - UnLock(); - -@@ -185,6 +190,7 @@ void OMXClock::OMXStateIdle(bool lock /* = true */) - if(m_omx_clock.GetState() != OMX_StateIdle) - m_omx_clock.SetStateForComponent(OMX_StateIdle); - -+ m_last_media_time = 0.0f; - if(lock) - UnLock(); - } -@@ -221,6 +227,7 @@ bool OMXClock::OMXStop(bool lock /* = true */) - } - m_eState = clock.eState; - -+ m_last_media_time = 0.0f; - if(lock) - UnLock(); - -@@ -251,6 +258,7 @@ bool OMXClock::OMXStep(int steps /* = 1 */, bool lock /* = true */) - return false; - } - -+ m_last_media_time = 0.0f; - if(lock) - UnLock(); - -@@ -301,6 +309,7 @@ bool OMXClock::OMXReset(bool has_video, bool has_audio, bool lock /* = true */) - } - } - -+ m_last_media_time = 0.0f; - if(lock) - UnLock(); - -@@ -309,33 +318,45 @@ bool OMXClock::OMXReset(bool has_video, bool has_audio, bool lock /* = true */) - - double OMXClock::OMXMediaTime(bool lock /* = true */) - { -+ double pts = 0.0; - if(m_omx_clock.GetComponent() == NULL) - return 0; - -- if(lock) -- Lock(); -+ double now = GetAbsoluteClock(); -+ if (now - m_last_media_time_read > DVD_MSEC_TO_TIME(100) || m_last_media_time == 0.0) -+ { -+ if(lock) -+ Lock(); - -- OMX_ERRORTYPE omx_err = OMX_ErrorNone; -- double pts = 0; -+ OMX_ERRORTYPE omx_err = OMX_ErrorNone; - -- OMX_TIME_CONFIG_TIMESTAMPTYPE timeStamp; -- OMX_INIT_STRUCTURE(timeStamp); -- timeStamp.nPortIndex = m_omx_clock.GetInputPort(); -+ OMX_TIME_CONFIG_TIMESTAMPTYPE timeStamp; -+ OMX_INIT_STRUCTURE(timeStamp); -+ timeStamp.nPortIndex = m_omx_clock.GetInputPort(); -+ -+ omx_err = m_omx_clock.GetConfig(OMX_IndexConfigTimeCurrentMediaTime, &timeStamp); -+ if(omx_err != OMX_ErrorNone) -+ { -+ CLog::Log(LOGERROR, "OMXClock::MediaTime error getting OMX_IndexConfigTimeCurrentMediaTime\n"); -+ if(lock) -+ UnLock(); -+ return 0; -+ } -+ -+ pts = FromOMXTime(timeStamp.nTimestamp); -+ //CLog::Log(LOGINFO, "OMXClock::MediaTime %.2f (%.2f, %.2f)", pts, m_last_media_time, now - m_last_media_time_read); -+ m_last_media_time = pts; -+ m_last_media_time_read = now; - -- omx_err = m_omx_clock.GetConfig(OMX_IndexConfigTimeCurrentMediaTime, &timeStamp); -- if(omx_err != OMX_ErrorNone) -- { -- CLog::Log(LOGERROR, "OMXClock::MediaTime error getting OMX_IndexConfigTimeCurrentMediaTime\n"); - if(lock) - UnLock(); -- return 0; - } -- -- pts = FromOMXTime(timeStamp.nTimestamp); -- -- if(lock) -- UnLock(); -- -+ else -+ { -+ double speed = m_pause ? 0.0 : (double)m_omx_speed / DVD_PLAYSPEED_NORMAL; -+ pts = m_last_media_time + (now - m_last_media_time_read) * speed; -+ //CLog::Log(LOGINFO, "OMXClock::MediaTime cached %.2f (%.2f, %.2f)", pts, m_last_media_time, now - m_last_media_time_read); -+ } - return pts; - } - -@@ -408,6 +429,7 @@ bool OMXClock::OMXMediaTime(double pts, bool lock /* = true*/) - CLog::Log(LOGDEBUG, "OMXClock::OMXMediaTime set config %s = %.2f", index == OMX_IndexConfigTimeCurrentAudioReference ? - "OMX_IndexConfigTimeCurrentAudioReference":"OMX_IndexConfigTimeCurrentVideoReference", pts); - -+ m_last_media_time = 0.0f; - if(lock) - UnLock(); - -@@ -427,6 +449,7 @@ bool OMXClock::OMXPause(bool lock /* = true */) - if (OMXSetSpeed(0, false, true)) - m_pause = true; - -+ m_last_media_time = 0.0f; - if(lock) - UnLock(); - } -@@ -446,6 +469,7 @@ bool OMXClock::OMXResume(bool lock /* = true */) - if (OMXSetSpeed(m_omx_speed, false, true)) - m_pause = false; - -+ m_last_media_time = 0.0f; - if(lock) - UnLock(); - } -@@ -484,6 +508,7 @@ bool OMXClock::OMXSetSpeed(int speed, bool lock /* = true */, bool pause_resume - if (!pause_resume) - m_omx_speed = speed; - -+ m_last_media_time = 0.0f; - if(lock) - UnLock(); - -@@ -520,6 +545,7 @@ bool OMXClock::HDMIClockSync(bool lock /* = true */) - return false; - } - -+ m_last_media_time = 0.0f; - if(lock) - UnLock(); - -diff --git a/xbmc/linux/OMXClock.h b/xbmc/linux/OMXClock.h -index ccc277e..7bb6d4d 100644 ---- a/xbmc/linux/OMXClock.h -+++ b/xbmc/linux/OMXClock.h -@@ -57,6 +57,8 @@ class OMXClock - CDVDClock *m_clock; - private: - COMXCoreComponent m_omx_clock; -+ double m_last_media_time; -+ double m_last_media_time_read; - public: - OMXClock(); - ~OMXClock(); --- -1.9.3 - - -From fd8aa746b60ccff173b9c0e50bb6855bcc8ad70b Mon Sep 17 00:00:00 2001 +From 761793f70b945ead4ddc0ed54a0ab4363bec18ac Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 8 Mar 2014 15:36:06 +0000 -Subject: [PATCH 41/83] [hifiberry] Hack: force it to be recognised as IEC958 +Subject: [PATCH 39/83] [hifiberry] Hack: force it to be recognised as IEC958 capable to enable passthrough options --- @@ -9569,7 +8888,7 @@ Subject: [PATCH 41/83] [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 079c46f..eb9b559 100644 +index 8cbf6e5..a8ad933 100644 --- a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp +++ b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp @@ -932,6 +932,10 @@ void CAESinkALSA::EnumerateDevice(AEDeviceInfoList &list, const std::string &dev @@ -9587,20 +8906,20 @@ index 079c46f..eb9b559 100644 1.9.3 -From d293de69125c466ba2d9dc9d9d76853ecdcca1a7 Mon Sep 17 00:00:00 2001 +From eb6d30486a1f2978c043b88efff0d4254f96fde0 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 11 Mar 2014 18:50:23 +0000 -Subject: [PATCH 42/83] [dvdplayer] Use inexact seeking like omxplayer +Subject: [PATCH 40/83] [dvdplayer] Use inexact seeking like omxplayer --- xbmc/cores/dvdplayer/DVDPlayer.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index e3dfa2e..6279584 100644 +index 744e734..8e6e498 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -1935,7 +1935,11 @@ void CDVDPlayer::CheckAutoSceneSkip() +@@ -1937,7 +1937,11 @@ void CDVDPlayer::CheckAutoSceneSkip() /* * Seeking is NOT flushed so any content up to the demux point is retained when playing forwards. */ @@ -9612,7 +8931,7 @@ index e3dfa2e..6279584 100644 /* * Seek doesn't always work reliably. Last physical seek time is recorded to prevent looping * if there was an error with seeking and it landed somewhere unexpected, perhaps back in the -@@ -1953,7 +1957,11 @@ void CDVDPlayer::CheckAutoSceneSkip() +@@ -1955,7 +1959,11 @@ void CDVDPlayer::CheckAutoSceneSkip() /* * Seeking is NOT flushed so any content up to the demux point is retained when playing forwards. */ @@ -9624,7 +8943,7 @@ index e3dfa2e..6279584 100644 /* * Each commercial break is only skipped once so poorly detected commercial breaks can be * manually re-entered. Start and end are recorded to prevent looping and to allow seeking back -@@ -3293,9 +3301,12 @@ bool CDVDPlayer::CloseTeletextStream(bool bWaitForBuffers) +@@ -3314,9 +3322,12 @@ void CDVDPlayer::UpdateClockMaster() void CDVDPlayer::FlushBuffers(bool queued, double pts, bool accurate) { double startpts; @@ -9641,10 +8960,10 @@ index e3dfa2e..6279584 100644 1.9.3 -From f5e0ceed71fb8e65ef73217e4e6ee4bd0388b40a Mon Sep 17 00:00:00 2001 +From 0501c220d79363c66b3d98ca32dea47d60d4db9d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 13 Mar 2014 16:08:46 +0000 -Subject: [PATCH 43/83] [omxplayer] Make use of TrueHD fastpath when downmixing +Subject: [PATCH 41/83] [omxplayer] Make use of TrueHD fastpath when downmixing The TrueHD codec actually works in 3 stages. It decodes the downmixed stereo. It then decodes the differences required to produce 5.1. It then decodes the differences required to produce 7.1. @@ -9656,7 +8975,7 @@ Much better to tell the codec we only need the 2.0 stream. It saves about 50% of 1 file changed, 12 insertions(+) diff --git a/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp b/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp -index ce8a71d..aac84ad 100644 +index cd4d133..94acfaa 100644 --- a/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp +++ b/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp @@ -25,6 +25,8 @@ @@ -9689,10 +9008,10 @@ index ce8a71d..aac84ad 100644 1.9.3 -From 5467f3abd2eb34502d97b61645ed46726aa8522c Mon Sep 17 00:00:00 2001 +From 043f20ef539650c6641f7c69af3c130c11f606a5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 30 Dec 2013 12:02:14 +0000 -Subject: [PATCH 44/83] [rbp] Hardware accelerated resampling +Subject: [PATCH 42/83] [rbp] Hardware accelerated resampling This replaces the format conversion, up/down mixing and resampling code from ActiveAE with a GPU accelerated version. Should significantly reduce CPU when using paplayer or dvdplayer. @@ -9701,16 +9020,16 @@ Requires updated firmware --- .../Engines/ActiveAE/ActiveAEResample.cpp | 5 + .../Engines/ActiveAE/ActiveAEResample.h | 8 + - .../Engines/ActiveAE/ActiveAEResamplePi.cpp | 590 +++++++++++++++++++++ + .../Engines/ActiveAE/ActiveAEResamplePi.cpp | 593 +++++++++++++++++++++ .../Engines/ActiveAE/ActiveAEResamplePi.h | 62 +++ xbmc/cores/AudioEngine/Makefile.in | 1 + xbmc/linux/OMXCore.cpp | 4 +- - 6 files changed, 668 insertions(+), 2 deletions(-) + 6 files changed, 671 insertions(+), 2 deletions(-) create mode 100644 xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp create mode 100644 xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.h diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp -index 6478f3a..740203e 100644 +index 8250eef..972e1be 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp @@ -18,6 +18,10 @@ @@ -9724,13 +9043,13 @@ index 6478f3a..740203e 100644 #include "ActiveAEResample.h" #include "utils/log.h" -@@ -346,3 +350,4 @@ int CActiveAEResample::GetAVChannelIndex(enum AEChannel aechannel, uint64_t layo +@@ -359,3 +363,4 @@ int CActiveAEResample::GetAVChannelIndex(enum AEChannel aechannel, uint64_t layo { return av_get_channel_layout_channel_index(layout, GetAVChannel(aechannel)); } +#endif diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.h -index 9c89b1b..1dda8a0 100644 +index a471e02..5d37cc7 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.h +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.h @@ -19,6 +19,8 @@ @@ -9761,10 +9080,10 @@ index 9c89b1b..1dda8a0 100644 +#endif diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp new file mode 100644 -index 0000000..aa6344b +index 0000000..ae72dbd --- /dev/null +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp -@@ -0,0 +1,590 @@ +@@ -0,0 +1,593 @@ +/* + * Copyright (C) 2010-2013 Team XBMC + * http://xbmc.org @@ -9856,7 +9175,7 @@ index 0000000..aa6344b + } +} + -+bool CActiveAEResample::Init(uint64_t dst_chan_layout, int dst_channels, int dst_rate, AVSampleFormat dst_fmt, int dst_bits, uint64_t src_chan_layout, int src_channels, int src_rate, AVSampleFormat src_fmt, int src_bits, bool upmix, bool normalize, CAEChannelInfo *remapLayout, AEQuality quality) ++bool CActiveAEResample::Init(uint64_t dst_chan_layout, int dst_channels, int dst_rate, AVSampleFormat dst_fmt, int dst_bits, int dst_dither, uint64_t src_chan_layout, int src_channels, int src_rate, AVSampleFormat src_fmt, int src_bits, int src_dither, bool upmix, bool normalize, CAEChannelInfo *remapLayout, AEQuality quality) +{ + LOGTIMEINIT("x"); + @@ -10290,7 +9609,10 @@ index 0000000..aa6344b + else if (format == AE_FMT_FLOATP) return AV_SAMPLE_FMT_FLTP; + else if (format == AE_FMT_DOUBLEP) return AV_SAMPLE_FMT_DBLP; + -+ return AV_SAMPLE_FMT_FLT; ++ if (AE_IS_PLANAR(format)) ++ return AV_SAMPLE_FMT_FLTP; ++ else ++ return AV_SAMPLE_FMT_FLT; +} + +AEDataFormat CActiveAEResample::GetAESampleFormat(AVSampleFormat format, int bits) @@ -10357,7 +9679,7 @@ index 0000000..aa6344b +#endif diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.h new file mode 100644 -index 0000000..a72d867 +index 0000000..47a9e08 --- /dev/null +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.h @@ -0,0 +1,62 @@ @@ -10392,7 +9714,7 @@ index 0000000..a72d867 +public: + CActiveAEResample(); + virtual ~CActiveAEResample(); -+ bool Init(uint64_t dst_chan_layout, int dst_channels, int dst_rate, AVSampleFormat dst_fmt, int dst_bits, uint64_t src_chan_layout, int src_channels, int src_rate, AVSampleFormat src_fmt, int src_bits, bool upmix, bool normalize, CAEChannelInfo *remapLayout, AEQuality quality); ++ bool Init(uint64_t dst_chan_layout, int dst_channels, int dst_rate, AVSampleFormat dst_fmt, int dst_bits, int dst_dither, uint64_t src_chan_layout, int src_channels, int src_rate, AVSampleFormat src_fmt, int src_bits, int src_dither, bool upmix, bool normalize, CAEChannelInfo *remapLayout, AEQuality quality); + int Resample(uint8_t **dst_buffer, int dst_samples, uint8_t **src_buffer, int src_samples, double ratio); + int64_t GetDelay(int64_t base); + int GetBufferedSamples(); @@ -10424,7 +9746,7 @@ index 0000000..a72d867 + +} diff --git a/xbmc/cores/AudioEngine/Makefile.in b/xbmc/cores/AudioEngine/Makefile.in -index c219653..8ef688e 100644 +index c27d207..ebc74fa 100644 --- a/xbmc/cores/AudioEngine/Makefile.in +++ b/xbmc/cores/AudioEngine/Makefile.in @@ -31,6 +31,7 @@ SRCS += Engines/ActiveAE/ActiveAESink.cpp @@ -10461,10 +9783,10 @@ index 99e407a..8d3c86a 100644 1.9.3 -From 12332808387e5a2b245f94f575349befb11719e3 Mon Sep 17 00:00:00 2001 +From c3265e0a36dd74c4d64dc818a5a48de63b894f3f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 27 Mar 2014 00:22:05 +0000 -Subject: [PATCH 45/83] [PiResample] Work around AE not providing correct +Subject: [PATCH 43/83] [PiResample] Work around AE not providing correct src_bits --- @@ -10472,7 +9794,7 @@ Subject: [PATCH 45/83] [PiResample] Work around AE not providing correct 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp -index aa6344b..f88b239 100644 +index ae72dbd..385c526 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp @@ -95,16 +95,25 @@ bool CActiveAEResample::Init(uint64_t dst_chan_layout, int dst_channels, int dst @@ -10507,10 +9829,10 @@ index aa6344b..f88b239 100644 1.9.3 -From eaa971449804b7608855b8fbb456800609f02f14 Mon Sep 17 00:00:00 2001 +From 5eb748a1b3e596e793bab22e02735ef2652dee1b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 18:19:32 +0100 -Subject: [PATCH 46/83] [rbp/omxplayer] When opening a stream don't try to +Subject: [PATCH 44/83] [rbp/omxplayer] When opening a stream don't try to update gui so often --- @@ -10537,10 +9859,10 @@ index e9ba7d3..0fdc3c2 100644 1.9.3 -From e3909a230e28a861bdd26d24189e2da6ffef2470 Mon Sep 17 00:00:00 2001 +From 22b08e4de22a6d35015e7d56b60d9c4d7581cd48 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 15:28:57 +0100 -Subject: [PATCH 47/83] [omxcodec] Clamp video texture at edges to avoid image +Subject: [PATCH 45/83] [omxcodec] Clamp video texture at edges to avoid image wrapping --- @@ -10564,10 +9886,10 @@ index 51f56aa..2929a37 100644 1.9.3 -From 49ca1a34d169dd31209477da37b88ee226000297 Mon Sep 17 00:00:00 2001 +From 8dbe818fc4cf53e7bcd47c14d0b5898745ee7e93 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 17:36:19 +0100 -Subject: [PATCH 48/83] [PiSink] Remove unneeded header and use CAEChannelInfo +Subject: [PATCH 46/83] [PiSink] Remove unneeded header and use CAEChannelInfo directly --- @@ -10576,7 +9898,7 @@ Subject: [PATCH 48/83] [PiSink] Remove unneeded header and use CAEChannelInfo 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp -index f88b239..ee5722d 100644 +index 385c526..9a1e549 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp @@ -24,7 +24,6 @@ @@ -10588,7 +9910,7 @@ index f88b239..ee5722d 100644 #include "utils/log.h" diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp -index 9ce00e3..070e6eb 100644 +index 811ea0d..b6076f6 100644 --- a/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp +++ b/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp @@ -78,9 +78,9 @@ static void SetAudioProps(bool stream_channels, uint32_t channel_map) @@ -10643,23 +9965,23 @@ index 9ce00e3..070e6eb 100644 1.9.3 -From 6d261f34bd92792853eed19700be95447b0903e9 Mon Sep 17 00:00:00 2001 +From e7e795bd378afc84e2bf4b848b923074d358804f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 17:37:41 +0100 -Subject: [PATCH 49/83] [omxplayer] Remove PCMRemap and handle multichannel +Subject: [PATCH 47/83] [omxplayer] Remove PCMRemap and handle multichannel mixing like ActiveAE does --- xbmc/cores/omxplayer/Makefile.in | 1 - xbmc/cores/omxplayer/OMXAudio.cpp | 390 ++++++++------ xbmc/cores/omxplayer/OMXAudio.h | 9 +- - xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp | 41 +- + xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp | 39 +- xbmc/cores/omxplayer/OMXAudioCodecOMX.h | 5 +- xbmc/cores/omxplayer/OMXPlayerAudio.cpp | 4 +- xbmc/cores/omxplayer/PCMRemap.cpp | 813 ------------------------------ xbmc/cores/omxplayer/PCMRemap.h | 151 ------ xbmc/linux/OMXCore.h | 2 - - 9 files changed, 287 insertions(+), 1129 deletions(-) + 9 files changed, 286 insertions(+), 1128 deletions(-) delete mode 100644 xbmc/cores/omxplayer/PCMRemap.cpp delete mode 100644 xbmc/cores/omxplayer/PCMRemap.h @@ -10676,7 +9998,7 @@ index 3163282..e5cad70 100644 LIB = omxplayer.a diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp -index 7c7ba25..774656d 100644 +index 757c7a2..353e00e 100644 --- a/xbmc/cores/omxplayer/OMXAudio.cpp +++ b/xbmc/cores/omxplayer/OMXAudio.cpp @@ -29,6 +29,7 @@ @@ -10687,7 +10009,7 @@ index 7c7ba25..774656d 100644 #define CLASSNAME "COMXAudio" -@@ -43,6 +44,9 @@ +@@ -42,6 +43,9 @@ extern "C" { #include "libavutil/crc.h" @@ -10697,7 +10019,7 @@ index 7c7ba25..774656d 100644 } using namespace std; -@@ -408,15 +412,134 @@ bool COMXAudio::PortSettingsChanged() +@@ -407,15 +411,134 @@ bool COMXAudio::PortSettingsChanged() return true; } @@ -10838,7 +10160,7 @@ index 7c7ba25..774656d 100644 { CSingleLock lock (m_critSection); OMX_ERRORTYPE omx_err; -@@ -426,7 +549,7 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo +@@ -425,7 +548,7 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo m_HWDecode = bUseHWDecode; m_Passthrough = bUsePassthrough; @@ -10847,7 +10169,7 @@ index 7c7ba25..774656d 100644 m_format = format; if(m_InputChannels == 0) -@@ -472,26 +595,128 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo +@@ -471,26 +594,128 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo if (!m_Passthrough) { @@ -10992,7 +10314,7 @@ index 7c7ba25..774656d 100644 } m_SampleRate = m_format.m_sampleRate; -@@ -1604,122 +1829,3 @@ void COMXAudio::CheckOutputBufferSize(void **buffer, int *oldSize, int newSize) +@@ -1601,122 +1826,3 @@ void COMXAudio::CheckOutputBufferSize(void **buffer, int *oldSize, int newSize) } memset(*buffer, 0x0, *oldSize); } @@ -11116,10 +10438,10 @@ index 7c7ba25..774656d 100644 - return m_channelLayout; -} diff --git a/xbmc/cores/omxplayer/OMXAudio.h b/xbmc/cores/omxplayer/OMXAudio.h -index 4811788..3f02bb5 100644 +index 43b14b1..03440bb 100644 --- a/xbmc/cores/omxplayer/OMXAudio.h +++ b/xbmc/cores/omxplayer/OMXAudio.h -@@ -36,7 +36,6 @@ +@@ -35,7 +35,6 @@ #include "OMXClock.h" #include "OMXCore.h" @@ -11127,7 +10449,7 @@ index 4811788..3f02bb5 100644 #include "threads/CriticalSection.h" -@@ -64,7 +63,7 @@ class COMXAudio +@@ -63,7 +62,7 @@ class COMXAudio float GetCacheTime(); float GetCacheTotal(); COMXAudio(); @@ -11136,7 +10458,7 @@ index 4811788..3f02bb5 100644 bool PortSettingsChanged(); ~COMXAudio(); -@@ -102,12 +101,6 @@ class COMXAudio +@@ -101,12 +100,6 @@ class COMXAudio unsigned int GetAudioRenderingLatency(); float GetMaxLevel(double &pts); @@ -11150,7 +10472,7 @@ index 4811788..3f02bb5 100644 IAudioCallback* m_pCallback; bool m_Initialized; diff --git a/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp b/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp -index aac84ad..59a5b89 100644 +index 94acfaa..59a5b89 100644 --- a/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp +++ b/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp @@ -26,7 +26,6 @@ @@ -11176,15 +10498,6 @@ index aac84ad..59a5b89 100644 m_pCodecContext->request_channel_layout = AV_CH_LAYOUT_5POINT1; } if (m_pCodecContext->request_channel_layout) -@@ -237,7 +235,7 @@ int COMXAudioCodecOMX::GetData(BYTE** dst, double &dts, double &pts) - /* use unaligned flag to keep output packed */ - uint8_t *out_planes[m_pCodecContext->channels]; - if(av_samples_fill_arrays(out_planes, NULL, m_pBufferOutput + m_iBufferOutputUsed, m_pCodecContext->channels, m_pFrame1->nb_samples, m_desiredSampleFormat, 1) < 0 || -- m_dllSwResample.swr_convert(m_pConvert, out_planes, m_pFrame1->nb_samples, (const uint8_t **)m_pFrame1->data, m_pFrame1->nb_samples) < 0) -+ swr_convert(m_pConvert, out_planes, m_pFrame1->nb_samples, (const uint8_t **)m_pFrame1->data, m_pFrame1->nb_samples) < 0) - { - CLog::Log(LOGERROR, "COMXAudioCodecOMX::Decode - Unable to convert format %d to %d", (int)m_pCodecContext->sample_fmt, m_desiredSampleFormat); - outputSize = 0; @@ -314,7 +312,7 @@ int COMXAudioCodecOMX::GetBitRate() return m_pCodecContext->bit_rate; } @@ -12275,10 +11588,10 @@ index 2f1e8a9..b4c8626 100644 1.9.3 -From b52643dbb7f6252012b977ebeacea110e23fa791 Mon Sep 17 00:00:00 2001 +From 87cba44d0bded01df56064376c285b978fbfde9c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 30 Mar 2014 15:54:34 +0100 -Subject: [PATCH 50/83] [omxplayer] Make the sharpness control act as a +Subject: [PATCH 48/83] [omxplayer] Make the sharpness control act as a sharpness control. This fixes scaling kernel as Mitchell Netravali, and varies sharpness over range B=[5/3,0] C=[-1/3,1/2] @@ -12660,10 +11973,10 @@ index 502df4a..f16743d 100644 1.9.3 -From 872af38b40480ea1af4906637653d3f39e924294 Mon Sep 17 00:00:00 2001 +From e2ebab58d5abbc4befbd2223d33f984017ee84c2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 16 Apr 2014 21:18:06 +0100 -Subject: [PATCH 51/83] [omxplayer] Don't propagate 3d flags based on supported +Subject: [PATCH 49/83] [omxplayer] Don't propagate 3d flags based on supported 3d modes --- @@ -12671,7 +11984,7 @@ Subject: [PATCH 51/83] [omxplayer] Don't propagate 3d flags based on supported 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index 11d141a..b3786f6 100644 +index 2fdbe18..e6bf2d0 100644 --- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp @@ -746,36 +746,15 @@ void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height, f @@ -12719,10 +12032,10 @@ index 11d141a..b3786f6 100644 1.9.3 -From 0605cdb1bc3d9634c8e917c7112660aceaffff20 Mon Sep 17 00:00:00 2001 +From 56f27ce396000a153db0f646eff916061dc84b9f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Apr 2014 13:00:52 +0100 -Subject: [PATCH 52/83] [graphics] Don't set stereo mode based on resolution +Subject: [PATCH 50/83] [graphics] Don't set stereo mode based on resolution The resolution change should follow stereo mode --- @@ -12766,10 +12079,10 @@ index 5bffdf5..7e4fdd4 100644 1.9.3 -From 0a4ad0213e5b48a69b4926c0a9633080c747565a Mon Sep 17 00:00:00 2001 +From bdfec31b0077901e7fcc89bae6769400b4919487 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Apr 2014 13:01:51 +0100 -Subject: [PATCH 53/83] [graphics] Allow switching to a more suitable 3D +Subject: [PATCH 51/83] [graphics] Allow switching to a more suitable 3D resolution --- @@ -12859,10 +12172,10 @@ index 0a27643..df55e92 100644 1.9.3 -From cb4e23e1579c170a3d7a04e69c9919aef7363593 Mon Sep 17 00:00:00 2001 +From c5feb5ea893de36563d2d161a757b38fa7f8de25 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Apr 2014 13:38:55 +0100 -Subject: [PATCH 54/83] [3D] Support switching to 3D resolutions +Subject: [PATCH 52/83] [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. @@ -12947,10 +12260,10 @@ index 83c3adb..8076e76 100644 1.9.3 -From 52c6dee71ffd7a440247f080d41dd360116791c1 Mon Sep 17 00:00:00 2001 +From d05fd0d1ca93a0c5dd99652913718e85b335dac9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 23 Apr 2014 00:05:07 +0100 -Subject: [PATCH 55/83] [graphics] Make pixel ratio for 3d modes consistent +Subject: [PATCH 53/83] [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. @@ -13138,18 +12451,18 @@ index 90b57e1..5b26b20 100644 1.9.3 -From 3cb9672df4ea51cc8fa0f4f5d6a90eea3481f8ce Mon Sep 17 00:00:00 2001 +From 66cffa709e5f0e408723fbd665b562cec5d9d0da Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 23 Apr 2014 21:07:51 +0100 -Subject: [PATCH 56/83] [PiSink] More attempts to reduce underrun audio +Subject: [PATCH 54/83] [PiSink] More attempts to reduce underrun audio glitches with multichannl and high samplerate --- - xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp | 79 +++++++++++-------------------- - 1 file changed, 27 insertions(+), 52 deletions(-) + xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp | 73 ++++++++++++------------------- + 1 file changed, 27 insertions(+), 46 deletions(-) diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp -index 070e6eb..133b9f6 100644 +index b6076f6..2c242d5 100644 --- a/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp +++ b/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp @@ -186,7 +186,7 @@ bool CAESinkPi::Initialize(AEAudioFormat &format, std::string &device) @@ -13170,12 +12483,13 @@ index 070e6eb..133b9f6 100644 omx_err = m_omx_render.SetParameter(OMX_IndexParamPortDefinition, &port_param); if (omx_err != OMX_ErrorNone) -@@ -308,63 +308,38 @@ double CAESinkPi::GetCacheTotal() +@@ -308,59 +308,40 @@ double CAESinkPi::GetCacheTotal() - unsigned int CAESinkPi::AddPackets(uint8_t *data, unsigned int frames, bool hasAudio, bool blocking) + unsigned int CAESinkPi::AddPackets(uint8_t **data, unsigned int frames, unsigned int offset) { - unsigned int sent = 0; -- + uint8_t *buffer = data[0]+offset*m_format.m_frameSize; + - if (!m_Initialized) + if (!m_Initialized || !frames) return frames; @@ -13194,25 +12508,20 @@ index 070e6eb..133b9f6 100644 - double delay = GetDelay(); - double ideal_submission_time = AUDIO_PLAYBUFFER - delay; - // ideal amount of audio we'd like submit (to make delay match AUDIO_PLAYBUFFER) -- int timeout = blocking ? 1000 : 0; +- int timeout = 1000; - int ideal_submission_samples = ideal_submission_time / (m_sinkbuffer_sec_per_byte * m_format.m_frameSize); - // if we are almost full then sleep (to avoid repeatedly sending a few samples) - bool too_laggy = ideal_submission_time < 0.25 * AUDIO_PLAYBUFFER; - int sleeptime = (int)(AUDIO_PLAYBUFFER * 0.25 * 1000.0); - if (too_laggy) - { -- if (blocking) -- { -- Sleep(sleeptime); -- continue; -- } -- break; +- Sleep(sleeptime); +- continue; - } - omx_buffer = m_omx_render.GetInputBuffer(timeout); - if (omx_buffer == NULL) - { -- if (blocking) -- CLog::Log(LOGERROR, "COMXAudio::Decode timeout"); +- CLog::Log(LOGERROR, "COMXAudio::Decode timeout"); - break; - } - @@ -13222,7 +12531,7 @@ index 070e6eb..133b9f6 100644 - omx_buffer->nFilledLen = samples * m_format.m_frameSize; - omx_buffer->nTimeStamp = ToOMXTime(0); - omx_buffer->nFlags = 0; -- memcpy(omx_buffer->pBuffer, (uint8_t *)data + sent * m_format.m_frameSize, omx_buffer->nFilledLen); +- memcpy(omx_buffer->pBuffer, (uint8_t *)buffer + sent * m_format.m_frameSize, omx_buffer->nFilledLen); - - sent += samples; - @@ -13246,7 +12555,7 @@ index 070e6eb..133b9f6 100644 + assert(omx_buffer->nFilledLen <= omx_buffer->nAllocLen); + omx_buffer->nTimeStamp = ToOMXTime(0); + omx_buffer->nFlags = OMX_BUFFERFLAG_ENDOFFRAME; -+ memcpy(omx_buffer->pBuffer, data, omx_buffer->nFilledLen); ++ memcpy(omx_buffer->pBuffer, buffer, omx_buffer->nFilledLen); + + omx_err = m_omx_render.EmptyThisBuffer(omx_buffer); + if (omx_err != OMX_ErrorNone) @@ -13263,10 +12572,10 @@ index 070e6eb..133b9f6 100644 1.9.3 -From 1b8454bacca84a29010f6810dde8dde83cbd47d3 Mon Sep 17 00:00:00 2001 +From a3f259f1884b439a5feb850d3fb36389082e1c3b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 22 Apr 2014 12:23:23 +0100 -Subject: [PATCH 57/83] [omxplayer] Make dvdplayer the default for dvd images +Subject: [PATCH 55/83] [omxplayer] Make dvdplayer the default for dvd images --- xbmc/cores/omxplayer/omxplayer_advancedsettings.xml | 2 +- @@ -13288,10 +12597,10 @@ index 77c6a15..51c0daf 100644 1.9.3 -From 6278c63886b9ade6f58a3c8af365d861319e9a1e Mon Sep 17 00:00:00 2001 +From b2e7b8c1cb55efc7d1bfa8c9bbc5b4f071672ba0 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 26 Apr 2014 17:27:52 +0100 -Subject: [PATCH 58/83] [cec] Don't suspend pi on tv switch off - it can't wake +Subject: [PATCH 56/83] [cec] Don't suspend pi on tv switch off - it can't wake up --- @@ -13315,10 +12624,10 @@ index a906628..9b5271a 100644 1.9.3 -From 85581e5fd18c80c8709071fabd1b9b2c5a34fa52 Mon Sep 17 00:00:00 2001 +From 20c6601aa04d4130736e2d7236d9e6189a20c425 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 27 Jun 2013 01:25:57 +0100 -Subject: [PATCH 60/83] [rbp/omxplayer] Do we need discontinuity handling? +Subject: [PATCH 58/83] [rbp/omxplayer] Do we need discontinuity handling? So far I've not seen what this is needed for and it does cause problems for some files. --- @@ -13341,10 +12650,10 @@ index f16743d..92dd5c5 100644 1.9.3 -From daadc25a3515e74d8712b6942b4465372c7c4abc Mon Sep 17 00:00:00 2001 +From 552b46dc19c1fd48b148d61fb5defb5775edd125 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 24 Oct 2013 00:53:26 +0100 -Subject: [PATCH 61/83] [rbp/omxplayer] Avoid marking non-monotonic timestamps +Subject: [PATCH 59/83] [rbp/omxplayer] Avoid marking non-monotonic timestamps as unknown Following a single spurious timestamp that is in the future, @@ -13354,10 +12663,10 @@ all subsequent timestamps will be marked unknown causing out of sync. 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp -index 774656d..c277af3 100644 +index 353e00e..90a02e1 100644 --- a/xbmc/cores/omxplayer/OMXAudio.cpp +++ b/xbmc/cores/omxplayer/OMXAudio.cpp -@@ -1206,22 +1206,10 @@ unsigned int COMXAudio::AddPackets(const void* data, unsigned int len, double dt +@@ -1205,22 +1205,10 @@ unsigned int COMXAudio::AddPackets(const void* data, unsigned int len, double dt } else { @@ -13386,10 +12695,10 @@ index 774656d..c277af3 100644 1.9.3 -From b9f64144349c6eef41f1cf01b3604de495326365 Mon Sep 17 00:00:00 2001 +From 565ada072fe56007b4b8bbd38071611aa0674e3f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 13 Dec 2013 16:25:23 +0000 -Subject: [PATCH 63/83] Add time taken to resample to log +Subject: [PATCH 61/83] Add time taken to resample to log --- xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 7 +++++++ @@ -13397,10 +12706,10 @@ Subject: [PATCH 63/83] Add time taken to resample to log 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -index 4bd2c32..974a852 100644 +index c9bbfce..650eabe 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -@@ -2564,7 +2564,14 @@ void CActiveAE::ResampleSounds() +@@ -2558,7 +2558,14 @@ void CActiveAE::ResampleSounds() { if (!(*it)->IsConverted()) { @@ -13433,10 +12742,10 @@ index 9324e1e..4405f66 100644 1.9.3 -From 2005ee812373eed2d91f274fcf97738eb0f25436 Mon Sep 17 00:00:00 2001 +From 71ec03a017771950422a1a556ade1c330559995e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 14 Dec 2013 16:55:05 +0000 -Subject: [PATCH 64/83] logging: Add microsecond timer to log messages +Subject: [PATCH 62/83] logging: Add microsecond timer to log messages --- xbmc/utils/log.cpp | 12 +++++++++--- @@ -13497,10 +12806,10 @@ index 6d7c6c8..45f68bc 100644 1.9.3 -From 91253a2c4dbd96a326a4283437fe7802dcef68b0 Mon Sep 17 00:00:00 2001 +From cba9612be7f3e763ea2405cab0f93e21df642b4d Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:49:17 +1300 -Subject: [PATCH 65/83] adds GetTvShowSeasons +Subject: [PATCH 63/83] adds GetTvShowSeasons --- xbmc/video/VideoDatabase.cpp | 30 ++++++++++++++++++++++++------ @@ -13508,10 +12817,10 @@ Subject: [PATCH 65/83] adds GetTvShowSeasons 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp -index 65c7eb3..bbabe0e 100644 +index cc764b8..ae9c27b 100644 --- a/xbmc/video/VideoDatabase.cpp +++ b/xbmc/video/VideoDatabase.cpp -@@ -3873,7 +3873,7 @@ bool CVideoDatabase::RemoveArtForItem(int mediaId, const MediaType &mediaType, c +@@ -4029,7 +4029,7 @@ bool CVideoDatabase::RemoveArtForItem(int mediaId, const MediaType &mediaType, c return result; } @@ -13520,7 +12829,7 @@ index 65c7eb3..bbabe0e 100644 { try { -@@ -3884,19 +3884,37 @@ bool CVideoDatabase::GetTvShowSeasonArt(int showId, map +@@ -4040,19 +4040,37 @@ bool CVideoDatabase::GetTvShowSeasonArt(int showId, map CStdString sql = PrepareSQL("select idSeason,season from seasons where idShow=%i", showId); m_pDS2->query(sql.c_str()); @@ -13564,10 +12873,10 @@ index 65c7eb3..bbabe0e 100644 return true; } diff --git a/xbmc/video/VideoDatabase.h b/xbmc/video/VideoDatabase.h -index cc45c6f..c117a03 100644 +index 7bf6d85..80334c6 100644 --- a/xbmc/video/VideoDatabase.h +++ b/xbmc/video/VideoDatabase.h -@@ -697,6 +697,7 @@ class CVideoDatabase : public CDatabase +@@ -720,6 +720,7 @@ class CVideoDatabase : public CDatabase std::string GetArtForItem(int mediaId, const MediaType &mediaType, const std::string &artType); bool RemoveArtForItem(int mediaId, const MediaType &mediaType, const std::string &artType); bool RemoveArtForItem(int mediaId, const MediaType &mediaType, const std::set &artTypes); @@ -13579,20 +12888,20 @@ index cc45c6f..c117a03 100644 1.9.3 -From 4dbc9ca025d40f120d16cf2aed7d273f1ec1ee72 Mon Sep 17 00:00:00 2001 +From d06cff694c9333957485172b005d0c7ed59a60b8 Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:50:10 +1300 -Subject: [PATCH 66/83] move AddSeason() public. +Subject: [PATCH 64/83] move AddSeason() public. --- xbmc/video/VideoDatabase.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xbmc/video/VideoDatabase.h b/xbmc/video/VideoDatabase.h -index c117a03..5f0139e 100644 +index 80334c6..a519620 100644 --- a/xbmc/video/VideoDatabase.h +++ b/xbmc/video/VideoDatabase.h -@@ -708,6 +708,7 @@ class CVideoDatabase : public CDatabase +@@ -731,6 +731,7 @@ class CVideoDatabase : public CDatabase virtual bool GetFilter(CDbUrl &videoUrl, Filter &filter, SortDescription &sorting); @@ -13600,7 +12909,7 @@ index c117a03..5f0139e 100644 int AddSet(const CStdString& strSet); void ClearMovieSet(int idMovie); void SetMovieSet(int idMovie, int idSet); -@@ -738,7 +739,6 @@ class CVideoDatabase : public CDatabase +@@ -761,7 +762,6 @@ class CVideoDatabase : public CDatabase int AddTvShow(const CStdString& strPath); int AddMusicVideo(const CStdString& strFilenameAndPath); @@ -13612,10 +12921,10 @@ index c117a03..5f0139e 100644 1.9.3 -From f31d83bdc99bc5ffcbb42f4e406df8efbfca87e1 Mon Sep 17 00:00:00 2001 +From 18c5cd06653c4b04a294b7f9332b2ef0d6a32523 Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:48:24 +1300 -Subject: [PATCH 67/83] adds GetArt function to (video) scraper, allowing art +Subject: [PATCH 65/83] adds GetArt function to (video) scraper, allowing art to be fetched given the video identifier. --- @@ -13733,10 +13042,10 @@ index 22ac229..75bc341 100644 1.9.3 -From 1a1a60df1d1ea44a2ae89895f7dfabe6d986a86c Mon Sep 17 00:00:00 2001 +From 3796ca7339a09d4a0a1b1af349754cc4cbdfe0ec Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:53:14 +1300 -Subject: [PATCH 68/83] refresh season art if a new season is found that isn't +Subject: [PATCH 66/83] refresh season art if a new season is found that isn't recorded in the database yet. Fixes #14339 --- @@ -13843,10 +13152,10 @@ index bb177d4..1ea47fd 100644 1.9.3 -From e4c7efbedf99acd123abab14792d094ab1a8fe26 Mon Sep 17 00:00:00 2001 +From b9f5c90a5dfde49685dfadce0116e9dad83e76b1 Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:53:34 +1300 -Subject: [PATCH 69/83] REMOVEME: updated thetvdb.com scraper to support art +Subject: [PATCH 67/83] REMOVEME: updated thetvdb.com scraper to support art updates --- @@ -13957,17 +13266,17 @@ index 4e2cc2f..2636c56 100644 1.9.3 -From c3720b83197964cef75806b9ee82fd7b38de890d Mon Sep 17 00:00:00 2001 +From 69c7b73251f72a97cb41948b9b1f063c76ffddcd Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 22 Mar 2014 16:40:01 +0000 -Subject: [PATCH 70/83] Enable PYTHONOPTIMIZE for Pi +Subject: [PATCH 68/83] Enable PYTHONOPTIMIZE for Pi --- xbmc/interfaces/python/XBPython.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xbmc/interfaces/python/XBPython.cpp b/xbmc/interfaces/python/XBPython.cpp -index 3793e39..6d099f8 100644 +index 4cf0f93..9e326b9 100644 --- a/xbmc/interfaces/python/XBPython.cpp +++ b/xbmc/interfaces/python/XBPython.cpp @@ -436,6 +436,10 @@ bool XBPython::InitializeEngine() @@ -13985,47 +13294,10 @@ index 3793e39..6d099f8 100644 1.9.3 -From 2eeb62c3a9da20abd8bd81ef8a224829f148f014 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Fri, 4 Apr 2014 13:06:41 +0100 -Subject: [PATCH 71/83] [info] Only extract thumbnails and video info from real - video stream - ---- - xbmc/cores/dvdplayer/DVDFileInfo.cpp | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDFileInfo.cpp b/xbmc/cores/dvdplayer/DVDFileInfo.cpp -index 4670fe5..dfbf323 100644 ---- a/xbmc/cores/dvdplayer/DVDFileInfo.cpp -+++ b/xbmc/cores/dvdplayer/DVDFileInfo.cpp -@@ -179,7 +179,8 @@ bool CDVDFileInfo::ExtractThumb(const CStdString &strPath, CTextureDetails &deta - CDemuxStream* pStream = pDemuxer->GetStream(i); - if (pStream) - { -- if(pStream->type == STREAM_VIDEO) -+ // ignore if it's a picture attachment (e.g. jpeg artwork) -+ if(pStream->type == STREAM_VIDEO && !(pStream->flags & AV_DISPOSITION_ATTACHED_PIC)) - nVideoStream = i; - else - pStream->SetDiscard(AVDISCARD_ALL); -@@ -379,7 +380,7 @@ bool CDVDFileInfo::DemuxerToStreamDetails(CDVDInputStream *pInputStream, CDVDDem - for (int iStream=0; iStreamGetNrOfStreams(); iStream++) - { - CDemuxStream *stream = pDemux->GetStream(iStream); -- if (stream->type == STREAM_VIDEO) -+ if (stream->type == STREAM_VIDEO && !(stream->flags & AV_DISPOSITION_ATTACHED_PIC)) - { - CStreamDetailVideo *p = new CStreamDetailVideo(); - p->m_iWidth = ((CDemuxStreamVideo *)stream)->iWidth; --- -1.9.3 - - -From c7f36106aea4b3e72b770464608b59f6a28d56ca Mon Sep 17 00:00:00 2001 +From 84d396ca9db50be5adebefcbe048432f4eb28d33 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 28 Apr 2014 18:07:45 +0100 -Subject: [PATCH 72/83] [rpi] Make ActiveAE thread higher priority to make +Subject: [PATCH 69/83] [rpi] Make ActiveAE thread higher priority to make audio underrun less likely --- @@ -14033,10 +13305,10 @@ Subject: [PATCH 72/83] [rpi] Make ActiveAE thread higher priority to make 1 file changed, 6 insertions(+) diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -index 974a852..318f1d4 100644 +index 650eabe..5463d30 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -@@ -2122,6 +2122,12 @@ void CActiveAE::LoadSettings() +@@ -2116,6 +2116,12 @@ void CActiveAE::LoadSettings() bool CActiveAE::Initialize() { Create(); @@ -14053,10 +13325,10 @@ index 974a852..318f1d4 100644 1.9.3 -From 77f22f1884ff5b9a536ea9e7bb29cd99b704575a Mon Sep 17 00:00:00 2001 +From de60fab11e6df3c0d0a7d8c4e533e96c60dbd910 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 29 Apr 2014 15:23:22 +0100 -Subject: [PATCH 73/83] [ffmpeg] Speed up wtv index creation +Subject: [PATCH 70/83] [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. @@ -14145,10 +13417,10 @@ index 0000000..8f5f989 1.9.3 -From d6045f93b286a1f6b37e69032c9119d13dda9451 Mon Sep 17 00:00:00 2001 +From 76730306b481bfe86d95990f61b9bd2a920db0c3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 29 Apr 2014 15:55:28 +0100 -Subject: [PATCH 74/83] [ffmpeg] vc-1: Optimise parser (with special attention +Subject: [PATCH 71/83] [ffmpeg] vc-1: Optimise parser (with special attention to ARM) Backport from upstream ffmpeg @@ -15505,10 +14777,10 @@ index f514ae6..863ee41 100644 1.9.3 -From a800607bcf003b0958995e402428b19411d87c89 Mon Sep 17 00:00:00 2001 +From f532f6417a5362ee606a1acc8bc4ff2cc0c8b9dd Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 29 Apr 2014 16:53:32 +0100 -Subject: [PATCH 75/83] [ffmpeg] truehd: Optimise with special attention to ARM +Subject: [PATCH 72/83] [ffmpeg] truehd: Optimise with special attention to ARM Backport from upstream ffmpeg --- @@ -17549,158 +16821,49 @@ index 863ee41..b56fbdd 100644 1.9.3 -From a0abed3c234d1362471766d2248ed3937e41eed1 Mon Sep 17 00:00:00 2001 +From 53bb6354fe1ed383bd256544f6f38583b8aa7b8f Mon Sep 17 00:00:00 2001 From: popcornmix -Date: Sat, 10 May 2014 11:40:41 +0100 -Subject: [PATCH 76/83] [omxplayer] Skip out of submit loop when closing. +Date: Wed, 28 May 2014 15:50:17 +0100 +Subject: [PATCH 73/83] [omxplayer] Avoid hang when closing stream with clock + stopped Avoids a permanent hang at EOF when using IPTV streams --- - xbmc/cores/omxplayer/OMXPlayerAudio.cpp | 7 +++++-- - xbmc/cores/omxplayer/OMXPlayerAudio.h | 1 + - xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 7 +++++-- - xbmc/cores/omxplayer/OMXPlayerVideo.h | 1 + - 4 files changed, 12 insertions(+), 4 deletions(-) + xbmc/cores/omxplayer/OMXPlayer.cpp | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) -diff --git a/xbmc/cores/omxplayer/OMXPlayerAudio.cpp b/xbmc/cores/omxplayer/OMXPlayerAudio.cpp -index d3348ec..4435d22 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerAudio.cpp -+++ b/xbmc/cores/omxplayer/OMXPlayerAudio.cpp -@@ -89,6 +89,7 @@ OMXPlayerAudio::OMXPlayerAudio(OMXClock *av_clock, CDVDMessageQueue& parent) - m_hw_decode = false; - m_silence = false; - m_flush = false; -+ m_bClose = false; - } +diff --git a/xbmc/cores/omxplayer/OMXPlayer.cpp b/xbmc/cores/omxplayer/OMXPlayer.cpp +index 92dd5c5..d447bf6 100644 +--- a/xbmc/cores/omxplayer/OMXPlayer.cpp ++++ b/xbmc/cores/omxplayer/OMXPlayer.cpp +@@ -2583,9 +2583,6 @@ void COMXPlayer::OnExit() + { + CLog::Log(LOGNOTICE, "COMXPlayer::OnExit()"); +- m_av_clock.OMXStop(); +- m_av_clock.OMXStateIdle(); +- + // set event to inform openfile something went wrong in case openfile is still waiting for this event + SetCaching(CACHESTATE_DONE); -@@ -145,11 +146,13 @@ void OMXPlayerAudio::OpenStream(CDVDStreamInfo &hints, COMXAudioCodecOMX *codec) - m_format.m_dataFormat = GetDataFormat(m_hints); - m_format.m_sampleRate = 0; - m_format.m_channelLayout = 0; -+ m_bClose = false; - } +@@ -2639,6 +2636,9 @@ void COMXPlayer::OnExit() - bool OMXPlayerAudio::CloseStream(bool bWaitForBuffers) - { - // wait until buffers are empty -+ m_bClose = true; - if (bWaitForBuffers && m_speed > 0) m_messageQueue.WaitUntilEmpty(); + m_messenger.End(); - m_messageQueue.Abort(); -@@ -259,8 +262,8 @@ bool OMXPlayerAudio::Decode(DemuxPacket *pkt, bool bDropPacket) - - while(!m_bStop) - { -- // discard if flushing as clocks may be stopped and we'll never submit it -- if(m_flush) -+ // discard if flushing or closing as clocks may be stopped and we'll never submit it -+ if(m_flush || m_bClose) - break; - - if(m_omxAudio.GetSpace() < (unsigned int)decoded_size) -diff --git a/xbmc/cores/omxplayer/OMXPlayerAudio.h b/xbmc/cores/omxplayer/OMXPlayerAudio.h -index 685a686..7b55e48 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerAudio.h -+++ b/xbmc/cores/omxplayer/OMXPlayerAudio.h -@@ -70,6 +70,7 @@ class OMXPlayerAudio : public CThread - bool m_DecoderOpen; - - bool m_bad_state; -+ bool m_bClose; - - virtual void OnStartup(); - virtual void OnExit(); -diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index b3786f6..61b884e 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -@@ -104,6 +104,7 @@ OMXPlayerVideo::OMXPlayerVideo(OMXClock *av_clock, - m_iCurrentPts = DVD_NOPTS_VALUE; - m_nextOverlay = DVD_NOPTS_VALUE; - m_flush = false; -+ m_bClose = false; - m_history_valid_pts = 0; - } - -@@ -118,6 +119,7 @@ bool OMXPlayerVideo::OpenStream(CDVDStreamInfo &hints) - m_hdmi_clock_sync = (CSettings::Get().GetInt("videoplayer.adjustrefreshrate") != ADJUST_REFRESHRATE_OFF); - m_started = false; - m_flush = false; -+ m_bClose = false; - m_stalled = m_messageQueue.GetPacketCount(CDVDMsg::DEMUXER_PACKET) == 0; - m_nextOverlay = DVD_NOPTS_VALUE; - // force SetVideoRect to be called initially -@@ -161,6 +163,7 @@ bool OMXPlayerVideo::OpenStream(CDVDStreamInfo &hints, COMXVideo *codec) - bool OMXPlayerVideo::CloseStream(bool bWaitForBuffers) - { - // wait until buffers are empty -+ m_bClose = true; - if (bWaitForBuffers && m_speed > 0) m_messageQueue.WaitUntilEmpty(); - - m_messageQueue.Abort(); -@@ -469,8 +472,8 @@ void OMXPlayerVideo::Process() - - while (!m_bStop) - { -- // discard if flushing as clocks may be stopped and we'll never submit it -- if (m_flush) -+ // discard if flushing or closing as clocks may be stopped and we'll never submit it -+ if (m_flush || m_bClose) - break; - - if((int)m_omxVideo.GetFreeSpace() < pPacket->iSize) -diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.h b/xbmc/cores/omxplayer/OMXPlayerVideo.h -index 6f19395..8eff32f 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerVideo.h -+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.h -@@ -66,6 +66,7 @@ class OMXPlayerVideo : public CThread - - float m_fForcedAspectRatio; - unsigned m_flags; -+ bool m_bClose; - - CRect m_src_rect; - CRect m_dst_rect; --- -1.9.3 - - -From e2c1e3c26e97a7804da7e752213a049a54dec50c Mon Sep 17 00:00:00 2001 -From: Alex Deryskyba -Date: Thu, 8 May 2014 18:54:54 +0300 -Subject: [PATCH 77/83] Reset display region when video stream properties - change - -Currently when video stream properties change, e.g. when user switches to next or previous Live TV channel, and has the same frame width and height, the COMXVideo::SetVideoRect() method is not called, causing the video to play back with default source and destination rectangles, not respecting the user-defined zoom settings. - -This commit fixes the issue. ---- - xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index 61b884e..eaa1e34 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -@@ -781,6 +781,9 @@ void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height, f - return; - } - -+ m_src_rect.SetRect(0, 0, 0, 0); -+ m_dst_rect.SetRect(0, 0, 0, 0); ++ m_av_clock.OMXStop(); ++ m_av_clock.OMXStateIdle(); + - g_renderManager.RegisterRenderUpdateCallBack((const void*)this, RenderUpdateCallBack); - } + m_av_clock.OMXDeinitialize(); + } -- 1.9.3 -From c3fd848dc3b6951473edd405b27bc2fd73d01625 Mon Sep 17 00:00:00 2001 +From 15fbd9378710804c18a4a2c037b0f68590e93a43 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 11 May 2014 16:13:45 +0100 -Subject: [PATCH 78/83] [rbp] Add config.txt settings to log file +Subject: [PATCH 74/83] [rbp] Add config.txt settings to log file --- xbmc/linux/RBP.cpp | 8 +++++++- @@ -17733,10 +16896,10 @@ index 49dcbb8..9a5e9cb 100644 1.9.3 -From b79741f61b5b0f589446e6dd3d5fdbcf83617590 Mon Sep 17 00:00:00 2001 +From 19f9911b494592a11bad8c5be7e8cfcac758fc2a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 12 May 2014 23:06:43 +0100 -Subject: [PATCH 81/83] [omxcodec] Updates to work better with dropping and +Subject: [PATCH 77/83] [omxcodec] Updates to work better with dropping and lateness detection --- @@ -18026,10 +17189,10 @@ index f234f6d..adf53b5 100644 1.9.3 -From 82751192a8757cfa8800278cbe871b0c48bff8ac Mon Sep 17 00:00:00 2001 +From f23ba67786b8012d1c05060425a2e4c5b3b6e599 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 11 Apr 2014 16:12:27 +0100 -Subject: [PATCH 82/83] [omxplayer] Add ability to log more timestamp info in +Subject: [PATCH 78/83] [omxplayer] Add ability to log more timestamp info in extra debug settings --- @@ -18070,7 +17233,7 @@ index 4bf5d83..3fb7cc3 100644 #ifdef __GNUC__ #define ATTRIB_LOG_FORMAT __attribute__((format(printf,3,4))) diff --git a/xbmc/cores/omxplayer/OMXPlayer.cpp b/xbmc/cores/omxplayer/OMXPlayer.cpp -index 92dd5c5..afa6290 100644 +index d447bf6..cdcda0a 100644 --- a/xbmc/cores/omxplayer/OMXPlayer.cpp +++ b/xbmc/cores/omxplayer/OMXPlayer.cpp @@ -1554,27 +1554,28 @@ void COMXPlayer::Process() @@ -18142,10 +17305,10 @@ index 92dd5c5..afa6290 100644 if (TP(m_playSpeed)) { diff --git a/xbmc/cores/omxplayer/OMXPlayerAudio.cpp b/xbmc/cores/omxplayer/OMXPlayerAudio.cpp -index 4435d22..0e49088 100644 +index d3348ec..02dd9be 100644 --- a/xbmc/cores/omxplayer/OMXPlayerAudio.cpp +++ b/xbmc/cores/omxplayer/OMXPlayerAudio.cpp -@@ -367,10 +367,10 @@ void OMXPlayerAudio::Process() +@@ -364,10 +364,10 @@ void OMXPlayerAudio::Process() DemuxPacket* pPacket = ((CDVDMsgDemuxerPacket*)pMsg)->GetPacket(); bool bPacketDrop = ((CDVDMsgDemuxerPacket*)pMsg)->GetPacketDrop(); @@ -18161,7 +17324,7 @@ index 4435d22..0e49088 100644 { // we are not running until something is cached in output device diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index eaa1e34..fa6a4c5 100644 +index e6bf2d0..aa5ea43 100644 --- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp @@ -42,6 +42,7 @@ @@ -18172,7 +17335,7 @@ index eaa1e34..fa6a4c5 100644 #include "settings/MediaSettings.h" #include "cores/VideoRenderers/RenderFormats.h" #include "cores/VideoRenderers/RenderFlags.h" -@@ -454,10 +455,10 @@ void OMXPlayerVideo::Process() +@@ -451,10 +452,10 @@ void OMXPlayerVideo::Process() DemuxPacket* pPacket = ((CDVDMsgDemuxerPacket*)pMsg)->GetPacket(); bool bPacketDrop = ((CDVDMsgDemuxerPacket*)pMsg)->GetPacketDrop(); @@ -18205,10 +17368,10 @@ index 6835504..fde4499 100644 1.9.3 -From 89495b080b49765c2f9fa730db95b3b7eab088a6 Mon Sep 17 00:00:00 2001 +From 8236a7de50c86e427741d305f5a8d4c89c7c70fd Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 23:13:55 +0100 -Subject: [PATCH 83/83] [omxplayer] Add ability to dump out audio/video data +Subject: [PATCH 79/83] [omxplayer] Add ability to dump out audio/video data for later debugging --- @@ -18254,10 +17417,10 @@ index 3fb7cc3..4d722a0 100644 #ifdef __GNUC__ #define ATTRIB_LOG_FORMAT __attribute__((format(printf,3,4))) diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp -index c277af3..0f83053 100644 +index 90a02e1..bf26287 100644 --- a/xbmc/cores/omxplayer/OMXAudio.cpp +++ b/xbmc/cores/omxplayer/OMXAudio.cpp -@@ -60,6 +60,49 @@ static const uint16_t AC3FSCod [] = {48000, 44100, 32000, 0}; +@@ -59,6 +59,49 @@ static const uint16_t AC3FSCod [] = {48000, 44100, 32000, 0}; static const uint16_t DTSFSCod [] = {0, 8000, 16000, 32000, 0, 0, 11025, 22050, 44100, 0, 0, 12000, 24000, 48000, 0, 0}; @@ -18307,7 +17470,7 @@ index c277af3..0f83053 100644 ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// -@@ -862,6 +905,7 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo +@@ -861,6 +904,7 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo memcpy((unsigned char *)omx_buffer->pBuffer, &m_wave_header, omx_buffer->nFilledLen); omx_buffer->nFlags = OMX_BUFFERFLAG_CODECCONFIG | OMX_BUFFERFLAG_ENDOFFRAME; @@ -18315,7 +17478,7 @@ index c277af3..0f83053 100644 omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); if (omx_err != OMX_ErrorNone) { -@@ -894,6 +938,7 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo +@@ -893,6 +937,7 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo memcpy((unsigned char *)omx_buffer->pBuffer, m_extradata, omx_buffer->nFilledLen); omx_buffer->nFlags = OMX_BUFFERFLAG_CODECCONFIG | OMX_BUFFERFLAG_ENDOFFRAME; @@ -18323,7 +17486,7 @@ index c277af3..0f83053 100644 omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); if (omx_err != OMX_ErrorNone) { -@@ -930,6 +975,8 @@ bool COMXAudio::Deinitialize() +@@ -929,6 +974,8 @@ bool COMXAudio::Deinitialize() { CSingleLock lock (m_critSection); @@ -18332,7 +17495,7 @@ index c277af3..0f83053 100644 if ( m_omx_tunnel_clock_analog.IsInitialized() ) m_omx_tunnel_clock_analog.Deestablish(); if ( m_omx_tunnel_clock_hdmi.IsInitialized() ) -@@ -1222,6 +1269,7 @@ unsigned int COMXAudio::AddPackets(const void* data, unsigned int len, double dt +@@ -1221,6 +1268,7 @@ unsigned int COMXAudio::AddPackets(const void* data, unsigned int len, double dt int nRetry = 0; while(true) { @@ -18340,7 +17503,7 @@ index c277af3..0f83053 100644 omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); if (omx_err == OMX_ErrorNone) { -@@ -1490,6 +1538,7 @@ void COMXAudio::SubmitEOS() +@@ -1487,6 +1535,7 @@ void COMXAudio::SubmitEOS() omx_buffer->nFlags = OMX_BUFFERFLAG_ENDOFFRAME | OMX_BUFFERFLAG_EOS | OMX_BUFFERFLAG_TIME_UNKNOWN; @@ -18452,3 +17615,179 @@ index fde4499..06ef2ed 100644 -- 1.9.3 + +From 8d4871b75e87ff00e1fd7aba2a05b2d4a538e5da Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 28 May 2014 18:30:51 +0100 +Subject: [PATCH 80/83] [omxcodec] Reduce GPU memory use by 2 video frames + +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.cpp | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.cpp +index 93cf521..cc45570 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/OpenMaxVideo.cpp +@@ -308,6 +308,20 @@ bool COpenMaxVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, OpenM + return false; + } + ++ { ++ // as we aren't tunnelled to display, we can save memory by setting extrabuffers to 0 ++ OMX_PARAM_U32TYPE extra_buffers; ++ OMX_INIT_STRUCTURE(extra_buffers); ++ extra_buffers.nU32 = 0; ++ ++ omx_err = m_omx_decoder.SetParameter(OMX_IndexParamBrcmExtraBuffers, &extra_buffers); ++ if(omx_err != OMX_ErrorNone) ++ { ++ CLog::Log(LOGERROR, "COMXVideo::Open error OMX_IndexParamBrcmExtraBuffers omx_err(0x%08x)\n", omx_err); ++ return false; ++ } ++ } ++ + // request portsettingschanged on aspect ratio change + OMX_CONFIG_REQUESTCALLBACKTYPE notifications; + OMX_INIT_STRUCTURE(notifications); +-- +1.9.3 + + +From a80a70359765452af894617afdeb7813e5ff63bf Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 28 May 2014 23:44:11 +0100 +Subject: [PATCH 81/83] [omxplayer] Fix for mapping of multichannel PCM audio + +--- + xbmc/cores/omxplayer/OMXAudio.cpp | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp +index bf26287..1bcc53e0 100644 +--- a/xbmc/cores/omxplayer/OMXAudio.cpp ++++ b/xbmc/cores/omxplayer/OMXAudio.cpp +@@ -651,13 +651,18 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo + if (m_InputChannels <= 2) + stdLayout = AE_CH_LAYOUT_2_0; + +- uint64_t m_dst_chan_layout = GetAVChannelLayout(stdLayout); ++ ++ CAEChannelInfo resolvedMap = channelMap; ++ resolvedMap.ResolveChannels(stdLayout); ++ uint64_t m_dst_chan_layout = GetAVChannelLayout(resolvedMap); + uint64_t m_src_chan_layout = GetAVChannelLayout(channelMap); +- m_OutputChannels = stdLayout.Count(); ++ ++ m_InputChannels = channelMap.Count(); ++ m_OutputChannels = resolvedMap.Count(); + + int m_dst_channels = m_OutputChannels; + int m_src_channels = m_InputChannels; +- SetAudioProps(m_Passthrough, GetChannelMap(stdLayout, m_Passthrough)); ++ SetAudioProps(m_Passthrough, GetChannelMap(resolvedMap, m_Passthrough)); + + CLog::Log(LOGINFO, "%s::%s remap:%p chan:%d->%d norm:%d upmix:%d %llx:%llx", CLASSNAME, __func__, remapLayout, m_src_channels, m_dst_channels, normalize, upmix, m_src_chan_layout, m_dst_chan_layout); + +-- +1.9.3 + + +From 2da39ac18e7f8ac1cd49ffbab8785e652b1f884e Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Fri, 30 May 2014 14:15:10 +0100 +Subject: [PATCH 82/83] [pi] Fix for logged resolutions + +--- + xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 15 +++++---------- + 1 file changed, 5 insertions(+), 10 deletions(-) + +diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +index 5b26b20..a3edf0e 100644 +--- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp ++++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +@@ -483,10 +483,8 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r + + if(resolutions.size() == 0) + { +- RESOLUTION_INFO res; +- CLog::Log(LOGDEBUG, "EGL probe resolution %s:%x\n", m_desktopRes.strMode.c_str(), m_desktopRes.dwFlags); +- + AddUniqueResolution(m_desktopRes, resolutions); ++ CLog::Log(LOGDEBUG, "EGL probe resolution %s:%x\n", m_desktopRes.strMode.c_str(), m_desktopRes.dwFlags); + } + + if(resolutions.size() < 2) +@@ -576,13 +574,12 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v + res.iScreenWidth = tv->width; + res.iScreenHeight = tv->height; + res.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res.iScreenWidth / (float)res.iScreenHeight); ++ res.iSubtitles = (int)(0.965 * res.iHeight); + ++ AddUniqueResolution(res, resolutions); + CLog::Log(LOGDEBUG, "EGL mode %d: %s (%.2f) %s%s:%x\n", i, res.strMode.c_str(), res.fPixelRatio, + tv->native ? "N" : "", tv->scan_mode ? "I" : "", tv->code); + +- res.iSubtitles = (int)(0.965 * res.iHeight); +- +- AddUniqueResolution(res, resolutions); + if (tv->frame_rate == 24 || tv->frame_rate == 30 || tv->frame_rate == 60) + { + RESOLUTION_INFO res2 = res; +@@ -596,11 +593,10 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v + RESOLUTION_INFO res2 = res; + res2.dwFlags |= D3DPRESENTFLAG_MODE3DSBS; + res2.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res2.iScreenWidth / (float)res2.iScreenHeight); +- CLog::Log(LOGDEBUG, "EGL mode %d: %s (%.2f)\n", i, res2.strMode.c_str(), res2.fPixelRatio); +- + res2.iSubtitles = (int)(0.965 * res2.iHeight); + + AddUniqueResolution(res2, resolutions); ++ CLog::Log(LOGDEBUG, "EGL mode %d: %s (%.2f)\n", i, res2.strMode.c_str(), res2.fPixelRatio); + if (tv->frame_rate == 24 || tv->frame_rate == 30 || tv->frame_rate == 60) + { + res2.fRefreshRate = (float)tv->frame_rate * (1000.0f/1001.0f); +@@ -612,11 +608,10 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v + RESOLUTION_INFO res2 = res; + res2.dwFlags |= D3DPRESENTFLAG_MODE3DTB; + res2.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res2.iScreenWidth / (float)res2.iScreenHeight); +- CLog::Log(LOGDEBUG, "EGL mode %d: %s (%.2f)\n", i, res2.strMode.c_str(), res2.fPixelRatio); +- + res2.iSubtitles = (int)(0.965 * res2.iHeight); + + AddUniqueResolution(res2, resolutions); ++ CLog::Log(LOGDEBUG, "EGL mode %d: %s (%.2f)\n", i, res2.strMode.c_str(), res2.fPixelRatio); + if (tv->frame_rate == 24 || tv->frame_rate == 30 || tv->frame_rate == 60) + { + res2.fRefreshRate = (float)tv->frame_rate * (1000.0f/1001.0f); +-- +1.9.3 + + +From 458a1742105636bdff0071957920e6e2b8c284a4 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Fri, 30 May 2014 14:58:43 +0100 +Subject: [PATCH 83/83] [settings] Experiment: Report DESKTOP resolution in + video settings + +--- + xbmc/settings/DisplaySettings.cpp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/xbmc/settings/DisplaySettings.cpp b/xbmc/settings/DisplaySettings.cpp +index 246a047..0204839 100644 +--- a/xbmc/settings/DisplaySettings.cpp ++++ b/xbmc/settings/DisplaySettings.cpp +@@ -650,6 +650,9 @@ void CDisplaySettings::SettingOptionsResolutionsFiller(const CSetting *setting, + vector resolutions = g_Windowing.ScreenResolutions(info.iScreen, info.fRefreshRate); + for (vector::const_iterator resolution = resolutions.begin(); resolution != resolutions.end(); ++resolution) + { ++if (resolution->ResInfo_Index == RES_DESKTOP) ++ list.push_back(make_pair(StringUtils::Format("DESKTOP"), resolution->ResInfo_Index)); ++else + list.push_back(make_pair( + StringUtils::Format("%dx%d%s", resolution->width, resolution->height, + ModeFlagsToString(resolution->flags, false).c_str()), +-- +1.9.3 +