diff --git a/projects/RPi/patches/xbmc/xbmc-001-newclock4.patch b/projects/RPi/patches/xbmc/xbmc-001-newclock4.patch index bf2e59c356..21b1b4c8cc 100644 --- a/projects/RPi/patches/xbmc/xbmc-001-newclock4.patch +++ b/projects/RPi/patches/xbmc/xbmc-001-newclock4.patch @@ -1,7 +1,7 @@ -From efc821fb0cdd20cb444a8e0b9c3871b6f524e081 Mon Sep 17 00:00:00 2001 +From 7be44c1396b421d18385dba981f7dad00b981cc5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 18 Aug 2014 17:48:04 +0100 -Subject: [PATCH 01/82] omxplayer: Reset codec on flush to stop a stale +Subject: [PATCH 001/104] omxplayer: Reset codec on flush to stop a stale timestamp from being returned --- @@ -22,10 +22,10 @@ index f1208e6..01d2afc 100644 m_messageQueue.Put( new CDVDMsg(CDVDMsg::GENERAL_FLUSH), 1); } -From bf54dc7ac1285b92e8bf36d18d47c34999c74c1f Mon Sep 17 00:00:00 2001 +From dc1337bfb333b7d4c0123fc577d015ae2ee52441 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 30 Dec 2013 12:02:14 +0000 -Subject: [PATCH 02/82] [rbp] Hardware accelerated resampling +Subject: [PATCH 002/104] [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. @@ -911,10 +911,10 @@ index 4ae29ba..4caa304 100644 OMX_ERRORTYPE omx_err = OMX_ErrorNone; -From 0a3befcfb1b3ade5395970beeba32c0d52bbf86d Mon Sep 17 00:00:00 2001 +From b6524129f2df11f4b13aa09e4a3c4e4af8651e44 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 18:19:32 +0100 -Subject: [PATCH 03/82] [rbp/omxplayer] When opening a stream don't try to +Subject: [PATCH 003/104] [rbp/omxplayer] When opening a stream don't try to update gui so often --- @@ -938,10 +938,10 @@ index e9ba7d3..0fdc3c2 100644 g_windowManager.ProcessRenderLoop(false); if (allowCancel && dialog->IsCanceled()) -From 00b3bf000b56143c58f7f889cf1e83ad1990c2a3 Mon Sep 17 00:00:00 2001 +From 7482553be39d4856de3923a55f3eda7fa144e7ae Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 29 Apr 2014 15:23:22 +0100 -Subject: [PATCH 04/82] [ffmpeg] Speed up wtv index creation +Subject: [PATCH 004/104] [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. @@ -1027,10 +1027,10 @@ index 0000000..4ac5636 + } + } -From da0b53794ad0cdfba4a8d8a5d20431461339e677 Mon Sep 17 00:00:00 2001 +From 7bde828f6438e10ed301568bb2de280bb469ca6a Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:49:17 +1300 -Subject: [PATCH 05/82] adds GetTvShowSeasons +Subject: [PATCH 005/104] adds GetTvShowSeasons --- xbmc/video/VideoDatabase.cpp | 30 ++++++++++++++++++++++++------ @@ -1106,10 +1106,10 @@ index 78259ed..cbb26b7 100644 bool GetArtTypes(const MediaType &mediaType, std::vector &artTypes); -From 3263688a14f9f784b4d1a751472e5c350538f0c2 Mon Sep 17 00:00:00 2001 +From 7112083b9f825a9eb977c6d30bc385e0f9d5f7f8 Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:50:10 +1300 -Subject: [PATCH 06/82] move AddSeason() public. +Subject: [PATCH 006/104] move AddSeason() public. --- xbmc/video/VideoDatabase.h | 2 +- @@ -1136,10 +1136,10 @@ index cbb26b7..1a79c00 100644 /*! \brief Adds a path to the tvshow link table. \param idShow the id of the show. -From 8a63d0f9f991b6b87ef0581865933d60749dac32 Mon Sep 17 00:00:00 2001 +From 6af0c481f4a9a29f606b7446a380e92ca1cd5a5e Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:48:24 +1300 -Subject: [PATCH 07/82] adds GetArt function to (video) scraper, allowing art +Subject: [PATCH 007/104] adds GetArt function to (video) scraper, allowing art to be fetched given the video identifier. --- @@ -1254,11 +1254,11 @@ index 22ac229..75bc341 100644 enum LOOKUP_STATE { DO_NOTHING = 0, FIND_MOVIE = 1, -From 04b9ff47bd3c79dd3857272a1dcb9749a26e04a7 Mon Sep 17 00:00:00 2001 +From b3e4aae2290c23ee0cfb47e33e604f03a0623e21 Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:53:14 +1300 -Subject: [PATCH 08/82] refresh season art if a new season is found that isn't - recorded in the database yet. Fixes #14339 +Subject: [PATCH 008/104] refresh season art if a new season is found that + isn't recorded in the database yet. Fixes #14339 --- xbmc/video/VideoInfoScanner.cpp | 33 ++++++++++++++++++++++++++++++++- @@ -1361,10 +1361,10 @@ index 7da1bf2..c764e20 100644 bool ProcessItemByVideoInfoTag(const CFileItem *item, EPISODELIST &episodeList); -From 60a66042dd6592b82a71ecc989f8bf67f1f79461 Mon Sep 17 00:00:00 2001 +From 12e255511287dfd6a4689082c0c3bc77e8636468 Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:53:34 +1300 -Subject: [PATCH 09/82] REMOVEME: updated thetvdb.com scraper to support art +Subject: [PATCH 009/104] REMOVEME: updated thetvdb.com scraper to support art updates --- @@ -1472,10 +1472,10 @@ index f27e4fc..bdf329f 100644 -From 08e7b88346eff63caf9587325847399361cb9862 Mon Sep 17 00:00:00 2001 +From 3ad334d6c1bb339b1c3c603907757e8d871ee867 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 2 Aug 2014 17:48:04 +0100 -Subject: [PATCH 10/82] [omx] Report decoded image name +Subject: [PATCH 010/104] [omx] Report decoded image name --- xbmc/cores/omxplayer/OMXImage.cpp | 1 + @@ -1494,10 +1494,10 @@ index 3fbea3b..57f69c5 100644 else { -From 99fd138ae7e2f0f160f1214e1b0b046ccd8f0d8a Mon Sep 17 00:00:00 2001 +From 72a0f68ff4e794930c42d3c509996a93d12faec5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 14 Dec 2013 16:55:05 +0000 -Subject: [PATCH 11/82] logging: Add microsecond timer to log messages +Subject: [PATCH 011/104] logging: Add microsecond timer to log messages --- xbmc/utils/log.cpp | 12 ++++++++---- @@ -1542,11 +1542,10 @@ index 4e51166..8ed8eec 100644 (uint64_t)CThread::GetCurrentThreadId(), levelNames[logLevel]) + strData; - -From 74ed6d07664e3cf3503fb3a8e52666d269d14719 Mon Sep 17 00:00:00 2001 +From a192fdf71cc6591de293da7d3408b6144c2c7b08 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 8 Mar 2014 15:36:06 +0000 -Subject: [PATCH 14/82] [hifiberry] Hack: force it to be recognised as IEC958 +Subject: [PATCH 014/104] [hifiberry] Hack: force it to be recognised as IEC958 capable to enable passthrough options --- @@ -1569,11 +1568,11 @@ index a464b4b..7eba389 100644 info.m_displayName.substr(info.m_displayName.size()-5) == " HDMI") { -From 630974ad95c6cb92ecf0f09ea5d9fdf714952097 Mon Sep 17 00:00:00 2001 +From 22dfa5801feda5faf17d74941d02667210630227 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 11 Dec 2013 17:21:54 +0000 -Subject: [PATCH 15/82] Move the reference-counting of Begin and End calls from - DX and GL source files into GUIFontTTF.cpp. +Subject: [PATCH 015/104] Move the reference-counting of Begin and End calls + from DX and GL source files into GUIFontTTF.cpp. --- xbmc/guilib/GUIFontTTF.cpp | 21 ++++++ @@ -1960,10 +1959,10 @@ index c0bb53a..735fb3a 100644 protected: virtual CBaseTexture* ReallocTexture(unsigned int& newHeight); -From f6390582c089b3fe0a45f92f73a3f7a46340b204 Mon Sep 17 00:00:00 2001 +From daf5e06ce68b4161b12325042f3ee52a0abfb9ec Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 11 Dec 2013 18:47:54 +0000 -Subject: [PATCH 16/82] Convert CGUIFontTTFBase::m_vertex to be managed as a +Subject: [PATCH 016/104] Convert CGUIFontTTFBase::m_vertex to be managed as a std::vector. Also retired CGUIFontTTFBase::m_vertex_count and @@ -2143,10 +2142,10 @@ index 97853fd..b76c6a5 100644 *vertices++ = m_vertex[i]; *vertices++ = m_vertex[i+1]; -From 8abe127f37de7746803cc29bed9d586c2dd72e50 Mon Sep 17 00:00:00 2001 +From 233254ab13f45af902d8ce5f47997e1be52cb2d6 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Mon, 16 Dec 2013 18:58:12 +0000 -Subject: [PATCH 17/82] CGUIFontTTFBase::RenderCharacter can now append to +Subject: [PATCH 017/104] CGUIFontTTFBase::RenderCharacter can now append to arbitrary vectors of vertices rather than only CGUIFontTTFBase::m_vertex --- @@ -2219,10 +2218,10 @@ index 10a7060..dde0350 100644 virtual CBaseTexture* ReallocTexture(unsigned int& newHeight) = 0; -From d00f850afefc2d0262859fa291f32c571ab38182 Mon Sep 17 00:00:00 2001 +From 1ae3e4a6f07b74244511e9388817c482aa1581a0 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 17:18:38 +0000 -Subject: [PATCH 18/82] Add a cache of font glyph bounding box vertices. +Subject: [PATCH 018/104] Add a cache of font glyph bounding box vertices. This is implemented as a template because ultimately we will key on different parameters and store values of different types, depending upon whether we @@ -2982,10 +2981,10 @@ index f351c99..9036ba9 100644 + return !operator==(a, b); +} -From e2248c28d591b4ae20bb748823661f26da3bc384 Mon Sep 17 00:00:00 2001 +From 8e4547b5330150713b36ba8118d7d9498972e884 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 23 Jan 2014 22:24:17 +0000 -Subject: [PATCH 19/82] Lay the groundwork for hardware clipping. +Subject: [PATCH 019/104] Lay the groundwork for hardware clipping. For glScissor() to replace CGraphicContext::ClipRect, a necessary condition is that no shear or rotation is introduced between the coordinate systems @@ -3247,10 +3246,10 @@ index 98e398a..81ee49e 100644 virtual void ResetScissors(); -From 7aa8b3db78cead1355ac78f516a6cd8addb7346e Mon Sep 17 00:00:00 2001 +From 029e8265c92499ceca873ecf2e4c67ae5eb5792d Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 23 Jan 2014 16:42:22 +0000 -Subject: [PATCH 20/82] Increase font cache hit rate by keying on the +Subject: [PATCH 020/104] Increase font cache hit rate by keying on the fractional part of m_originX and m_originY *after* they have been through the graphics context's transformation matrix, plus the scale/rotation elements of the matrix, rather than the origin in the original frame of reference plus @@ -3451,10 +3450,10 @@ index 77111bc..39bfa52 100644 private: virtual bool FirstBegin() = 0; -From 3d36d856b5b494dfb911e7df87ddf5a85a414719 Mon Sep 17 00:00:00 2001 +From 6b50757e8a97870099dfb9a7a36ad9f7f834a7c9 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 8 Jan 2014 12:16:33 +0000 -Subject: [PATCH 21/82] Rewrite of scrolling text code. +Subject: [PATCH 021/104] Rewrite of scrolling text code. No longer shuffles the string round to minimise the number of characters before the clipping rectangle; this doesn't save much on rendering time but @@ -3770,10 +3769,10 @@ index 2cda726..fbc579e 100644 private: void Process(); -From f8ddebec82988b66204874dd0fc0fd99de8856f3 Mon Sep 17 00:00:00 2001 +From d20743f609051a962f1518c3d8561606c90fbf93 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Mon, 27 Jan 2014 23:21:10 +0000 -Subject: [PATCH 22/82] Move the application of the translation offsets into +Subject: [PATCH 022/104] Move the application of the translation offsets into the GLES code. Still all pure software at this stage. Main change is in the data types at @@ -3967,10 +3966,10 @@ index 9935ea4..18c9358 100644 memset(newTexture->GetPixels(), 0, m_textureHeight * newTexture->GetPitch()); if (m_texture) -From b3c7a0fac81bd97f239ffa8bd82968d33a82156c Mon Sep 17 00:00:00 2001 +From 41c5ce4e4718d6c8e3142d54fac777bb183d9ed5 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 15:28:06 +0000 -Subject: [PATCH 23/82] Rather than applying the translation offsets to the +Subject: [PATCH 023/104] Rather than applying the translation offsets to the vertices, now applies them to the model view matrix from the top of the matrix stack and pushes it over to OpenGL. The vertices themselves are still all held client-side. @@ -4114,10 +4113,10 @@ index 81ee49e..d2f9cd1 100644 protected: virtual void SetVSyncImpl(bool enable) = 0; -From 6a7471d35bcf13a09d4eec164900e2ff48081dde Mon Sep 17 00:00:00 2001 +From 9a0081678df533209c53cb657267561edb5d6f64 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 29 Jan 2014 13:21:19 +0000 -Subject: [PATCH 24/82] Enable hardware clipping. +Subject: [PATCH 024/104] Enable hardware clipping. --- xbmc/guilib/GUIFontTTF.cpp | 4 ++-- @@ -4190,10 +4189,10 @@ index ea08bf4..b63e337 100644 glUniformMatrix4fv(modelLoc, 1, GL_FALSE, g_matrices.GetMatrix(MM_MODELVIEW)); } -From 556f6e65dcf67b6a6ca1b7d5b8c7918af1fa81bb Mon Sep 17 00:00:00 2001 +From 1abcfe29c3228c993dcfc5351b64e2a2eca5b596 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 15:32:51 +0000 -Subject: [PATCH 25/82] Move the vertex data across to a vertex buffer object +Subject: [PATCH 025/104] Move the vertex data across to a vertex buffer object just prior to drawing. --- @@ -4244,11 +4243,11 @@ index b63e337..b00055d 100644 // Disable the attributes used by this shader -From 39b12db282b00732a5e39e3ed10361dfc5888ee1 Mon Sep 17 00:00:00 2001 +From 9869fbaa1dd57919b3d61a535363b7018ca32b3f Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 16:04:04 +0000 -Subject: [PATCH 26/82] Move vertex data into an OpenGL VBO when the font cache - entry is populated. +Subject: [PATCH 026/104] Move vertex data into an OpenGL VBO when the font + cache entry is populated. The font cache now stores the "name" (handle) of the VBO, rather than a vector of vertices. @@ -4520,10 +4519,10 @@ index 735fb3a..6102c90 100644 protected: virtual CBaseTexture* ReallocTexture(unsigned int& newHeight); -From 3da3676ff144ad7d67c93ac2c278142964072078 Mon Sep 17 00:00:00 2001 +From f57a6d2eb833010d606237fe66616665bfca8255 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 16 Jan 2014 16:29:42 +0000 -Subject: [PATCH 27/82] Switch from glDrawArrays() to glDrawElements(). +Subject: [PATCH 027/104] Switch from glDrawArrays() to glDrawElements(). This involves setting up a static VBO containing the indexes necessary to convert from quads to triangles on the fly in the GPU. @@ -4744,10 +4743,10 @@ index 6de3532..258a293 100644 if (m_display != EGL_NO_DISPLAY) -From dcbc3dbce334053e9233e9df63d66af5b7f65902 Mon Sep 17 00:00:00 2001 +From 629e43cfebff705ac49a69d7fcfbd1c2b8b900ce Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 1 May 2014 16:28:39 +0100 -Subject: [PATCH 28/82] Improved file buffering in CArchive +Subject: [PATCH 028/104] Improved file buffering in CArchive Even though memcpy is typically inlined by the compiler into byte/word loads and stores (at least for release builds), the frequency with which 1, 2 and 4 @@ -4807,11 +4806,11 @@ index 6ed0f8f..8506d95 100644 } else -From 1dfe980dbbd32d81225268b6268b9d0b01b96efe Mon Sep 17 00:00:00 2001 +From 770893e5c924a92ef9de7ac4f69c0ab5505dfd27 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 10 Sep 2014 21:35:12 +0100 -Subject: [PATCH 29/82] [mmal] Add MMAL decoder and MMAL renderer for Raspberry - Pi +Subject: [PATCH 029/104] [mmal] Add MMAL decoder and MMAL renderer for + Raspberry Pi While omxplayer is the best performing player on the Pi (and the only option for raw Blu-Rays) there are some reasons to use dvdplayer on a Pi: @@ -4830,8 +4829,8 @@ allows high quality (cubic) scaling --- configure.in | 4 +- language/English/strings.po | 14 +- - system/settings/rbp.xml | 8 + - xbmc/cores/VideoRenderers/MMALRenderer.cpp | 726 +++++++++++++ + system/settings/rbp.xml | 10 + + xbmc/cores/VideoRenderers/MMALRenderer.cpp | 728 +++++++++++++ xbmc/cores/VideoRenderers/MMALRenderer.h | 129 +++ xbmc/cores/VideoRenderers/Makefile.in | 4 + xbmc/cores/VideoRenderers/RenderFormats.h | 1 + @@ -4841,11 +4840,11 @@ allows high quality (cubic) scaling .../dvdplayer/DVDCodecs/Video/DVDVideoCodec.h | 5 + .../DVDCodecs/Video/DVDVideoCodecMMAL.cpp | 99 ++ .../dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h | 50 + - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 1084 ++++++++++++++++++++ + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 1099 ++++++++++++++++++++ xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 157 +++ xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in | 5 + xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 1 + - 17 files changed, 2310 insertions(+), 2 deletions(-) + 17 files changed, 2329 insertions(+), 2 deletions(-) create mode 100644 xbmc/cores/VideoRenderers/MMALRenderer.cpp create mode 100644 xbmc/cores/VideoRenderers/MMALRenderer.h create mode 100644 xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp @@ -4854,7 +4853,7 @@ allows high quality (cubic) scaling create mode 100644 xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h diff --git a/configure.in b/configure.in -index 490b12b..8bf74cd 100644 +index 50eb8b4..8026979 100644 --- a/configure.in +++ b/configure.in @@ -721,6 +721,7 @@ case $use_platform in @@ -4874,7 +4873,7 @@ index 490b12b..8bf74cd 100644 else AC_CHECK_LIB([EGL], [main],, AC_MSG_ERROR($missing_library)) AC_CHECK_LIB([GLESv2],[main],, AC_MSG_ERROR($missing_library)) -@@ -2583,6 +2584,7 @@ AC_SUBST(USE_DOXYGEN) +@@ -2584,6 +2585,7 @@ AC_SUBST(USE_DOXYGEN) AC_SUBST(USE_PVR_ADDONS) AC_SUBST(UPNP_DEFINES) AC_SUBST(USE_SSE4) @@ -4883,10 +4882,10 @@ index 490b12b..8bf74cd 100644 # pushd and popd are not available in other shells besides bash, so implement # our own pushd/popd functions diff --git a/language/English/strings.po b/language/English/strings.po -index 348b77e..03b4146 100755 +index 00561a5..ddd8ce8 100755 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -15409,7 +15409,19 @@ msgctxt "#36433" +@@ -15410,7 +15410,19 @@ msgctxt "#36433" msgid "If enabled VAAPI render method is prefered. This puts less load on the CPU but driver may hang!" msgstr "" @@ -4906,15 +4905,16 @@ index 348b77e..03b4146 100755 +#empty strings from id 36436 to 36499 #end reservation - #: system/settings/settings.xml + #. label of a setting for the stereoscopic 3D mode of the GUI that is/should be applied diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml -index 28e68eb..bbb2076 100644 +index 21f06ed..570798b 100644 --- a/system/settings/rbp.xml +++ b/system/settings/rbp.xml -@@ -16,6 +16,14 @@ - - false - +@@ -12,6 +12,16 @@ + + false + ++ + + + 1 @@ -4923,15 +4923,16 @@ index 28e68eb..bbb2076 100644 + true + + - ++ + diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp new file mode 100644 -index 0000000..9a81eb9 +index 0000000..b7bcaeb --- /dev/null +++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -@@ -0,0 +1,726 @@ +@@ -0,0 +1,728 @@ +/* + * Copyright (C) 2005-2013 Team XBMC + * http://xbmc.org @@ -5184,7 +5185,8 @@ index 0000000..9a81eb9 + else if (CONF_FLAGS_YUVCOEF_MASK(m_iFlags) == CONF_FLAGS_YUVCOEF_240M) + es_format->es->video.color_space = MMAL_COLOR_SPACE_SMPTE240M; + } -+ assert(!m_vout); ++ if (m_bConfigured) ++ UnInit(); + m_bConfigured = init_vout(es_format); + mmal_format_free(es_format); + } @@ -5359,11 +5361,6 @@ index 0000000..9a81eb9 + UnInit(); + + m_iFlags = 0; -+ m_src_rect.SetRect(0, 0, 0, 0); -+ m_dst_rect.SetRect(0, 0, 0, 0); -+ m_video_stereo_mode = RENDER_STEREO_MODE_OFF; -+ m_display_stereo_mode = RENDER_STEREO_MODE_OFF; -+ m_StereoInvert = false; + + m_resolution = CDisplaySettings::Get().GetCurrentResolution(); + if ( m_resolution == RES_WINDOW ) @@ -5422,6 +5419,12 @@ index 0000000..9a81eb9 + m_RenderFeaturesCallBackFn = NULL; + m_RenderFeaturesCallBackCtx = NULL; + ++ m_src_rect.SetRect(0, 0, 0, 0); ++ m_dst_rect.SetRect(0, 0, 0, 0); ++ m_video_stereo_mode = RENDER_STEREO_MODE_OFF; ++ m_display_stereo_mode = RENDER_STEREO_MODE_OFF; ++ m_StereoInvert = false; ++ + m_bConfigured = false; +} + @@ -5875,7 +5878,7 @@ index 850890f..d3c2f1d 100644 CLinuxRendererGLES *m_pRenderer; #elif defined(HAS_DX) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp -index f8a5635..6ef941f 100644 +index ac6ac73..f139433 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp @@ -39,6 +39,7 @@ @@ -5907,10 +5910,10 @@ index f8a5635..6ef941f 100644 if (!hint.software && CSettings::Get().GetBool("videoplayer.usestagefright")) { diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h -index c4152f9..51364ab 100644 +index a4dae79..e80358f 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h -@@ -56,6 +56,7 @@ struct OpenMaxVideoBuffer; +@@ -56,6 +56,7 @@ struct OpenMaxVideoBufferHolder; class CDVDVideoCodecStageFright; class CDVDMediaCodecInfo; class CDVDVideoCodecIMXBuffer; @@ -6092,10 +6095,10 @@ index 0000000..67aa505 +#endif diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp new file mode 100644 -index 0000000..00f174a +index 0000000..d9a94d5 --- /dev/null +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -0,0 +1,1084 @@ +@@ -0,0 +1,1099 @@ +/* + * Copyright (C) 2010-2013 Team XBMC + * http://xbmc.org @@ -6231,6 +6234,7 @@ index 0000000..00f174a + m_changed_count = 0; + m_changed_count_dec = 0; + m_output_busy = 0; ++ m_demux_queue_length = 0; + m_es_format = mmal_format_alloc(); +} + @@ -6609,8 +6613,12 @@ index 0000000..00f174a + m_myself = myself; + m_decoded_width = hints.width; + m_decoded_height = hints.height; -+ m_forced_aspect_ratio = hints.forced_aspect; -+ m_aspect_ratio = hints.aspect; ++ ++ // use aspect in stream if available ++ if (m_hints.forced_aspect) ++ m_aspect_ratio = m_hints.aspect; ++ else ++ m_aspect_ratio = 0.0; + + switch (hints.codec) + { @@ -6866,6 +6874,7 @@ index 0000000..00f174a + demux_packet.size = iSize; + demux_packet.buff = new uint8_t[iSize]; + memcpy(demux_packet.buff, pData, iSize); ++ m_demux_queue_length += demux_packet.size; + m_demux_queue.push(demux_packet); + } + @@ -6883,6 +6892,7 @@ index 0000000..00f174a + if (space >= (unsigned int)demux_packet.size) + { + // need to lock here to retrieve an input buffer and pop the queue ++ m_demux_queue_length -= demux_packet.size; + m_demux_queue.pop(); + demuxer_bytes = (unsigned int)demux_packet.size; + demuxer_content = demux_packet.buff; @@ -6922,9 +6932,10 @@ index 0000000..00f174a + buffer->flags |= MMAL_BUFFER_HEADER_FLAG_FRAME_END; + + #if defined(MMAL_DEBUG_VERBOSE) -+ CLog::Log(LOGDEBUG, "%s::%s - %-8p %-6d/%-6d dts:%.3f pts:%.3f flags:%x dts_queue(%d) ready_queue(%d) busy_queue(%d)", -+ CLASSNAME, __func__, buffer, iSize-demuxer_bytes, iSize, dts == DVD_NOPTS_VALUE ? 0.0 : dts*1e-6, pts == DVD_NOPTS_VALUE ? 0.0 : pts*1e-6, buffer->flags, m_dts_queue.size(), m_output_ready.size(), m_output_busy); ++ CLog::Log(LOGDEBUG, "%s::%s - %-8p %-6d/%-6d dts:%.3f pts:%.3f flags:%x dts_queue(%d) ready_queue(%d) busy_queue(%d) demux_queue(%d) space(%d)", ++ CLASSNAME, __func__, buffer, buffer->length, demuxer_bytes, dts == DVD_NOPTS_VALUE ? 0.0 : dts*1e-6, pts == DVD_NOPTS_VALUE ? 0.0 : pts*1e-6, buffer->flags, m_dts_queue.size(), m_output_ready.size(), m_output_busy, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size); + #endif ++ assert((int)buffer->length > 0); + status = mmal_port_send_buffer(m_dec_input, buffer); + if (status != MMAL_SUCCESS) + { @@ -6996,13 +7007,19 @@ index 0000000..00f174a + #endif + ret |= VC_PICTURE; + } -+ if (mmal_queue_length(m_dec_input_pool->queue) > 0) ++ if (mmal_queue_length(m_dec_input_pool->queue) > 0 && !m_demux_queue_length) + { + #if defined(MMAL_DEBUG_VERBOSE) -+ CLog::Log(LOGDEBUG, "%s::%s - got space for output:%d", CLASSNAME, __func__, mmal_queue_length(m_dec_input_pool->queue)); ++ CLog::Log(LOGDEBUG, "%s::%s - got space for output: demux_queue(%d) space(%d)", CLASSNAME, __func__, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size); + #endif + ret |= VC_BUFFER; + } ++ if (!ret) ++ { ++ CLog::Log(LOGDEBUG, "%s::%s - Nothing to do: dts_queue(%d) ready_queue(%d) busy_queue(%d) demux_queue(%d) space(%d)", ++ CLASSNAME, __func__, m_dts_queue.size(), m_output_ready.size(), m_output_busy, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size); ++ Sleep(10); // otherwise we busy spin ++ } + return ret; +} + @@ -7033,6 +7050,7 @@ index 0000000..00f174a + m_dts_queue.pop(); + while (!m_demux_queue.empty()) + m_demux_queue.pop(); ++ m_demux_queue_length = 0; + pthread_mutex_unlock(&m_output_mutex); + if (!old_drop_state) + SetDropState(false); @@ -7118,9 +7136,9 @@ index 0000000..00f174a + pDvdVideoPicture->iHeight = buffer->height ? buffer->height : m_decoded_height; + pDvdVideoPicture->iDisplayWidth = pDvdVideoPicture->iWidth; + pDvdVideoPicture->iDisplayHeight = pDvdVideoPicture->iHeight; -+ //CLog::Log(LOGDEBUG, "%s::%s - %dx%d %dx%d %dx%d %dx%d %d,%d %f,%f", CLASSNAME, __func__, pDvdVideoPicture->iWidth, pDvdVideoPicture->iHeight, pDvdVideoPicture->iDisplayWidth, pDvdVideoPicture->iDisplayHeight, m_decoded_width, m_decoded_height, buffer->width, buffer->height, m_forced_aspect_ratio, m_hints.forced_aspect, buffer->m_aspect_ratio, m_hints.aspect); ++ //CLog::Log(LOGDEBUG, "%s::%s - %dx%d %dx%d %dx%d %dx%d %f,%f", CLASSNAME, __func__, pDvdVideoPicture->iWidth, pDvdVideoPicture->iHeight, pDvdVideoPicture->iDisplayWidth, pDvdVideoPicture->iDisplayHeight, m_decoded_width, m_decoded_height, buffer->width, buffer->height, buffer->m_aspect_ratio, m_hints.aspect); + -+ if (buffer->m_aspect_ratio > 0.0 && !m_forced_aspect_ratio) ++ if (buffer->m_aspect_ratio > 0.0) + { + pDvdVideoPicture->iDisplayWidth = ((int)lrint(pDvdVideoPicture->iHeight * buffer->m_aspect_ratio)) & -3; + if (pDvdVideoPicture->iDisplayWidth > pDvdVideoPicture->iWidth) @@ -7182,7 +7200,7 @@ index 0000000..00f174a +} diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h new file mode 100644 -index 0000000..4b98be2 +index 0000000..ef83a65 --- /dev/null +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h @@ -0,0 +1,157 @@ @@ -7301,12 +7319,12 @@ index 0000000..4b98be2 + unsigned int m_egl_buffer_count; + bool m_finished; + float m_aspect_ratio; -+ bool m_forced_aspect_ratio; + const char *m_pFormatName; + MMALVideoPtr m_myself; + + std::queue m_dts_queue; + std::queue m_demux_queue; ++ unsigned m_demux_queue_length; + + // mmal output buffers (video frames) + pthread_mutex_t m_output_mutex; @@ -7372,17 +7390,17 @@ index d3d37d1..374f4bd 100644 } return "UNKNOWN"; -From 2ee235762c433f3415a57d1be9b458bc8391226d Mon Sep 17 00:00:00 2001 +From 2cb71f73ec0abbae7918eb3f7096883362eea538 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 10 Sep 2014 22:07:21 +0100 -Subject: [PATCH 30/82] [mmal] Allow mmal codec for dvd stills +Subject: [PATCH 030/104] [mmal] Allow mmal codec for dvd stills --- xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp -index 6ef941f..116ff8a 100644 +index f139433..4183a2b 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp @@ -192,6 +192,10 @@ CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodec(CDVDStreamInfo &hint, unsigne @@ -7397,10 +7415,10 @@ index 6ef941f..116ff8a 100644 { // If dvd is an mpeg2 and hint.stills -From 75cb478f97c533fd61d4fb0a8f473baf32bb703c Mon Sep 17 00:00:00 2001 +From fb100256efd93aa41acdd8d31b62ffdee23940d9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 2 Aug 2014 17:47:38 +0100 -Subject: [PATCH 32/82] [VideoReferenceClock] Add OMX support +Subject: [PATCH 032/104] [VideoReferenceClock] Add OMX support --- xbmc/linux/RBP.cpp | 34 ++++++++++++++++++++++++ @@ -7599,10 +7617,10 @@ index 6027031..2dabac1 100644 }; -From 3b52bbd76f7a37530d3c2f6ae82d50164e38ca0b Mon Sep 17 00:00:00 2001 +From ed081e7ab0e9883b99c2c9150b91085f190ba3d7 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 12 Aug 2014 00:03:18 +0100 -Subject: [PATCH 33/82] videoreferenceclock: Boost priority +Subject: [PATCH 033/104] videoreferenceclock: Boost priority --- xbmc/video/VideoReferenceClock.cpp | 3 +++ @@ -7623,10 +7641,10 @@ index 916a15c..c491d29 100644 //register callback m_D3dCallback.Reset(); -From c0a5c4353a8b4705a2a47fade882a6d642bec4f5 Mon Sep 17 00:00:00 2001 +From 4cea68e319efc35e6b5f1d73bc43a7a3571052a2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 5 Feb 2014 11:46:33 +0000 -Subject: [PATCH 34/82] [rbp/settings] Allow av sync type to be enabled +Subject: [PATCH 034/104] [rbp/settings] Allow av sync type to be enabled It works for dvdplayer --- @@ -7634,7 +7652,7 @@ It works for dvdplayer 1 file changed, 7 deletions(-) diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml -index bbb2076..ce5c423 100644 +index 570798b..e09d974 100644 --- a/system/settings/rbp.xml +++ b/system/settings/rbp.xml @@ -1,13 +1,6 @@ @@ -7652,11 +7670,11 @@ index bbb2076..ce5c423 100644 false -From 1f0d35f1c1a27a09e3a83ffc3d3a72258d18c254 Mon Sep 17 00:00:00 2001 +From caa29bc74b7d90435b7dd5061125474812cd83b9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 16 Apr 2014 21:18:06 +0100 -Subject: [PATCH 39/82] [omxplayer] Don't propagate 3d flags based on supported - 3d modes +Subject: [PATCH 039/104] [omxplayer] Don't propagate 3d flags based on + supported 3d modes --- xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 29 ++++------------------------- @@ -7708,10 +7726,10 @@ index 2c25fd9..c2bd788 100644 unsigned int iDisplayWidth = width; unsigned int iDisplayHeight = height; -From 9e2ab2ce2b563fa459bc6a37e267ee34147b36aa Mon Sep 17 00:00:00 2001 +From d0f2d2ad29151d1720b6918940d0cedda98800ab Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Apr 2014 13:00:52 +0100 -Subject: [PATCH 40/82] [graphics] Don't set stereo mode based on resolution +Subject: [PATCH 040/104] [graphics] Don't set stereo mode based on resolution The resolution change should follow stereo mode --- @@ -7769,10 +7787,10 @@ index 5bffdf5..4be1c8b 100644 m_iScreenWidth = info_mod.iWidth; -From d91488c3547dae3de14c35793683c8943354824a Mon Sep 17 00:00:00 2001 +From 62c3a2aa13dc560c9910dcc881a8dc2df2620158 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Apr 2014 13:01:51 +0100 -Subject: [PATCH 41/82] [graphics] Allow switching to a more suitable 3D +Subject: [PATCH 041/104] [graphics] Allow switching to a more suitable 3D resolution --- @@ -7858,10 +7876,10 @@ index 0a27643..ef5bc74 100644 void ResetOverscan(RESOLUTION_INFO &resinfo); void ResetScreenParameters(RESOLUTION res); -From 0bf86871ae90bd5754a6773c8446c91eb2b931ed Mon Sep 17 00:00:00 2001 +From 3678d7821fcfee38da05934a0442d5efe968a39e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Apr 2014 13:38:55 +0100 -Subject: [PATCH 42/82] [3D] Support switching to 3D resolutions +Subject: [PATCH 042/104] [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. @@ -7943,10 +7961,10 @@ index 83c3adb..8076e76 100644 return current; } -From f7ed2957a4f5efe3f21c8bcf6537c90c94be8c53 Mon Sep 17 00:00:00 2001 +From 079a31fc0821af31e72b879c180fb5e2508fa80d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 23 Apr 2014 00:05:07 +0100 -Subject: [PATCH 43/82] [graphics] Make pixel ratio for 3d modes consistent +Subject: [PATCH 043/104] [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. @@ -8149,10 +8167,10 @@ index c58c28a..bf1e589 100644 AddUniqueResolution(res2, resolutions); -From 65d3b36df1cd3ae2f82e985f1b28573505dba8c0 Mon Sep 17 00:00:00 2001 +From 4c1122d41c5b6bafba4b244f4887a9a555469326 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 10 Aug 2014 16:45:16 +0100 -Subject: [PATCH 44/82] filesystem: Make support of browsing into archives +Subject: [PATCH 044/104] filesystem: Make support of browsing into archives optional The ability to browse, scan and play content in archives can cause problems on low powered/low memory devices. @@ -8168,10 +8186,10 @@ Add a settings option to enable this feature and default to disabled on Pi 4 files changed, 29 insertions(+) diff --git a/language/English/strings.po b/language/English/strings.po -index 03b4146..0631393 100755 +index ddd8ce8..30b3566 100755 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -15890,3 +15890,13 @@ msgstr "" +@@ -15905,3 +15905,13 @@ msgstr "" msgctxt "#37030" msgid "Unlimited" msgstr "" @@ -8186,7 +8204,7 @@ index 03b4146..0631393 100755 +msgid "Allow viewing and playing files in archives (e.g. zip, rar)" +msgstr "" diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml -index ce5c423..5526931 100644 +index e09d974..49706c0 100644 --- a/system/settings/rbp.xml +++ b/system/settings/rbp.xml @@ -1,5 +1,15 @@ @@ -8206,7 +8224,7 @@ index ce5c423..5526931 100644 diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index 547d214..92d05aa 100644 +index 57fddfd..57dec06 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -226,6 +226,11 @@ @@ -8251,10 +8269,10 @@ index 2fd8777..3b294cd 100644 { // XBMC Smart playlist - just XML renamed to XSP // read the name of the playlist in -From 3364a36b6a8dcc9671a288eefef44ad492887207 Mon Sep 17 00:00:00 2001 +From 1160ab085404320b446656c6b205debda2da9b70 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 11 Aug 2014 22:56:13 +0100 -Subject: [PATCH 46/82] [omxplayer] Add acceleration option to choose +Subject: [PATCH 046/104] [omxplayer] Add acceleration option to choose omxplayer/dvdplayer automatically --- @@ -8264,10 +8282,10 @@ Subject: [PATCH 46/82] [omxplayer] Add acceleration option to choose 3 files changed, 77 insertions(+) diff --git a/language/English/strings.po b/language/English/strings.po -index 0631393..38a2388 100755 +index 30b3566..73213b8 100755 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -15900,3 +15900,13 @@ msgstr "" +@@ -15915,3 +15915,13 @@ msgstr "" msgctxt "#37032" msgid "Allow viewing and playing files in archives (e.g. zip, rar)" msgstr "" @@ -8282,10 +8300,10 @@ index 0631393..38a2388 100755 +msgid "Uses codec information and audio setting to choose dvdplayer or omxplayer as appropriate" +msgstr "" diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index 92d05aa..16edb6f 100644 +index 57dec06..9a4cefb 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml -@@ -754,6 +754,15 @@ +@@ -751,6 +751,15 @@ true @@ -8378,10 +8396,10 @@ index c2654c3b..6547880 100644 // allow renderer to switch to fullscreen if requested m_dvdPlayerVideo->EnableFullscreen(m_PlayerOptions.fullscreen); -From 1306ab6444aef4543629b8ae4f7b665f841dc395 Mon Sep 17 00:00:00 2001 +From e9f29c552f27e4c69641a33fa501194b93cc8736 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 12 Aug 2014 16:51:18 +0100 -Subject: [PATCH 47/82] AE: Add some logging for suspend/resume +Subject: [PATCH 047/104] AE: Add some logging for suspend/resume --- xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 5 +++++ @@ -8389,10 +8407,10 @@ Subject: [PATCH 47/82] AE: Add some logging for suspend/resume 2 files changed, 7 insertions(+) diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -index de07de5..9d641c2 100644 +index 2d013c8..c825b4b 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -@@ -346,6 +346,7 @@ void CActiveAE::StateMachine(int signal, Protocol *port, Message *msg) +@@ -347,6 +347,7 @@ void CActiveAE::StateMachine(int signal, Protocol *port, Message *msg) switch (signal) { case CActiveAEControlProtocol::INIT: @@ -8400,7 +8418,7 @@ index de07de5..9d641c2 100644 m_extError = false; m_sink.EnumerateSinkList(false); LoadSettings(); -@@ -431,6 +432,7 @@ void CActiveAE::StateMachine(int signal, Protocol *port, Message *msg) +@@ -432,6 +433,7 @@ void CActiveAE::StateMachine(int signal, Protocol *port, Message *msg) m_extDeferData = true; return; case CActiveAEControlProtocol::SUSPEND: @@ -8408,7 +8426,7 @@ index de07de5..9d641c2 100644 UnconfigureSink(); m_stats.SetSuspended(true); m_state = AE_TOP_CONFIGURED_SUSPEND; -@@ -656,6 +658,7 @@ void CActiveAE::StateMachine(int signal, Protocol *port, Message *msg) +@@ -657,6 +659,7 @@ void CActiveAE::StateMachine(int signal, Protocol *port, Message *msg) CLog::Log(LOGDEBUG,"CActiveAE - display reset event"); displayReset = true; case CActiveAEControlProtocol::INIT: @@ -8416,7 +8434,7 @@ index de07de5..9d641c2 100644 m_extError = false; if (!displayReset) { -@@ -2333,12 +2336,14 @@ void CActiveAE::Shutdown() +@@ -2334,12 +2337,14 @@ void CActiveAE::Shutdown() bool CActiveAE::Suspend() { @@ -8452,11 +8470,11 @@ index 7e85441..a73dd0a 100644 } -From c1542bb7cf46439c56a471ac2c01ee3f5ffdc25c Mon Sep 17 00:00:00 2001 +From f630e36058272d201b7973e77d9418d19ff0f3aa Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 9 Jul 2014 22:45:43 +0100 -Subject: [PATCH 48/82] [rbp] Make cachemembuffersize default depend on memory - size +Subject: [PATCH 048/104] [rbp] Make cachemembuffersize default depend on + memory size --- xbmc/linux/RBP.cpp | 5 +++++ @@ -8511,10 +8529,10 @@ index 237e903..8e32a68 100644 // the following setting determines the readRate of a player data // as multiply of the default data read rate -From 26449067777a0df7389ff82ecc3410e2226b90d5 Mon Sep 17 00:00:00 2001 +From 374062d2bfe2a8850b4ec58d193d2e37db64c1c8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 16 Jun 2014 19:06:00 +0100 -Subject: [PATCH 50/82] [experimental] Disable quiet-noise generation +Subject: [PATCH 050/104] [experimental] Disable quiet-noise generation --- xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp | 2 ++ @@ -8541,10 +8559,10 @@ index 488a0df..d9f4a43 100644 void CActiveAESink::SetSilenceTimer() -From f778f20535652c690940cb59cea744f4396c94aa Mon Sep 17 00:00:00 2001 +From cce8c49bfaaf32a918c5f081dd4487089c525df1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 30 May 2014 14:58:43 +0100 -Subject: [PATCH 51/82] [settings] Experiment: Report DESKTOP resolution in +Subject: [PATCH 051/104] [settings] Experiment: Report DESKTOP resolution in video settings --- @@ -8552,10 +8570,10 @@ Subject: [PATCH 51/82] [settings] Experiment: Report DESKTOP resolution in 1 file changed, 3 insertions(+) diff --git a/xbmc/settings/DisplaySettings.cpp b/xbmc/settings/DisplaySettings.cpp -index e43445b..a5e4dc7 100644 +index 6902f83..50c5f97 100644 --- a/xbmc/settings/DisplaySettings.cpp +++ b/xbmc/settings/DisplaySettings.cpp -@@ -655,6 +655,9 @@ void CDisplaySettings::SettingOptionsResolutionsFiller(const CSetting *setting, +@@ -674,6 +674,9 @@ void CDisplaySettings::SettingOptionsResolutionsFiller(const CSetting *setting, vector resolutions = g_Windowing.ScreenResolutions(info.iScreen, info.fRefreshRate); for (vector::const_iterator resolution = resolutions.begin(); resolution != resolutions.end(); ++resolution) { @@ -8566,10 +8584,10 @@ index e43445b..a5e4dc7 100644 StringUtils::Format("%dx%d%s", resolution->width, resolution->height, ModeFlagsToString(resolution->flags, false).c_str()), -From 12748588e74711da5d596b1aff7177a030179ec3 Mon Sep 17 00:00:00 2001 +From c48fb57d3b3f702568d9bf52a3e6c76561317240 Mon Sep 17 00:00:00 2001 From: macrule Date: Thu, 11 Apr 2013 18:24:42 +0200 -Subject: [PATCH 52/82] Added some vc_tv_* functions that were missing in +Subject: [PATCH 052/104] Added some vc_tv_* functions that were missing in DllBCM. --- @@ -8604,10 +8622,10 @@ index b92fdb8..9c7e293 100644 HDMI_INTERLACED_T scan_mode, EDID_MODE_MATCH_FLAG_T match_flags) { return ::vc_tv_hdmi_power_on_best(width, height, frame_rate, scan_mode, match_flags); }; -From 470654ed88a0c1b4246d37ce1dec26d79a21b20a Mon Sep 17 00:00:00 2001 +From 2b0cf26e90dea818424ed6f8f71dcdf0258b7542 Mon Sep 17 00:00:00 2001 From: macrule Date: Thu, 11 Apr 2013 18:29:03 +0200 -Subject: [PATCH 53/82] Added private utility function to map a float display +Subject: [PATCH 053/104] Added private utility function to map a float display aspect, to the respective SDTV_ASPECT_* enum value. --- @@ -8645,10 +8663,10 @@ index bf1e589..518a87d 100644 bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &resolutions) -From 9264b64ba64cfff82e23b119c41ac17446b5f638 Mon Sep 17 00:00:00 2001 +From 9f9c2344327e30a18c73b8f3f6cf5ab952964b66 Mon Sep 17 00:00:00 2001 From: macrule Date: Thu, 11 Apr 2013 19:50:58 +0200 -Subject: [PATCH 54/82] Changed SDTV resolutions to be treated similarly to +Subject: [PATCH 054/104] Changed SDTV resolutions to be treated similarly to HDMI resolutions in SetNativeResolution. This means that the SDTV interface is powered up and set to the right mode. @@ -8745,10 +8763,10 @@ index 59401f5..a0acb1a 100644 int m_width; int m_height; -From 9738a4a5e0d4f25af9c06a7e47a67908c7115908 Mon Sep 17 00:00:00 2001 +From f1136389343982869ed389bf12536ee44b1effa0 Mon Sep 17 00:00:00 2001 From: macrule Date: Thu, 11 Apr 2013 19:54:59 +0200 -Subject: [PATCH 55/82] Added methods SuspendVideoOutput() and +Subject: [PATCH 055/104] Added methods SuspendVideoOutput() and ResumeVideoOutput() to CRBP class, which can be used to power down the Raspberry PI's video interface, and restore it at a later point. @@ -8812,12 +8830,12 @@ index 9dc39d5..ca36082 100644 CEGLNativeTypeRaspberryPI::CEGLNativeTypeRaspberryPI() { -From 252fa0c4408bd8da64704f98b94c8e67736ae5e0 Mon Sep 17 00:00:00 2001 +From 0634c431adb611ee08deddc65aa5cadc11bc39a4 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 11 Aug 2013 15:03:36 +0100 -Subject: [PATCH 56/82] PowerManager (and its IPowerSyscall instance) now gets - called from CApplication::OnKey() and can process and suppress key presses. - This is a requirement to implement a virtual sleep state. +Subject: [PATCH 056/104] PowerManager (and its IPowerSyscall instance) now + gets called from CApplication::OnKey() and can process and suppress key + presses. This is a requirement to implement a virtual sleep state. --- xbmc/Application.cpp | 7 +++++++ @@ -8827,10 +8845,10 @@ Subject: [PATCH 56/82] PowerManager (and its IPowerSyscall instance) now gets 4 files changed, 23 insertions(+) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index 94ee013..e68c80f 100644 +index ead4b6a..376d8c4 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp -@@ -2358,6 +2358,13 @@ bool CApplication::OnKey(const CKey& key) +@@ -2320,6 +2320,13 @@ bool CApplication::OnKey(const CKey& key) // special handling if the screensaver is active CAction action = CButtonTranslator::GetInstance().GetAction(iWin, key); @@ -8908,12 +8926,12 @@ index 0b1f10a..e42b143 100644 void OnSleep(); void OnWake(); -From 689876eb5e09acbf35ad547c4ec5d6874d5965b3 Mon Sep 17 00:00:00 2001 +From 0ca4dcca30ca3827416a68c952439d3452f1b933 Mon Sep 17 00:00:00 2001 From: macrule Date: Wed, 17 Apr 2013 13:23:01 +0200 -Subject: [PATCH 57/82] Added CPowerSyscallVirtualSleep class, which acts as a - base class for devices that have no native standby mode, and need to fake it - in some way. +Subject: [PATCH 057/104] Added CPowerSyscallVirtualSleep class, which acts as + a base class for devices that have no native standby mode, and need to fake + it in some way. --- xbmc/powermanagement/Makefile | 1 + @@ -9087,10 +9105,10 @@ index 0000000..ef6e682 + +#endif // _POWER_SYSCALL_VIRTUAL_SLEEP_H_ -From 7806d8ddcb8c92ae69af9021305969c0c17b4fe7 Mon Sep 17 00:00:00 2001 +From 9d6b4966e1c3f5903ddc8b01e73781bf6f8c7989 Mon Sep 17 00:00:00 2001 From: macrule Date: Wed, 17 Apr 2013 13:24:22 +0200 -Subject: [PATCH 58/82] Added power management support for the Raspberry Pi. +Subject: [PATCH 058/104] Added power management support for the Raspberry Pi. Since it doesn't support true standby, we fake it by turning video on or off, and ignoring remote inputs during the standby phase. @@ -9236,10 +9254,10 @@ index 0000000..fd1d67c + +#endif // _RASPBERRY_PI_POWER_SYSCALL_H_ -From 0b1c63d165e31f4509e2eb87df682f946699df3b Mon Sep 17 00:00:00 2001 +From b4ee4ae439c0436e7d25628cd21a7c17762b186b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Mar 2014 16:16:29 +0000 -Subject: [PATCH 59/82] [power] hack - don't kill lirc or cec +Subject: [PATCH 059/104] [power] hack - don't kill lirc or cec --- xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 37 +++++++++++++++++++++++ @@ -9323,10 +9341,10 @@ index 2d8c750..901f449 100644 CBuiltins::Execute("LIRC.Start"); #endif -From 0a80339f64e206cd1364a58e203958aeb649b9d1 Mon Sep 17 00:00:00 2001 +From 2b99e9a0b3ccdc73f958db6cfbf8090f73a83caa Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Mar 2014 16:47:54 +0000 -Subject: [PATCH 60/82] [power] hack - wake on any action +Subject: [PATCH 060/104] [power] hack - wake on any action --- xbmc/powermanagement/PowerSyscallVirtualSleep.cpp | 6 +++--- @@ -9355,10 +9373,10 @@ index 6a1e47b..a717a09 100644 if(VirtualWake()) { -From a9df2c2944c5131c82567b46de2c0364cee1e215 Mon Sep 17 00:00:00 2001 +From 8a90a0c4bedb99f9fc182f975375203d8bfeb739 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Mar 2014 17:30:07 +0000 -Subject: [PATCH 61/82] [power] hack - Make suspend toggle suspend state +Subject: [PATCH 061/104] [power] hack - Make suspend toggle suspend state --- xbmc/powermanagement/PowerSyscallVirtualSleep.cpp | 5 +++++ @@ -9381,10 +9399,10 @@ index a717a09..d39c3ed 100644 return false; } -From 91c03000f2cd251aecdae4263b01403308e37976 Mon Sep 17 00:00:00 2001 +From a2f53cd773498d06e8ab7adb45d6c7b12cd3413f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 4 Mar 2014 19:33:44 +0000 -Subject: [PATCH 62/82] [power] Add back in powerdown and reboot +Subject: [PATCH 062/104] [power] Add back in powerdown and reboot --- .../linux/RaspberryPIPowerSyscall.cpp | 34 ++++++++++++++++++++++ @@ -9462,11 +9480,11 @@ index fd1d67c..062132e 100644 virtual bool CanReboot() { return true; } -From 665b6d3e2bab90895727c4ff62856fbe120da426 Mon Sep 17 00:00:00 2001 +From 65fd6d6f82e7221d4dda92568111cfbe4395d52d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 26 Apr 2014 17:27:52 +0100 -Subject: [PATCH 67/82] [cec] Don't suspend pi on tv switch off - it can't wake - up +Subject: [PATCH 067/104] [cec] Don't suspend pi on tv switch off - it can't + wake up --- system/peripherals.xml | 2 +- @@ -9486,10 +9504,10 @@ index a906628..9b5271a 100644 -From ef14f6b4fa9be071c4989e3f8668f39249ed29c2 Mon Sep 17 00:00:00 2001 +From 6a0b086eb8b731b16f96715dd83e70778492f1f0 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 18 Aug 2014 19:09:32 +0100 -Subject: [PATCH 68/82] rbp: Use new dispmanx function for vsync callbacks +Subject: [PATCH 068/104] rbp: Use new dispmanx function for vsync callbacks --- xbmc/linux/RBP.cpp | 85 ++++++++++++++----------- @@ -9701,10 +9719,10 @@ index ca36082..4b74ea0 100644 } DLOG("CEGLNativeTypeRaspberryPI::DestroyDispmaxWindow\n"); -From ed6cb3734548b385c04f753bdd06b37fbada90f5 Mon Sep 17 00:00:00 2001 +From 3843e14de62575738037c33713766e44937e388b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 19 Aug 2014 17:56:45 +0100 -Subject: [PATCH 69/82] Revert "rbp: Use new dispmanx function for vsync +Subject: [PATCH 069/104] Revert "rbp: Use new dispmanx function for vsync callbacks" This reverts commit afbf8fbceaa6649fb4a6bbd9a1cee6087590412b. @@ -9918,10 +9936,10 @@ index 4b74ea0..ca36082 100644 } DLOG("CEGLNativeTypeRaspberryPI::DestroyDispmaxWindow\n"); -From 5d99df1b9669fc9990a0f8e95fd78e60fbbdc46e Mon Sep 17 00:00:00 2001 +From ba4e721c97a87b3b7cadbb492b8b5fea3af6348c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 27 Jun 2014 00:01:05 +0100 -Subject: [PATCH 70/82] [rbp] Resume video output on startup +Subject: [PATCH 070/104] [rbp] Resume video output on startup --- xbmc/linux/RBP.cpp | 3 +++ @@ -9942,10 +9960,10 @@ index 2ff6078..34e0108 100644 m_omx_image_init = true; return true; -From 66c86059637ce3a9606ffac2fad84984987db1c6 Mon Sep 17 00:00:00 2001 +From afab9b008a0541d7d1c2ff625add58e20ad2a39c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 16 Aug 2014 21:01:42 +0100 -Subject: [PATCH 71/82] omxrender: Hacks to reduce GUI rendering rate when +Subject: [PATCH 071/104] omxrender: Hacks to reduce GUI rendering rate when playing video --- @@ -9955,10 +9973,10 @@ Subject: [PATCH 71/82] omxrender: Hacks to reduce GUI rendering rate when 3 files changed, 60 insertions(+) diff --git a/language/English/strings.po b/language/English/strings.po -index 38a2388..8252473 100755 +index 73213b8..ef3022b 100755 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -15910,3 +15910,30 @@ msgstr "" +@@ -15925,3 +15925,30 @@ msgstr "" msgctxt "#37034" msgid "Uses codec information and audio setting to choose dvdplayer or omxplayer as appropriate" msgstr "" @@ -9990,10 +10008,10 @@ index 38a2388..8252473 100755 +msgid "24 fps" +msgstr "" diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml -index 5526931..634aa4f 100644 +index 49706c0..649e8fe 100644 --- a/system/settings/rbp.xml +++ b/system/settings/rbp.xml -@@ -28,6 +28,22 @@ +@@ -25,6 +25,22 @@ @@ -10017,10 +10035,10 @@ index 5526931..634aa4f 100644 diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index e68c80f..6a280d5 100644 +index 376d8c4..06ff301 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp -@@ -2206,6 +2206,23 @@ void CApplication::Render() +@@ -2168,6 +2168,23 @@ void CApplication::Render() if (m_bStop) return; @@ -10045,10 +10063,11 @@ index e68c80f..6a280d5 100644 int vsync_mode = CSettings::Get().GetInt("videoscreen.vsync"); -From b48a641ca4c6e99bcd9de75e18bcda0af663229e Mon Sep 17 00:00:00 2001 +From f6a9fe90c39b28de9ed2d3278d8506efd30bab10 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 9 Sep 2014 12:04:26 +0100 -Subject: [PATCH 72/82] egl: Treat unknown display aspect ratio as square pixel +Subject: [PATCH 072/104] egl: Treat unknown display aspect ratio as square + pixel --- xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 4 ++-- @@ -10077,10 +10096,10 @@ index ca36082..1529045 100644 SetResolutionString(m_desktopRes); -From 009c3343c69e5565dcfb43095c42a5083651ae8b Mon Sep 17 00:00:00 2001 +From 6f9fb5c6beeb827e20d8e26888287f2900ac0a37 Mon Sep 17 00:00:00 2001 From: anaconda Date: Thu, 11 Sep 2014 21:30:43 +0200 -Subject: [PATCH 73/82] Disable textbox autoscrolling while on screensaver. +Subject: [PATCH 073/104] Disable textbox autoscrolling while on screensaver. --- xbmc/guilib/GUITextBox.cpp | 3 ++- @@ -10108,10 +10127,10 @@ index b7ef051..ba68fad 100644 if (m_lastRenderTime) m_autoScrollDelayTime += currentTime - m_lastRenderTime; -From 1f2171c506c343ad66989bad5e159274fad10b64 Mon Sep 17 00:00:00 2001 +From dd4c199e7930d4ee3bf4f4da1076129a0335e194 Mon Sep 17 00:00:00 2001 From: anaconda Date: Sat, 13 Sep 2014 19:49:01 +0200 -Subject: [PATCH 74/82] SQUASH: only if dim or black +Subject: [PATCH 074/104] SQUASH: only if dim or black --- xbmc/Application.cpp | 7 +++++++ @@ -10120,10 +10139,10 @@ Subject: [PATCH 74/82] SQUASH: only if dim or black 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index 6a280d5..ab6e1be 100644 +index 06ff301..e044be2 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp -@@ -5881,3 +5881,10 @@ void CApplication::CloseNetworkShares() +@@ -5802,3 +5802,10 @@ void CApplication::CloseNetworkShares() CSFTPSessionManager::DisconnectAllSessions(); #endif } @@ -10163,34 +10182,10 @@ index ba68fad..e149418 100644 if (m_lastRenderTime) m_autoScrollDelayTime += currentTime - m_lastRenderTime; -From ea6435d09d8ecb64a134a4fd4c18b10852369702 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Mon, 15 Sep 2014 14:37:09 +0100 -Subject: [PATCH 75/82] mmal: squash: UnInit before second configuration - ---- - xbmc/cores/VideoRenderers/MMALRenderer.cpp | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -index 9a81eb9..2c97806 100644 ---- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp -+++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp -@@ -250,7 +250,8 @@ bool CMMALRenderer::Configure(unsigned int width, unsigned int height, unsigned - else if (CONF_FLAGS_YUVCOEF_MASK(m_iFlags) == CONF_FLAGS_YUVCOEF_240M) - es_format->es->video.color_space = MMAL_COLOR_SPACE_SMPTE240M; - } -- assert(!m_vout); -+ if (m_bConfigured) -+ UnInit(); - m_bConfigured = init_vout(es_format); - mmal_format_free(es_format); - } - -From bf7f64c23fe73b21649fdceac8c073544ebf74cf Mon Sep 17 00:00:00 2001 +From e44208133fa914e8ef20efb039aceab7bdc1c2b1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 16 Sep 2014 00:52:02 +0100 -Subject: [PATCH 76/82] [PiSink] Initial dual audio support +Subject: [PATCH 075/104] [PiSink] Initial dual audio support --- system/settings/rbp.xml | 7 - @@ -10200,10 +10195,10 @@ Subject: [PATCH 76/82] [PiSink] Initial dual audio support 4 files changed, 186 insertions(+), 57 deletions(-) diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml -index 634aa4f..7f0f282 100644 +index 649e8fe..d4760df 100644 --- a/system/settings/rbp.xml +++ b/system/settings/rbp.xml -@@ -82,13 +82,6 @@ +@@ -79,13 +79,6 @@ @@ -10599,10 +10594,10 @@ index a73dd0a..13899bc 100644 // force out layout to stereo if input is not multichannel - it gives the receiver a chance to upmix -From 94d5b9f2afaec3011abbd702593c14a7863a8aee Mon Sep 17 00:00:00 2001 +From 98779eb1e8d399ea2266507985a9bdad7fc5881e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 18 Sep 2014 14:24:56 +0100 -Subject: [PATCH 77/82] [omxplayer] Only enable audio clock master when A/V +Subject: [PATCH 076/104] [omxplayer] Only enable audio clock master when A/V sync method is set to audio clock --- @@ -10633,104 +10628,10 @@ index 13899bc..3c6c73b 100644 OMX_CONFIG_BOOLEANTYPE configBool; OMX_INIT_STRUCTURE(configBool); -From 6593033f28587e9fb14e4a3339c4f44c1f72d50d Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 18 Sep 2014 19:59:42 +0100 -Subject: [PATCH 78/82] [mmal] Avoid busy spinning when no work to do - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 19 +++++++++++++++---- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 1 + - 2 files changed, 16 insertions(+), 4 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index 00f174a..7326104 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -133,6 +133,7 @@ CMMALVideo::CMMALVideo() - m_changed_count = 0; - m_changed_count_dec = 0; - m_output_busy = 0; -+ m_demux_queue_length = 0; - m_es_format = mmal_format_alloc(); - } - -@@ -768,6 +769,7 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - demux_packet.size = iSize; - demux_packet.buff = new uint8_t[iSize]; - memcpy(demux_packet.buff, pData, iSize); -+ m_demux_queue_length += demux_packet.size; - m_demux_queue.push(demux_packet); - } - -@@ -785,6 +787,7 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - if (space >= (unsigned int)demux_packet.size) - { - // need to lock here to retrieve an input buffer and pop the queue -+ m_demux_queue_length -= demux_packet.size; - m_demux_queue.pop(); - demuxer_bytes = (unsigned int)demux_packet.size; - demuxer_content = demux_packet.buff; -@@ -824,9 +827,10 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - buffer->flags |= MMAL_BUFFER_HEADER_FLAG_FRAME_END; - - #if defined(MMAL_DEBUG_VERBOSE) -- CLog::Log(LOGDEBUG, "%s::%s - %-8p %-6d/%-6d dts:%.3f pts:%.3f flags:%x dts_queue(%d) ready_queue(%d) busy_queue(%d)", -- CLASSNAME, __func__, buffer, iSize-demuxer_bytes, iSize, dts == DVD_NOPTS_VALUE ? 0.0 : dts*1e-6, pts == DVD_NOPTS_VALUE ? 0.0 : pts*1e-6, buffer->flags, m_dts_queue.size(), m_output_ready.size(), m_output_busy); -+ CLog::Log(LOGDEBUG, "%s::%s - %-8p %-6d/%-6d dts:%.3f pts:%.3f flags:%x dts_queue(%d) ready_queue(%d) busy_queue(%d) demux_queue(%d) space(%d)", -+ CLASSNAME, __func__, buffer, buffer->length, demuxer_bytes, dts == DVD_NOPTS_VALUE ? 0.0 : dts*1e-6, pts == DVD_NOPTS_VALUE ? 0.0 : pts*1e-6, buffer->flags, m_dts_queue.size(), m_output_ready.size(), m_output_busy, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size); - #endif -+ assert((int)buffer->length > 0); - status = mmal_port_send_buffer(m_dec_input, buffer); - if (status != MMAL_SUCCESS) - { -@@ -898,13 +902,19 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - #endif - ret |= VC_PICTURE; - } -- if (mmal_queue_length(m_dec_input_pool->queue) > 0) -+ if (mmal_queue_length(m_dec_input_pool->queue) > 0 && !m_demux_queue_length) - { - #if defined(MMAL_DEBUG_VERBOSE) -- CLog::Log(LOGDEBUG, "%s::%s - got space for output:%d", CLASSNAME, __func__, mmal_queue_length(m_dec_input_pool->queue)); -+ CLog::Log(LOGDEBUG, "%s::%s - got space for output: demux_queue(%d) space(%d)", CLASSNAME, __func__, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size); - #endif - ret |= VC_BUFFER; - } -+ if (!ret) -+ { -+ CLog::Log(LOGDEBUG, "%s::%s - Nothing to do: dts_queue(%d) ready_queue(%d) busy_queue(%d) demux_queue(%d) space(%d)", -+ CLASSNAME, __func__, m_dts_queue.size(), m_output_ready.size(), m_output_busy, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size); -+ Sleep(10); // otherwise we busy spin -+ } - return ret; - } - -@@ -935,6 +945,7 @@ void CMMALVideo::Reset(void) - m_dts_queue.pop(); - while (!m_demux_queue.empty()) - m_demux_queue.pop(); -+ m_demux_queue_length = 0; - pthread_mutex_unlock(&m_output_mutex); - if (!old_drop_state) - SetDropState(false); -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -index 4b98be2..982ee14 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -119,6 +119,7 @@ class CMMALVideo - - std::queue m_dts_queue; - std::queue m_demux_queue; -+ unsigned m_demux_queue_length; - - // mmal output buffers (video frames) - pthread_mutex_t m_output_mutex; - -From 071f3ac540ad4927f85244fc75e02ce8d0aad5a6 Mon Sep 17 00:00:00 2001 +From 74eb025ec90c425b0b4bbbd7571aa97dd92b1bea Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 18 Aug 2014 19:09:32 +0100 -Subject: [PATCH 79/82] rbp: Use new dispmanx function for vsync callbacks +Subject: [PATCH 077/104] rbp: Use new dispmanx function for vsync callbacks [rbp] Enable vsync handler all the time --- @@ -10963,10 +10864,10 @@ index 1529045..b6bf1fc 100644 } DLOG("CEGLNativeTypeRaspberryPI::DestroyDispmaxWindow\n"); -From 8ae76ca01163bf9552ece9552dc3d546a5fe1894 Mon Sep 17 00:00:00 2001 +From 53a24c9ccefaf5920c4802ef5d19c3ed3477bf75 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 18 Sep 2014 23:14:31 +0100 -Subject: [PATCH 80/82] Revert "rbp: Use new dispmanx function for vsync +Subject: [PATCH 078/104] Revert "rbp: Use new dispmanx function for vsync callbacks" This reverts commit e56163da23b6a844e7eee076e4583bce606f788b. @@ -11200,10 +11101,10 @@ index b6bf1fc..1529045 100644 } DLOG("CEGLNativeTypeRaspberryPI::DestroyDispmaxWindow\n"); -From 2995a6a3e837c80990dfb779099cbb262b5fe505 Mon Sep 17 00:00:00 2001 +From bf63f0d814ac60141fff0e1bc207b60e40d66c86 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 19 Sep 2014 11:54:49 +0100 -Subject: [PATCH 81/82] [dvdplayer/rbp] Add pi specific option to maintain +Subject: [PATCH 079/104] [dvdplayer/rbp] Add pi specific option to maintain vsync with pll adjustment New A/V sync option in settings/video/playback to do "Adjust PLL". @@ -11222,10 +11123,10 @@ Needed updated firmware 7 files changed, 74 insertions(+), 3 deletions(-) diff --git a/language/English/strings.po b/language/English/strings.po -index 8252473..0e64c2a 100755 +index ef3022b..63f969a 100755 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -15937,3 +15937,8 @@ msgstr "" +@@ -15952,3 +15952,8 @@ msgstr "" msgctxt "#38005" msgid "24 fps" msgstr "" @@ -11235,7 +11136,7 @@ index 8252473..0e64c2a 100755 +msgid "Adjust PLL" +msgstr "" diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml -index 7f0f282..61b105d 100644 +index d4760df..bc8ebc9 100644 --- a/system/settings/rbp.xml +++ b/system/settings/rbp.xml @@ -11,6 +11,26 @@ @@ -11399,10 +11300,10 @@ index f947acc..606c24f 100644 void SuspendVideoOutput(); void ResumeVideoOutput(); -From 750cc5eba141ad091b036a57682d67076cbefa90 Mon Sep 17 00:00:00 2001 +From a414cbab2ea8706e936e6ea1d62a1df61e3d4930 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 21 Sep 2014 18:31:31 +0100 -Subject: [PATCH 82/82] hack: revert squash: don't update originaldts when +Subject: [PATCH 080/104] hack: revert squash: don't update originaldts when marked as invalid --- @@ -11421,3 +11322,1886 @@ index 6547880..32374d4 100644 } } else + +From 94e00aa1aeb369306a4d95ef59fbf4b0d54e6d9c Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 24 Sep 2014 23:13:52 +0100 +Subject: [PATCH 081/104] [audio] Add settings option to boost centre channel + when downmixing + +This allows a dB volume increase to be added to centre channel. +This can help improve dialgue in the presence of background music/effects. +It can go up to 30dB for testing purposes, but value of 6 is probably more reasonable. +It is recommended to ensure "Normalise levels on downmix" is enabled when boosting by large values to avoid clipping. + +Should work with Pi Sink (dvdplayer/paplayer) and omxplayer +--- + language/English/strings.po | 15 +++++++++++++++ + system/settings/settings.xml | 12 ++++++++++++ + .../AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp | 6 ++++++ + .../AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp | 6 ++++++ + xbmc/cores/omxplayer/OMXAudio.cpp | 6 ++++++ + 5 files changed, 45 insertions(+) + +diff --git a/language/English/strings.po b/language/English/strings.po +index 63f969a..b58a405 100755 +--- a/language/English/strings.po ++++ b/language/English/strings.po +@@ -15957,3 +15957,18 @@ msgstr "" + msgctxt "#38006" + msgid "Adjust PLL" + msgstr "" ++ ++#: system/settings/settings.xml ++msgctxt "#38007" ++msgid "Boost centre channel when downmixing" ++msgstr "" ++ ++#: system/settings/settings.xml ++msgctxt "#38008" ++msgid "Increase this value to make the dialogue louder compared to background sounds when downmixing multichannel audio" ++msgstr "" ++ ++#: system/settings/settings.xml ++msgctxt "#38009" ++msgid "%i dB" ++msgstr "" +diff --git a/system/settings/settings.xml b/system/settings/settings.xml +index 9a4cefb..5c29ce3 100644 +--- a/system/settings/settings.xml ++++ b/system/settings/settings.xml +@@ -2435,6 +2435,18 @@ + true + + ++ ++ 2 ++ 0 ++ ++ 0 ++ 1 ++ 30 ++ ++ ++ 38009 ++ ++ + + HAS_AE_QUALITY_LEVELS + 2 +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp +index 99cd607..a9a03ce 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp +@@ -108,6 +108,12 @@ bool CActiveAEResample::Init(uint64_t dst_chan_layout, int dst_channels, int dst + { + av_opt_set_double(m_pContext, "rematrix_maxval", 1.0, 0); + } ++ int boost_center = CSettings::Get().GetInt("audiooutput.boostcenter"); ++ if (boost_center) ++ { ++ float gain = pow(10.0f, ((float)(-3 + boost_center))/20.0f); ++ av_opt_set_double(m_pContext, "center_mix_level", gain, 0); ++ } + + if (remapLayout) + { +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp +index cc01738..a05ef3a 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp +@@ -158,6 +158,12 @@ bool CActiveAEResample::Init(uint64_t dst_chan_layout, int dst_channels, int dst + { + av_opt_set_double(m_pContext, "rematrix_maxval", 1.0, 0); + } ++ int boost_center = CSettings::Get().GetInt("audiooutput.boostcenter"); ++ if (boost_center) ++ { ++ float gain = pow(10.0f, ((float)(-3 + boost_center))/20.0f); ++ av_opt_set_double(m_pContext, "center_mix_level", gain, 0); ++ } + + if (remapLayout) + { +diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp +index 3c6c73b..2b7a83a 100644 +--- a/xbmc/cores/omxplayer/OMXAudio.cpp ++++ b/xbmc/cores/omxplayer/OMXAudio.cpp +@@ -639,6 +639,12 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo + { + av_opt_set_double(m_pContext, "rematrix_maxval", 1.0, 0); + } ++ int boost_center = CSettings::Get().GetInt("audiooutput.boostcenter"); ++ if (boost_center) ++ { ++ float gain = pow(10.0f, ((float)(-3 + boost_center))/20.0f); ++ av_opt_set_double(m_pContext, "center_mix_level", gain, 0); ++ } + + // stereo upmix + if (upmix && m_src_channels == 2 && m_dst_channels > 2) + +From de2e291694f5150a745d093561f08391d9561d5e Mon Sep 17 00:00:00 2001 +From: xhaggi +Date: Wed, 24 Sep 2014 17:30:32 +0200 +Subject: [PATCH 091/104] fix wrong printf format mismatches + +--- + xbmc/GUIInfoManager.cpp | 4 +- + xbmc/cdrip/CDDARipJob.cpp | 2 +- + xbmc/cores/FFmpeg.cpp | 2 +- + xbmc/cores/dvdplayer/Edl.cpp | 2 +- + xbmc/filesystem/VideoDatabaseDirectory.cpp | 2 +- + xbmc/guilib/TextureManager.cpp | 4 +- + xbmc/interfaces/json-rpc/AudioLibrary.cpp | 4 +- + .../interfaces/json-rpc/JSONServiceDescription.cpp | 4 +- + xbmc/interfaces/json-rpc/VideoLibrary.cpp | 2 +- + xbmc/music/MusicDatabase.cpp | 12 ++-- + xbmc/music/windows/GUIWindowMusicBase.cpp | 2 +- + xbmc/music/windows/GUIWindowMusicNav.cpp | 6 +- + xbmc/network/DNSNameCache.cpp | 2 +- + xbmc/network/upnp/UPnPRenderer.cpp | 4 +- + xbmc/network/upnp/UPnPServer.cpp | 12 ++-- + xbmc/peripherals/devices/Peripheral.cpp | 14 +++-- + xbmc/playlists/PlayListB4S.cpp | 2 +- + xbmc/playlists/PlayListPLS.cpp | 2 +- + xbmc/playlists/SmartPlayList.cpp | 2 +- + xbmc/profiles/ProfilesManager.cpp | 2 +- + xbmc/pvr/PVRGUIInfo.cpp | 4 +- + xbmc/pvr/PVRManager.cpp | 2 +- + xbmc/pvr/channels/PVRChannelGroups.cpp | 6 +- + xbmc/utils/Fanart.cpp | 2 +- + xbmc/utils/GroupUtils.cpp | 2 +- + xbmc/utils/LabelFormatter.cpp | 2 +- + xbmc/utils/RecentlyAddedJob.cpp | 4 +- + xbmc/utils/ScraperParser.cpp | 2 +- + xbmc/utils/SortUtils.cpp | 6 +- + xbmc/video/VideoDatabase.cpp | 66 +++++++++++----------- + xbmc/video/dialogs/GUIDialogVideoBookmarks.cpp | 2 +- + xbmc/video/dialogs/GUIDialogVideoInfo.cpp | 2 +- + xbmc/video/windows/GUIWindowVideoNav.cpp | 4 +- + xbmc/windows/GUIMediaWindow.cpp | 2 +- + 34 files changed, 99 insertions(+), 93 deletions(-) + +diff --git a/xbmc/GUIInfoManager.cpp b/xbmc/GUIInfoManager.cpp +index ab243b5..dcb31e7 100644 +--- a/xbmc/GUIInfoManager.cpp ++++ b/xbmc/GUIInfoManager.cpp +@@ -1905,7 +1905,7 @@ CStdString CGUIInfoManager::GetLabel(int info, int contextWindow, std::string *f + strLabel = CProfilesManager::Get().GetCurrentProfile().getName(); + break; + case SYSTEM_PROFILECOUNT: +- strLabel = StringUtils::Format("%i", CProfilesManager::Get().GetNumberOfProfiles()); ++ strLabel = StringUtils::Format("%" PRIuS, CProfilesManager::Get().GetNumberOfProfiles()); + break; + case SYSTEM_PROFILEAUTOLOGIN: + { +@@ -5163,7 +5163,7 @@ CStdString CGUIInfoManager::GetItemImage(const CFileItem *item, int info, std::s + CStdString rating; + if (item->HasVideoInfoTag()) + { // rating for videos is assumed 0..10, so convert to 0..5 +- rating = StringUtils::Format("rating%d.png", (long)((item->GetVideoInfoTag()->m_fRating * 0.5f) + 0.5f)); ++ rating = StringUtils::Format("rating%ld.png", (long)((item->GetVideoInfoTag()->m_fRating * 0.5f) + 0.5f)); + } + else if (item->HasMusicInfoTag()) + { // song rating. +diff --git a/xbmc/cdrip/CDDARipJob.cpp b/xbmc/cdrip/CDDARipJob.cpp +index bbacedb..87798ce 100644 +--- a/xbmc/cdrip/CDDARipJob.cpp ++++ b/xbmc/cdrip/CDDARipJob.cpp +@@ -201,7 +201,7 @@ CEncoder* CCDDARipJob::SetupEncoder(CFile& reader) + return NULL; + + // we have to set the tags before we init the Encoder +- std::string strTrack = StringUtils::Format("%i", strtol(m_input.substr(13, m_input.size() - 13 - 5).c_str(),NULL,10)); ++ std::string strTrack = StringUtils::Format("%li", strtol(m_input.substr(13, m_input.size() - 13 - 5).c_str(),NULL,10)); + + encoder->SetComment("Ripped with XBMC"); + encoder->SetArtist(StringUtils::Join(m_tag.GetArtist(), +diff --git a/xbmc/cores/FFmpeg.cpp b/xbmc/cores/FFmpeg.cpp +index 7e72df1..305966b 100644 +--- a/xbmc/cores/FFmpeg.cpp ++++ b/xbmc/cores/FFmpeg.cpp +@@ -103,7 +103,7 @@ void ff_avutil_log(void* ptr, int level, const char* format, va_list va) + } + + std::string message = StringUtils::FormatV(format, va); +- std::string prefix = StringUtils::Format("ffmpeg[%X]: ", threadId); ++ std::string prefix = StringUtils::Format("ffmpeg[%lX]: ", threadId); + if(avc) + { + if(avc->item_name) +diff --git a/xbmc/cores/dvdplayer/Edl.cpp b/xbmc/cores/dvdplayer/Edl.cpp +index 958d22f..0797c08 100644 +--- a/xbmc/cores/dvdplayer/Edl.cpp ++++ b/xbmc/cores/dvdplayer/Edl.cpp +@@ -846,7 +846,7 @@ std::string CEdl::GetInfo() const + strInfo += StringUtils::Format("b%i", commBreakCount); + } + if (HasSceneMarker()) +- strInfo += StringUtils::Format("s%i", m_vecSceneMarkers.size()); ++ strInfo += StringUtils::Format("s%" PRIuS, m_vecSceneMarkers.size()); + + return strInfo.empty() ? "-" : strInfo; + } +diff --git a/xbmc/filesystem/VideoDatabaseDirectory.cpp b/xbmc/filesystem/VideoDatabaseDirectory.cpp +index 5eae9ee..fb65f60 100644 +--- a/xbmc/filesystem/VideoDatabaseDirectory.cpp ++++ b/xbmc/filesystem/VideoDatabaseDirectory.cpp +@@ -174,7 +174,7 @@ bool CVideoDatabaseDirectory::GetLabel(const std::string& strDirectory, std::str + // get year + if (params.GetYear() != -1) + { +- std::string strTemp = StringUtils::Format("%i",params.GetYear()); ++ std::string strTemp = StringUtils::Format("%li",params.GetYear()); + if (!strLabel.empty()) + strLabel += " / "; + strLabel += strTemp; +diff --git a/xbmc/guilib/TextureManager.cpp b/xbmc/guilib/TextureManager.cpp +index fbe42db..f295674 100644 +--- a/xbmc/guilib/TextureManager.cpp ++++ b/xbmc/guilib/TextureManager.cpp +@@ -178,7 +178,7 @@ void CTextureMap::Dump() const + if (!m_referenceCount) + return; // nothing to see here + +- CLog::Log(LOGDEBUG, "%s: texture:%s has %i frames %i refcount", __FUNCTION__, m_textureName.c_str(), m_texture.m_textures.size(), m_referenceCount); ++ CLog::Log(LOGDEBUG, "%s: texture:%s has %" PRIuS" frames %i refcount", __FUNCTION__, m_textureName.c_str(), m_texture.m_textures.size(), m_referenceCount); + } + + unsigned int CTextureMap::GetMemoryUsage() const +@@ -510,7 +510,7 @@ void CGUITextureManager::Cleanup() + + void CGUITextureManager::Dump() const + { +- CLog::Log(LOGDEBUG, "%s: total texturemaps size:%i", __FUNCTION__, m_vecTextures.size()); ++ CLog::Log(LOGDEBUG, "%s: total texturemaps size:%" PRIuS, __FUNCTION__, m_vecTextures.size()); + + for (int i = 0; i < (int)m_vecTextures.size(); ++i) + { +diff --git a/xbmc/interfaces/json-rpc/AudioLibrary.cpp b/xbmc/interfaces/json-rpc/AudioLibrary.cpp +index bd87624..b3bc8b6 100644 +--- a/xbmc/interfaces/json-rpc/AudioLibrary.cpp ++++ b/xbmc/interfaces/json-rpc/AudioLibrary.cpp +@@ -287,7 +287,7 @@ JSONRPC_STATUS CAudioLibrary::GetRecentlyAddedAlbums(const std::string &method, + CFileItemList items; + for (unsigned int index = 0; index < albums.size(); index++) + { +- std::string path = StringUtils::Format("musicdb://recentlyaddedalbums/%i/", albums[index].idAlbum); ++ std::string path = StringUtils::Format("musicdb://recentlyaddedalbums/%li/", albums[index].idAlbum); + + CFileItemPtr item; + FillAlbumItem(albums[index], path, item); +@@ -337,7 +337,7 @@ JSONRPC_STATUS CAudioLibrary::GetRecentlyPlayedAlbums(const std::string &method, + CFileItemList items; + for (unsigned int index = 0; index < albums.size(); index++) + { +- std::string path = StringUtils::Format("musicdb://recentlyplayedalbums/%i/", albums[index].idAlbum); ++ std::string path = StringUtils::Format("musicdb://recentlyplayedalbums/%li/", albums[index].idAlbum); + + CFileItemPtr item; + FillAlbumItem(albums[index], path, item); +diff --git a/xbmc/interfaces/json-rpc/JSONServiceDescription.cpp b/xbmc/interfaces/json-rpc/JSONServiceDescription.cpp +index a5f1fee..ec889f3 100644 +--- a/xbmc/interfaces/json-rpc/JSONServiceDescription.cpp ++++ b/xbmc/interfaces/json-rpc/JSONServiceDescription.cpp +@@ -673,7 +673,7 @@ JSONRPC_STATUS JSONSchemaTypeDefinition::Check(const CVariant &value, CVariant & + if (status != OK) + { + CLog::Log(LOGDEBUG, "JSONRPC: Value does not match extended type %s of type %s", extends.at(extendsIndex)->ID.c_str(), name.c_str()); +- errorMessage = StringUtils::Format("value does not match extended type %s", extends.at(extendsIndex)->ID.c_str(), name.c_str()); ++ errorMessage = StringUtils::Format("value does not match extended type %s", extends.at(extendsIndex)->ID.c_str()); + errorData["message"] = errorMessage.c_str(); + return status; + } +@@ -735,7 +735,7 @@ JSONRPC_STATUS JSONSchemaTypeDefinition::Check(const CVariant &value, CVariant & + if (value.size() < items.size() || (value.size() != items.size() && additionalItems.size() == 0)) + { + CLog::Log(LOGDEBUG, "JSONRPC: One of the array elements does not match in type %s", name.c_str()); +- errorMessage = StringUtils::Format("%d array elements expected but %d received", items.size(), value.size()); ++ errorMessage = StringUtils::Format("%" PRIuS" array elements expected but %d received", items.size(), value.size()); + errorData["message"] = errorMessage.c_str(); + return InvalidParams; + } +diff --git a/xbmc/interfaces/json-rpc/VideoLibrary.cpp b/xbmc/interfaces/json-rpc/VideoLibrary.cpp +index 353cdff..cc6405f 100644 +--- a/xbmc/interfaces/json-rpc/VideoLibrary.cpp ++++ b/xbmc/interfaces/json-rpc/VideoLibrary.cpp +@@ -324,7 +324,7 @@ JSONRPC_STATUS CVideoLibrary::GetEpisodeDetails(const std::string &method, ITran + if (tvshowid <= 0) + tvshowid = videodatabase.GetTvShowForEpisode(id); + +- std::string basePath = StringUtils::Format("videodb://tvshows/titles/%ld/%ld/%ld", tvshowid, infos.m_iSeason, id); ++ std::string basePath = StringUtils::Format("videodb://tvshows/titles/%i/%i/%i", tvshowid, infos.m_iSeason, id); + pItem->SetPath(basePath); + + HandleFileItem("episodeid", true, "episodedetails", pItem, parameterObject, parameterObject["properties"], result, false); +diff --git a/xbmc/music/MusicDatabase.cpp b/xbmc/music/MusicDatabase.cpp +index 5f33943..3da8072 100644 +--- a/xbmc/music/MusicDatabase.cpp ++++ b/xbmc/music/MusicDatabase.cpp +@@ -1606,7 +1606,7 @@ void CMusicDatabase::GetFileItemFromDataset(const dbiplus::sql_record* const rec + CMusicDbUrl itemUrl = baseUrl; + CStdString strFileName = record->at(song_strFileName).get_asString(); + CStdString strExt = URIUtils::GetExtension(strFileName); +- CStdString path = StringUtils::Format("%ld%s", record->at(song_idSong).get_asInt(), strExt.c_str()); ++ CStdString path = StringUtils::Format("%i%s", record->at(song_idSong).get_asInt(), strExt.c_str()); + itemUrl.AppendPath(path); + item->SetPath(itemUrl.ToString()); + } +@@ -1804,7 +1804,7 @@ bool CMusicDatabase::SearchArtists(const CStdString& search, CFileItemList &arti + CStdString artistLabel(g_localizeStrings.Get(557)); // Artist + while (!m_pDS->eof()) + { +- CStdString path = StringUtils::Format("musicdb://artists/%ld/", m_pDS->fv(0).get_asInt()); ++ CStdString path = StringUtils::Format("musicdb://artists/%i/", m_pDS->fv(0).get_asInt()); + CFileItemPtr pItem(new CFileItem(path, true)); + CStdString label = StringUtils::Format("[%s] %s", artistLabel.c_str(), m_pDS->fv(1).get_asString().c_str()); + pItem->SetLabel(label); +@@ -2911,7 +2911,7 @@ bool CMusicDatabase::GetGenresNav(const CStdString& strBaseDir, CFileItemList& i + pItem->GetMusicInfoTag()->SetDatabaseId(m_pDS->fv("genre.idGenre").get_asInt(), "genre"); + + CMusicDbUrl itemUrl = musicUrl; +- CStdString strDir = StringUtils::Format("%ld/", m_pDS->fv("genre.idGenre").get_asInt()); ++ CStdString strDir = StringUtils::Format("%i/", m_pDS->fv("genre.idGenre").get_asInt()); + itemUrl.AppendPath(strDir); + pItem->SetPath(itemUrl.ToString()); + +@@ -2973,7 +2973,7 @@ bool CMusicDatabase::GetYearsNav(const CStdString& strBaseDir, CFileItemList& it + pItem->GetMusicInfoTag()->SetReleaseDate(stTime); + + CMusicDbUrl itemUrl = musicUrl; +- CStdString strDir = StringUtils::Format("%ld/", m_pDS->fv(0).get_asInt()); ++ CStdString strDir = StringUtils::Format("%i/", m_pDS->fv(0).get_asInt()); + itemUrl.AppendPath(strDir); + pItem->SetPath(itemUrl.ToString()); + +@@ -3397,7 +3397,7 @@ bool CMusicDatabase::GetAlbumsByWhere(const CStdString &baseDir, const Filter &f + try + { + CMusicDbUrl itemUrl = musicUrl; +- CStdString path = StringUtils::Format("%ld/", record->at(album_idAlbum).get_asInt()); ++ CStdString path = StringUtils::Format("%i/", record->at(album_idAlbum).get_asInt()); + itemUrl.AppendPath(path); + + CFileItemPtr pItem(new CFileItem(itemUrl.ToString(), GetAlbumFromDataset(record))); +@@ -5075,7 +5075,7 @@ void CMusicDatabase::ExportKaraokeInfo(const CStdString & outFile, bool asHTML) + while (!m_pDS->eof()) + { + CSong song = GetSongFromDataset(); +- CStdString songnum = StringUtils::Format("%06d", song.iKaraokeNumber); ++ CStdString songnum = StringUtils::Format("%06ld", song.iKaraokeNumber); + + if ( asHTML ) + outdoc = "" + songnum + "" + (CStdString)StringUtils::Join(song.artist, g_advancedSettings.m_musicItemSeparator) + "" + song.strTitle + "\r\n"; +diff --git a/xbmc/music/windows/GUIWindowMusicBase.cpp b/xbmc/music/windows/GUIWindowMusicBase.cpp +index b57998b..e31a859 100644 +--- a/xbmc/music/windows/GUIWindowMusicBase.cpp ++++ b/xbmc/music/windows/GUIWindowMusicBase.cpp +@@ -328,7 +328,7 @@ void CGUIWindowMusicBase::OnInfo(CFileItem *pItem, bool bShowInfo) + CAlbum album; + if (!m_musicdatabase.GetAlbum(albumID, album)) + return; +- CFileItem item(StringUtils::Format("musicdb://albums/%ld/", albumID), album); ++ CFileItem item(StringUtils::Format("musicdb://albums/%i/", albumID), album); + if (ShowAlbumInfo(&item)) + return; + } +diff --git a/xbmc/music/windows/GUIWindowMusicNav.cpp b/xbmc/music/windows/GUIWindowMusicNav.cpp +index 5333598..74d0d48 100644 +--- a/xbmc/music/windows/GUIWindowMusicNav.cpp ++++ b/xbmc/music/windows/GUIWindowMusicNav.cpp +@@ -652,7 +652,7 @@ bool CGUIWindowMusicNav::OnContextButton(int itemNumber, CONTEXT_BUTTON button) + CStdString strPath; + CVideoDatabase database; + database.Open(); +- strPath = StringUtils::Format("videodb://musicvideos/artists/%ld/", ++ strPath = StringUtils::Format("videodb://musicvideos/artists/%i/", + database.GetMatchingMusicVideo(StringUtils::Join(item->GetMusicInfoTag()->GetArtist(), g_advancedSettings.m_musicItemSeparator))); + g_windowManager.ActivateWindow(WINDOW_VIDEO_NAV,strPath); + return true; +@@ -696,10 +696,10 @@ bool CGUIWindowMusicNav::OnContextButton(int itemNumber, CONTEXT_BUTTON button) + CDirectoryNode::GetDatabaseInfo(item->GetPath(), params); + CONTENT_TYPE content = CONTENT_ALBUMS; + if (params.GetAlbumId() != -1) +- path = StringUtils::Format("musicdb://albums/%i/",params.GetAlbumId()); ++ path = StringUtils::Format("musicdb://albums/%li/",params.GetAlbumId()); + else if (params.GetArtistId() != -1) + { +- path = StringUtils::Format("musicdb://artists/%i/",params.GetArtistId()); ++ path = StringUtils::Format("musicdb://artists/%li/",params.GetArtistId()); + content = CONTENT_ARTISTS; + } + +diff --git a/xbmc/network/DNSNameCache.cpp b/xbmc/network/DNSNameCache.cpp +index c5f6397..f12c782 100644 +--- a/xbmc/network/DNSNameCache.cpp ++++ b/xbmc/network/DNSNameCache.cpp +@@ -48,7 +48,7 @@ bool CDNSNameCache::Lookup(const std::string& strHostName, std::string& strIpAdd + + if (address != INADDR_NONE) + { +- strIpAddress = StringUtils::Format("%d.%d.%d.%d", (address & 0xFF), (address & 0xFF00) >> 8, (address & 0xFF0000) >> 16, (address & 0xFF000000) >> 24 ); ++ strIpAddress = StringUtils::Format("%lu.%lu.%lu.%lu", (address & 0xFF), (address & 0xFF00) >> 8, (address & 0xFF0000) >> 16, (address & 0xFF000000) >> 24 ); + return true; + } + +diff --git a/xbmc/network/upnp/UPnPRenderer.cpp b/xbmc/network/upnp/UPnPRenderer.cpp +index ef74d59..7aeb034 100644 +--- a/xbmc/network/upnp/UPnPRenderer.cpp ++++ b/xbmc/network/upnp/UPnPRenderer.cpp +@@ -279,10 +279,10 @@ CUPnPRenderer::Announce(AnnouncementFlag flag, const char *sender, const char *m + + CStdString buffer; + +- buffer = StringUtils::Format("%ld", data["volume"].asInteger()); ++ buffer = StringUtils::Format("%" PRId64, data["volume"].asInteger()); + rct->SetStateVariable("Volume", buffer.c_str()); + +- buffer = StringUtils::Format("%ld", 256 * (data["volume"].asInteger() * 60 - 60) / 100); ++ buffer = StringUtils::Format("%" PRId64, 256 * (data["volume"].asInteger() * 60 - 60) / 100); + rct->SetStateVariable("VolumeDb", buffer.c_str()); + + rct->SetStateVariable("Mute", data["muted"].asBoolean() ? "1" : "0"); +diff --git a/xbmc/network/upnp/UPnPServer.cpp b/xbmc/network/upnp/UPnPServer.cpp +index b9bc25b..20e3bf5 100644 +--- a/xbmc/network/upnp/UPnPServer.cpp ++++ b/xbmc/network/upnp/UPnPServer.cpp +@@ -895,7 +895,7 @@ CUPnPServer::OnSearchContainer(PLT_ActionReference& action, + if (genre.GetLength() > 0) { + // all tracks by genre filtered by artist and/or album + CStdString strPath; +- strPath = StringUtils::Format("musicdb://genres/%ld/%ld/%ld/", ++ strPath = StringUtils::Format("musicdb://genres/%i/%i/%i/", + database.GetGenreByName((const char*)genre), + database.GetArtistByName((const char*)artist), // will return -1 if no artist + database.GetAlbumByName((const char*)album)); // will return -1 if no album +@@ -904,14 +904,14 @@ CUPnPServer::OnSearchContainer(PLT_ActionReference& action, + } else if (artist.GetLength() > 0) { + // all tracks by artist name filtered by album if passed + CStdString strPath; +- strPath = StringUtils::Format("musicdb://artists/%ld/%ld/", ++ strPath = StringUtils::Format("musicdb://artists/%i/%i/", + database.GetArtistByName((const char*)artist), + database.GetAlbumByName((const char*)album)); // will return -1 if no album + + return OnBrowseDirectChildren(action, strPath.c_str(), filter, starting_index, requested_count, sort_criteria, context); + } else if (album.GetLength() > 0) { + // all tracks by album name +- CStdString strPath = StringUtils::Format("musicdb://albums/%ld/", ++ CStdString strPath = StringUtils::Format("musicdb://albums/%i/", + database.GetAlbumByName((const char*)album)); + + return OnBrowseDirectChildren(action, strPath.c_str(), filter, starting_index, requested_count, sort_criteria, context); +@@ -934,12 +934,12 @@ CUPnPServer::OnSearchContainer(PLT_ActionReference& action, + database.Open(); + + if (genre.GetLength() > 0) { +- CStdString strPath = StringUtils::Format("musicdb://genres/%ld/%ld/", ++ CStdString strPath = StringUtils::Format("musicdb://genres/%i/%i/", + database.GetGenreByName((const char*)genre), + database.GetArtistByName((const char*)artist)); // no artist should return -1 + return OnBrowseDirectChildren(action, strPath.c_str(), filter, starting_index, requested_count, sort_criteria, context); + } else if (artist.GetLength() > 0) { +- CStdString strPath = StringUtils::Format("musicdb://artists/%ld/", ++ CStdString strPath = StringUtils::Format("musicdb://artists/%i/", + database.GetArtistByName((const char*)artist)); + return OnBrowseDirectChildren(action, strPath.c_str(), filter, starting_index, requested_count, sort_criteria, context); + } +@@ -952,7 +952,7 @@ CUPnPServer::OnSearchContainer(PLT_ActionReference& action, + if (genre.GetLength() > 0) { + CMusicDatabase database; + database.Open(); +- CStdString strPath = StringUtils::Format("musicdb://genres/%ld/", database.GetGenreByName((const char*)genre)); ++ CStdString strPath = StringUtils::Format("musicdb://genres/%i/", database.GetGenreByName((const char*)genre)); + return OnBrowseDirectChildren(action, strPath.c_str(), filter, starting_index, requested_count, sort_criteria, context); + } + return OnBrowseDirectChildren(action, "musicdb://artists/", filter, starting_index, requested_count, sort_criteria, context); +diff --git a/xbmc/peripherals/devices/Peripheral.cpp b/xbmc/peripherals/devices/Peripheral.cpp +index b1eaa1f..35415d1 100644 +--- a/xbmc/peripherals/devices/Peripheral.cpp ++++ b/xbmc/peripherals/devices/Peripheral.cpp +@@ -55,10 +55,16 @@ CPeripheral::CPeripheral(const PeripheralScanResult& scanResult) : + { + PeripheralTypeTranslator::FormatHexString(scanResult.m_iVendorId, m_strVendorId); + PeripheralTypeTranslator::FormatHexString(scanResult.m_iProductId, m_strProductId); +- m_strFileLocation = StringUtils::Format(scanResult.m_iSequence > 0 ? "peripherals://%s/%s_%d.dev" : "peripherals://%s/%s.dev", +- PeripheralTypeTranslator::BusTypeToString(scanResult.m_busType), +- scanResult.m_strLocation.c_str(), +- scanResult.m_iSequence); ++ ++ if (scanResult.m_iSequence > 0) ++ m_strFileLocation = StringUtils::Format("peripherals://%s/%s_%d.dev", ++ PeripheralTypeTranslator::BusTypeToString(scanResult.m_busType), ++ scanResult.m_strLocation.c_str(), ++ scanResult.m_iSequence); ++ else ++ m_strFileLocation = StringUtils::Format("peripherals://%s/%s.dev", ++ PeripheralTypeTranslator::BusTypeToString(scanResult.m_busType), ++ scanResult.m_strLocation.c_str()); + } + + CPeripheral::~CPeripheral(void) +diff --git a/xbmc/playlists/PlayListB4S.cpp b/xbmc/playlists/PlayListB4S.cpp +index aaa91d7..d09af8c 100644 +--- a/xbmc/playlists/PlayListB4S.cpp ++++ b/xbmc/playlists/PlayListB4S.cpp +@@ -125,7 +125,7 @@ void CPlayListB4S::Save(const std::string& strFileName) const + std::string write; + write += StringUtils::Format("\n", 34, 34, 34, 34); + write += StringUtils::Format("\n"); +- write += StringUtils::Format(" \n", 34, m_vecItems.size(), 34, 34, m_strPlayListName.c_str(), 34); ++ write += StringUtils::Format(" \n", 34, m_vecItems.size(), 34, 34, m_strPlayListName.c_str(), 34); + for (int i = 0; i < (int)m_vecItems.size(); ++i) + { + const CFileItemPtr item = m_vecItems[i]; +diff --git a/xbmc/playlists/PlayListPLS.cpp b/xbmc/playlists/PlayListPLS.cpp +index a34d546..312af79 100644 +--- a/xbmc/playlists/PlayListPLS.cpp ++++ b/xbmc/playlists/PlayListPLS.cpp +@@ -233,7 +233,7 @@ void CPlayListPLS::Save(const std::string& strFileName) const + write += StringUtils::Format("Length%i=%u\n", i + 1, item->GetMusicInfoTag()->GetDuration() / 1000 ); + } + +- write += StringUtils::Format("NumberOfEntries=%i\n", m_vecItems.size()); ++ write += StringUtils::Format("NumberOfEntries=%" PRIuS"\n", m_vecItems.size()); + write += StringUtils::Format("Version=2\n"); + file.Write(write.c_str(), write.size()); + file.Close(); +diff --git a/xbmc/playlists/SmartPlayList.cpp b/xbmc/playlists/SmartPlayList.cpp +index 7599816..21a41a6 100644 +--- a/xbmc/playlists/SmartPlayList.cpp ++++ b/xbmc/playlists/SmartPlayList.cpp +@@ -699,7 +699,7 @@ std::string CSmartPlaylistRule::FormatParameter(const std::string &operatorStrin + // special-casing + if (m_field == FieldTime) + { // translate time to seconds +- std::string seconds = StringUtils::Format("%i", StringUtils::TimeStringToSeconds(param)); ++ std::string seconds = StringUtils::Format("%li", StringUtils::TimeStringToSeconds(param)); + return db.PrepareSQL(operatorString.c_str(), seconds.c_str()); + } + return CDatabaseQueryRule::FormatParameter(operatorString, param, db, strType); +diff --git a/xbmc/profiles/ProfilesManager.cpp b/xbmc/profiles/ProfilesManager.cpp +index 2b4cf63..93e2946 100644 +--- a/xbmc/profiles/ProfilesManager.cpp ++++ b/xbmc/profiles/ProfilesManager.cpp +@@ -355,7 +355,7 @@ void CProfilesManager::CreateProfileFolders() + CDirectory::Create(GetVideoThumbFolder()); + CDirectory::Create(GetBookmarksThumbFolder()); + for (size_t hex = 0; hex < 16; hex++) +- CDirectory::Create(URIUtils::AddFileToFolder(GetThumbnailsFolder(), StringUtils::Format("%x", hex))); ++ CDirectory::Create(URIUtils::AddFileToFolder(GetThumbnailsFolder(), StringUtils::Format("%lx", hex))); + + CDirectory::Create("special://profile/addon_data"); + CDirectory::Create("special://profile/keymaps"); +diff --git a/xbmc/pvr/PVRGUIInfo.cpp b/xbmc/pvr/PVRGUIInfo.cpp +index c938295..5bde0e4 100644 +--- a/xbmc/pvr/PVRGUIInfo.cpp ++++ b/xbmc/pvr/PVRGUIInfo.cpp +@@ -552,12 +552,12 @@ void CPVRGUIInfo::CharInfoSNR(std::string &strValue) const + + void CPVRGUIInfo::CharInfoBER(std::string &strValue) const + { +- strValue = StringUtils::Format("%08X", m_qualityInfo.iBER); ++ strValue = StringUtils::Format("%08lX", m_qualityInfo.iBER); + } + + void CPVRGUIInfo::CharInfoUNC(std::string &strValue) const + { +- strValue = StringUtils::Format("%08X", m_qualityInfo.iUNC); ++ strValue = StringUtils::Format("%08lX", m_qualityInfo.iUNC); + } + + void CPVRGUIInfo::CharInfoFrontendName(std::string &strValue) const +diff --git a/xbmc/pvr/PVRManager.cpp b/xbmc/pvr/PVRManager.cpp +index 076920c..74d3950 100644 +--- a/xbmc/pvr/PVRManager.cpp ++++ b/xbmc/pvr/PVRManager.cpp +@@ -546,7 +546,7 @@ bool CPVRManager::SetWakeupCommand(void) + { + nextEvent.GetAsTime(iWakeupTime); + +- std::string strExecCommand = StringUtils::Format("%s %d", strWakeupCommand.c_str(), iWakeupTime); ++ std::string strExecCommand = StringUtils::Format("%s %ld", strWakeupCommand.c_str(), iWakeupTime); + + const int iReturn = system(strExecCommand.c_str()); + if (iReturn != 0) +diff --git a/xbmc/pvr/channels/PVRChannelGroups.cpp b/xbmc/pvr/channels/PVRChannelGroups.cpp +index c5a022a..7f7398b 100644 +--- a/xbmc/pvr/channels/PVRChannelGroups.cpp ++++ b/xbmc/pvr/channels/PVRChannelGroups.cpp +@@ -225,7 +225,7 @@ bool CPVRChannelGroups::LoadUserDefinedChannelGroups(void) + if (bSyncWithBackends) + { + GetGroupsFromClients(); +- CLog::Log(LOGDEBUG, "PVR - %s - %"PRIuS" new user defined %s channel groups fetched from clients", __FUNCTION__, (m_groups.size() - iSize), m_bRadio ? "radio" : "TV"); ++ CLog::Log(LOGDEBUG, "PVR - %s - %" PRIuS" new user defined %s channel groups fetched from clients", __FUNCTION__, (m_groups.size() - iSize), m_bRadio ? "radio" : "TV"); + } + else + CLog::Log(LOGDEBUG, "PVR - %s - 'synchannelgroups' is disabled; skipping groups from clients", __FUNCTION__); +@@ -279,7 +279,7 @@ bool CPVRChannelGroups::Load(void) + + // load groups from the database + database->Get(*this); +- CLog::Log(LOGDEBUG, "PVR - %s - %"PRIuS" %s groups fetched from the database", __FUNCTION__, m_groups.size(), m_bRadio ? "radio" : "TV"); ++ CLog::Log(LOGDEBUG, "PVR - %s - %" PRIuS" %s groups fetched from the database", __FUNCTION__, m_groups.size(), m_bRadio ? "radio" : "TV"); + + // load channels of internal group + if (!internalGroup->Load()) +@@ -299,7 +299,7 @@ bool CPVRChannelGroups::Load(void) + CPVRChannelGroupPtr lastPlayedGroup = GetLastPlayedGroup(); + SetSelectedGroup(lastPlayedGroup ? lastPlayedGroup : internalGroup); + +- CLog::Log(LOGDEBUG, "PVR - %s - %"PRIuS" %s channel groups loaded", __FUNCTION__, m_groups.size(), m_bRadio ? "radio" : "TV"); ++ CLog::Log(LOGDEBUG, "PVR - %s - %" PRIuS" %s channel groups loaded", __FUNCTION__, m_groups.size(), m_bRadio ? "radio" : "TV"); + + // need at least 1 group + return m_groups.size() > 0; +diff --git a/xbmc/utils/Fanart.cpp b/xbmc/utils/Fanart.cpp +index d7bde1d..9a86bd0 100644 +--- a/xbmc/utils/Fanart.cpp ++++ b/xbmc/utils/Fanart.cpp +@@ -160,7 +160,7 @@ bool CFanart::ParseColors(const std::string &colorsIn, std::string &colorsOut) + { // convert + if (colorsOut.size()) + colorsOut += ","; +- colorsOut += StringUtils::Format("FF%2x%2x%2x", atol(strTriplets[0].c_str()), atol(strTriplets[1].c_str()), atol(strTriplets[2].c_str())); ++ colorsOut += StringUtils::Format("FF%2lx%2lx%2lx", atol(strTriplets[0].c_str()), atol(strTriplets[1].c_str()), atol(strTriplets[2].c_str())); + } + } + } +diff --git a/xbmc/utils/GroupUtils.cpp b/xbmc/utils/GroupUtils.cpp +index 47ceae1..208403e 100644 +--- a/xbmc/utils/GroupUtils.cpp ++++ b/xbmc/utils/GroupUtils.cpp +@@ -80,7 +80,7 @@ bool GroupUtils::Group(GroupBy groupBy, const std::string &baseDir, const CFileI + pItem->GetVideoInfoTag()->m_iDbId = set->first; + pItem->GetVideoInfoTag()->m_type = MediaTypeVideoCollection; + +- std::string basePath = StringUtils::Format("videodb://movies/sets/%ld/", set->first); ++ std::string basePath = StringUtils::Format("videodb://movies/sets/%i/", set->first); + CVideoDbUrl videoUrl; + if (!videoUrl.FromString(basePath)) + pItem->SetPath(basePath); +diff --git a/xbmc/utils/LabelFormatter.cpp b/xbmc/utils/LabelFormatter.cpp +index 7ad8201..c548569 100644 +--- a/xbmc/utils/LabelFormatter.cpp ++++ b/xbmc/utils/LabelFormatter.cpp +@@ -303,7 +303,7 @@ std::string CLabelFormatter::GetMaskContent(const CMaskString &mask, const CFile + break; + case 'X': // Bitrate + if( !item->m_bIsFolder && item->m_dwSize != 0 ) +- value = StringUtils::Format("%i kbps", item->m_dwSize); ++ value = StringUtils::Format("%" PRId64" kbps", item->m_dwSize); + break; + case 'W': // Listeners + if( !item->m_bIsFolder && music && music->GetListeners() != 0 ) +diff --git a/xbmc/utils/RecentlyAddedJob.cpp b/xbmc/utils/RecentlyAddedJob.cpp +index e9f512e..f4770c7 100644 +--- a/xbmc/utils/RecentlyAddedJob.cpp ++++ b/xbmc/utils/RecentlyAddedJob.cpp +@@ -269,8 +269,8 @@ bool CRecentlyAddedJob::UpdateMusic() + CStdString value = StringUtils::Format("%i", i + 1); + CStdString strThumb = musicdatabase.GetArtForItem(album.idAlbum, MediaTypeAlbum, "thumb"); + CStdString strFanart = musicdatabase.GetArtistArtForItem(album.idAlbum, MediaTypeAlbum, "fanart"); +- CStdString strDBpath = StringUtils::Format("musicdb://albums/%i/", album.idAlbum); +- CStdString strSQLAlbum = StringUtils::Format("idAlbum=%i", album.idAlbum); ++ CStdString strDBpath = StringUtils::Format("musicdb://albums/%li/", album.idAlbum); ++ CStdString strSQLAlbum = StringUtils::Format("idAlbum=%li", album.idAlbum); + CStdString strArtist = musicdatabase.GetSingleValue("albumview", "strArtists", strSQLAlbum); + + home->SetProperty("LatestAlbum." + value + ".Title" , album.strAlbum); +diff --git a/xbmc/utils/ScraperParser.cpp b/xbmc/utils/ScraperParser.cpp +index a6ebaba..4dc3b48 100644 +--- a/xbmc/utils/ScraperParser.cpp ++++ b/xbmc/utils/ScraperParser.cpp +@@ -560,7 +560,7 @@ void CScraperParser::ConvertJSON(std::string &string) + int pos2 = reg2.GetSubStart(2); + std::string szHexValue(reg2.GetMatch(1)); + +- std::string replace = StringUtils::Format("%c", strtol(szHexValue.c_str(), NULL, 16)); ++ std::string replace = StringUtils::Format("%li", strtol(szHexValue.c_str(), NULL, 16)); + string.replace(string.begin()+pos1-2, string.begin()+pos2+reg2.GetSubLength(2), replace); + } + +diff --git a/xbmc/utils/SortUtils.cpp b/xbmc/utils/SortUtils.cpp +index 8292648..a2601dd 100644 +--- a/xbmc/utils/SortUtils.cpp ++++ b/xbmc/utils/SortUtils.cpp +@@ -68,12 +68,12 @@ string ByFile(SortAttribute attributes, const SortItem &values) + { + CURL url(values.at(FieldPath).asString()); + +- return StringUtils::Format("%s %d", url.GetFileNameWithoutPath().c_str(), values.at(FieldStartOffset).asInteger()); ++ return StringUtils::Format("%s %" PRId64, url.GetFileNameWithoutPath().c_str(), values.at(FieldStartOffset).asInteger()); + } + + string ByPath(SortAttribute attributes, const SortItem &values) + { +- return StringUtils::Format("%s %d", values.at(FieldPath).asString().c_str(), values.at(FieldStartOffset).asInteger()); ++ return StringUtils::Format("%s %" PRId64, values.at(FieldPath).asString().c_str(), values.at(FieldStartOffset).asInteger()); + } + + string ByLastPlayed(SortAttribute attributes, const SortItem &values) +@@ -355,7 +355,7 @@ string ByBitrate(SortAttribute attributes, const SortItem &values) + + string ByListeners(SortAttribute attributes, const SortItem &values) + { +- return StringUtils::Format("%i", values.at(FieldListeners).asInteger());; ++ return StringUtils::Format("%" PRId64, values.at(FieldListeners).asInteger());; + } + + string ByRandom(SortAttribute attributes, const SortItem &values) +diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp +index 131b598..a6e9efa 100644 +--- a/xbmc/video/VideoDatabase.cpp ++++ b/xbmc/video/VideoDatabase.cpp +@@ -2010,7 +2010,7 @@ bool CVideoDatabase::GetSeasonInfo(int idSeason, CVideoInfoTag& details) + return false; + + CFileItemList seasons; +- if (!GetSeasonsNav(StringUtils::Format("videodb://tvshows/titles/%ld/", idShow), seasons, -1, -1, -1, -1, idShow, false) || seasons.Size() <= 0) ++ if (!GetSeasonsNav(StringUtils::Format("videodb://tvshows/titles/%i/", idShow), seasons, -1, -1, -1, -1, idShow, false) || seasons.Size() <= 0) + return false; + + for (int index = 0; index < seasons.Size(); index++) +@@ -5259,7 +5259,7 @@ bool CVideoDatabase::GetNavCommon(const CStdString& strBaseDir, CFileItemList& i + pItem->GetVideoInfoTag()->m_type = type; + + CVideoDbUrl itemUrl = videoUrl; +- CStdString path = StringUtils::Format("%ld/", it->first); ++ CStdString path = StringUtils::Format("%i/", it->first); + itemUrl.AppendPath(path); + pItem->SetPath(itemUrl.ToString()); + +@@ -5282,7 +5282,7 @@ bool CVideoDatabase::GetNavCommon(const CStdString& strBaseDir, CFileItemList& i + pItem->GetVideoInfoTag()->m_type = type; + + CVideoDbUrl itemUrl = videoUrl; +- CStdString path = StringUtils::Format("%ld/", m_pDS->fv(0).get_asInt()); ++ CStdString path = StringUtils::Format("%i/", m_pDS->fv(0).get_asInt()); + itemUrl.AppendPath(path); + pItem->SetPath(itemUrl.ToString()); + +@@ -5373,7 +5373,7 @@ bool CVideoDatabase::GetTagsNav(const CStdString& strBaseDir, CFileItemList& ite + pItem->GetVideoInfoTag()->m_type = "tag"; + + CVideoDbUrl itemUrl = videoUrl; +- CStdString path = StringUtils::Format("%ld/", idTag); ++ CStdString path = StringUtils::Format("%i/", idTag); + itemUrl.AppendPath(path); + pItem->SetPath(itemUrl.ToString()); + +@@ -5519,7 +5519,7 @@ bool CVideoDatabase::GetMusicVideoAlbumsNav(const CStdString& strBaseDir, CFileI + CFileItemPtr pItem(new CFileItem(it->second.first)); + + CVideoDbUrl itemUrl = videoUrl; +- CStdString path = StringUtils::Format("%ld/", it->first); ++ CStdString path = StringUtils::Format("%i/", it->first); + itemUrl.AppendPath(path); + pItem->SetPath(itemUrl.ToString()); + +@@ -5542,7 +5542,7 @@ bool CVideoDatabase::GetMusicVideoAlbumsNav(const CStdString& strBaseDir, CFileI + CFileItemPtr pItem(new CFileItem(m_pDS->fv(0).get_asString())); + + CVideoDbUrl itemUrl = videoUrl; +- CStdString path = StringUtils::Format("%ld/", m_pDS->fv(1).get_asInt()); ++ CStdString path = StringUtils::Format("%i/", m_pDS->fv(1).get_asInt()); + itemUrl.AppendPath(path); + pItem->SetPath(itemUrl.ToString()); + +@@ -5749,7 +5749,7 @@ bool CVideoDatabase::GetPeopleNav(const CStdString& strBaseDir, CFileItemList& i + CFileItemPtr pItem(new CFileItem(it->second.name)); + + CVideoDbUrl itemUrl = videoUrl; +- CStdString path = StringUtils::Format("%ld/", it->first); ++ CStdString path = StringUtils::Format("%i/", it->first); + itemUrl.AppendPath(path); + pItem->SetPath(itemUrl.ToString()); + +@@ -5770,7 +5770,7 @@ bool CVideoDatabase::GetPeopleNav(const CStdString& strBaseDir, CFileItemList& i + CFileItemPtr pItem(new CFileItem(m_pDS->fv(1).get_asString())); + + CVideoDbUrl itemUrl = videoUrl; +- CStdString path = StringUtils::Format("%ld/", m_pDS->fv(0).get_asInt()); ++ CStdString path = StringUtils::Format("%i/", m_pDS->fv(0).get_asInt()); + itemUrl.AppendPath(path); + pItem->SetPath(itemUrl.ToString()); + +@@ -5911,7 +5911,7 @@ bool CVideoDatabase::GetYearsNav(const CStdString& strBaseDir, CFileItemList& it + CFileItemPtr pItem(new CFileItem(it->second.first)); + + CVideoDbUrl itemUrl = videoUrl; +- CStdString path = StringUtils::Format("%ld/", it->first); ++ CStdString path = StringUtils::Format("%i/", it->first); + itemUrl.AppendPath(path); + pItem->SetPath(itemUrl.ToString()); + +@@ -5947,7 +5947,7 @@ bool CVideoDatabase::GetYearsNav(const CStdString& strBaseDir, CFileItemList& it + CFileItemPtr pItem(new CFileItem(strLabel)); + + CVideoDbUrl itemUrl = videoUrl; +- CStdString path = StringUtils::Format("%ld/", lYear); ++ CStdString path = StringUtils::Format("%i/", lYear); + itemUrl.AppendPath(path); + pItem->SetPath(itemUrl.ToString()); + +@@ -6330,7 +6330,7 @@ bool CVideoDatabase::GetMoviesByWhere(const CStdString& strBaseDir, const Filter + CFileItemPtr pItem(new CFileItem(movie)); + + CVideoDbUrl itemUrl = videoUrl; +- CStdString path = StringUtils::Format("%ld", movie.m_iDbId); ++ CStdString path = StringUtils::Format("%i", movie.m_iDbId); + itemUrl.AppendPath(path); + pItem->SetPath(itemUrl.ToString()); + +@@ -6438,7 +6438,7 @@ bool CVideoDatabase::GetTvShowsByWhere(const CStdString& strBaseDir, const Filte + pItem->SetFromVideoInfoTag(movie); + + CVideoDbUrl itemUrl = videoUrl; +- CStdString path = StringUtils::Format("%ld/", record->at(0).get_asInt()); ++ CStdString path = StringUtils::Format("%i/", record->at(0).get_asInt()); + itemUrl.AppendPath(path); + pItem->SetPath(itemUrl.ToString()); + +@@ -6570,9 +6570,9 @@ bool CVideoDatabase::GetEpisodesByWhere(const CStdString& strBaseDir, const Filt + CVideoDbUrl itemUrl = videoUrl; + CStdString path; + if (appendFullShowPath && videoUrl.GetItemType() != "episodes") +- path = StringUtils::Format("%ld/%ld/%ld", record->at(VIDEODB_DETAILS_EPISODE_TVSHOW_ID).get_asInt(), movie.m_iSeason, idEpisode); ++ path = StringUtils::Format("%i/%i/%i", record->at(VIDEODB_DETAILS_EPISODE_TVSHOW_ID).get_asInt(), movie.m_iSeason, idEpisode); + else +- path = StringUtils::Format("%ld", idEpisode); ++ path = StringUtils::Format("%i", idEpisode); + itemUrl.AppendPath(path); + pItem->SetPath(itemUrl.ToString()); + +@@ -7008,7 +7008,7 @@ void CVideoDatabase::GetMovieGenresByName(const CStdString& strSearch, CFileItem + } + + CFileItemPtr pItem(new CFileItem(m_pDS->fv("genre.strGenre").get_asString())); +- CStdString strDir = StringUtils::Format("%ld/", m_pDS->fv("genre.idGenre").get_asInt()); ++ CStdString strDir = StringUtils::Format("%i/", m_pDS->fv("genre.idGenre").get_asInt()); + pItem->SetPath("videodb://movies/genres/"+ strDir); + pItem->m_bIsFolder=true; + items.Add(pItem); +@@ -7048,7 +7048,7 @@ void CVideoDatabase::GetMovieCountriesByName(const CStdString& strSearch, CFileI + } + + CFileItemPtr pItem(new CFileItem(m_pDS->fv("country.strCountry").get_asString())); +- CStdString strDir = StringUtils::Format("%ld/", m_pDS->fv("country.idCountry").get_asInt()); ++ CStdString strDir = StringUtils::Format("%i/", m_pDS->fv("country.idCountry").get_asInt()); + pItem->SetPath("videodb://movies/genres/"+ strDir); + pItem->m_bIsFolder=true; + items.Add(pItem); +@@ -7087,7 +7087,7 @@ void CVideoDatabase::GetTvShowGenresByName(const CStdString& strSearch, CFileIte + } + + CFileItemPtr pItem(new CFileItem(m_pDS->fv("genre.strGenre").get_asString())); +- CStdString strDir = StringUtils::Format("%ld/", m_pDS->fv("genre.idGenre").get_asInt()); ++ CStdString strDir = StringUtils::Format("%i/", m_pDS->fv("genre.idGenre").get_asInt()); + pItem->SetPath("videodb://tvshows/genres/"+ strDir); + pItem->m_bIsFolder=true; + items.Add(pItem); +@@ -7126,7 +7126,7 @@ void CVideoDatabase::GetMovieActorsByName(const CStdString& strSearch, CFileItem + } + + CFileItemPtr pItem(new CFileItem(m_pDS->fv("actors.strActor").get_asString())); +- CStdString strDir = StringUtils::Format("%ld/", m_pDS->fv("actors.idActor").get_asInt()); ++ CStdString strDir = StringUtils::Format("%i/", m_pDS->fv("actors.idActor").get_asInt()); + pItem->SetPath("videodb://movies/actors/"+ strDir); + pItem->m_bIsFolder=true; + items.Add(pItem); +@@ -7165,7 +7165,7 @@ void CVideoDatabase::GetTvShowsActorsByName(const CStdString& strSearch, CFileIt + } + + CFileItemPtr pItem(new CFileItem(m_pDS->fv("actors.strActor").get_asString())); +- CStdString strDir = StringUtils::Format("%ld/", m_pDS->fv("actors.idActor").get_asInt()); ++ CStdString strDir = StringUtils::Format("%i/", m_pDS->fv("actors.idActor").get_asInt()); + pItem->SetPath("videodb://tvshows/actors/"+ strDir); + pItem->m_bIsFolder=true; + items.Add(pItem); +@@ -7207,7 +7207,7 @@ void CVideoDatabase::GetMusicVideoArtistsByName(const CStdString& strSearch, CFi + } + + CFileItemPtr pItem(new CFileItem(m_pDS->fv("actors.strActor").get_asString())); +- CStdString strDir = StringUtils::Format("%ld/", m_pDS->fv("actors.idActor").get_asInt()); ++ CStdString strDir = StringUtils::Format("%i/", m_pDS->fv("actors.idActor").get_asInt()); + pItem->SetPath("videodb://musicvideos/artists/"+ strDir); + pItem->m_bIsFolder=true; + items.Add(pItem); +@@ -7246,7 +7246,7 @@ void CVideoDatabase::GetMusicVideoGenresByName(const CStdString& strSearch, CFil + } + + CFileItemPtr pItem(new CFileItem(m_pDS->fv("genre.strGenre").get_asString())); +- CStdString strDir = StringUtils::Format("%ld/", m_pDS->fv("genre.idGenre").get_asInt()); ++ CStdString strDir = StringUtils::Format("%i/", m_pDS->fv("genre.idGenre").get_asInt()); + pItem->SetPath("videodb://musicvideos/genres/"+ strDir); + pItem->m_bIsFolder=true; + items.Add(pItem); +@@ -7300,7 +7300,7 @@ void CVideoDatabase::GetMusicVideoAlbumsByName(const CStdString& strSearch, CFil + } + + CFileItemPtr pItem(new CFileItem(m_pDS->fv(0).get_asString())); +- CStdString strDir = StringUtils::Format("%ld", m_pDS->fv(1).get_asInt()); ++ CStdString strDir = StringUtils::Format("%i", m_pDS->fv(1).get_asInt()); + pItem->SetPath("videodb://musicvideos/titles/"+ strDir); + pItem->m_bIsFolder=false; + items.Add(pItem); +@@ -7339,7 +7339,7 @@ void CVideoDatabase::GetMusicVideosByAlbum(const CStdString& strSearch, CFileIte + } + + CFileItemPtr pItem(new CFileItem(m_pDS->fv(1).get_asString()+" - "+m_pDS->fv(2).get_asString())); +- CStdString strDir = StringUtils::Format("3/2/%ld",m_pDS->fv("musicvideo.idMVideo").get_asInt()); ++ CStdString strDir = StringUtils::Format("3/2/%i",m_pDS->fv("musicvideo.idMVideo").get_asInt()); + + pItem->SetPath("videodb://"+ strDir); + pItem->m_bIsFolder=false; +@@ -7415,7 +7415,7 @@ bool CVideoDatabase::GetMusicVideosByWhere(const CStdString &baseDir, const Filt + CFileItemPtr item(new CFileItem(musicvideo)); + + CVideoDbUrl itemUrl = videoUrl; +- CStdString path = StringUtils::Format("%ld", record->at(0).get_asInt()); ++ CStdString path = StringUtils::Format("%i", record->at(0).get_asInt()); + itemUrl.AppendPath(path); + item->SetPath(itemUrl.ToString()); + +@@ -7489,7 +7489,7 @@ bool CVideoDatabase::GetRandomMusicVideo(CFileItem* item, int& idSong, const CSt + return false; + } + *item->GetVideoInfoTag() = GetDetailsForMusicVideo(m_pDS); +- CStdString path = StringUtils::Format("videodb://musicvideos/titles/%ld",item->GetVideoInfoTag()->m_iDbId); ++ CStdString path = StringUtils::Format("videodb://musicvideos/titles/%i",item->GetVideoInfoTag()->m_iDbId); + item->SetPath(path); + idSong = m_pDS->fv("idMVideo").get_asInt(); + item->SetLabel(item->GetVideoInfoTag()->m_strTitle); +@@ -7618,7 +7618,7 @@ void CVideoDatabase::GetTvShowsByName(const CStdString& strSearch, CFileItemList + } + + CFileItemPtr pItem(new CFileItem(m_pDS->fv(1).get_asString())); +- CStdString strDir = StringUtils::Format("tvshows/titles/%ld/", m_pDS->fv("tvshow.idShow").get_asInt()); ++ CStdString strDir = StringUtils::Format("tvshows/titles/%i/", m_pDS->fv("tvshow.idShow").get_asInt()); + + pItem->SetPath("videodb://"+ strDir); + pItem->m_bIsFolder=true; +@@ -7659,7 +7659,7 @@ void CVideoDatabase::GetEpisodesByName(const CStdString& strSearch, CFileItemLis + } + + CFileItemPtr pItem(new CFileItem(m_pDS->fv(1).get_asString()+" ("+m_pDS->fv(4).get_asString()+")")); +- CStdString path = StringUtils::Format("videodb://tvshows/titles/%ld/%ld/%ld",m_pDS->fv("episode.idShow").get_asInt(),m_pDS->fv(2).get_asInt(),m_pDS->fv(0).get_asInt()); ++ CStdString path = StringUtils::Format("videodb://tvshows/titles/%i/%i/%i",m_pDS->fv("episode.idShow").get_asInt(),m_pDS->fv(2).get_asInt(),m_pDS->fv(0).get_asInt()); + pItem->SetPath(path); + pItem->m_bIsFolder=false; + items.Add(pItem); +@@ -7702,7 +7702,7 @@ void CVideoDatabase::GetMusicVideosByName(const CStdString& strSearch, CFileItem + } + + CFileItemPtr pItem(new CFileItem(m_pDS->fv(1).get_asString())); +- CStdString strDir = StringUtils::Format("3/2/%ld",m_pDS->fv("musicvideo.idMVideo").get_asInt()); ++ CStdString strDir = StringUtils::Format("3/2/%i",m_pDS->fv("musicvideo.idMVideo").get_asInt()); + + pItem->SetPath("videodb://"+ strDir); + pItem->m_bIsFolder=false; +@@ -7749,7 +7749,7 @@ void CVideoDatabase::GetEpisodesByPlot(const CStdString& strSearch, CFileItemLis + } + + CFileItemPtr pItem(new CFileItem(m_pDS->fv(1).get_asString()+" ("+m_pDS->fv(4).get_asString()+")")); +- CStdString path = StringUtils::Format("videodb://tvshows/titles/%ld/%ld/%ld",m_pDS->fv("episode.idShow").get_asInt(),m_pDS->fv(2).get_asInt(),m_pDS->fv(0).get_asInt()); ++ CStdString path = StringUtils::Format("videodb://tvshows/titles/%i/%i/%i",m_pDS->fv("episode.idShow").get_asInt(),m_pDS->fv(2).get_asInt(),m_pDS->fv(0).get_asInt()); + pItem->SetPath(path); + pItem->m_bIsFolder=false; + items.Add(pItem); +@@ -7789,7 +7789,7 @@ void CVideoDatabase::GetMoviesByPlot(const CStdString& strSearch, CFileItemList& + } + + CFileItemPtr pItem(new CFileItem(m_pDS->fv(1).get_asString())); +- CStdString path = StringUtils::Format("videodb://movies/titles/%ld", m_pDS->fv(0).get_asInt()); ++ CStdString path = StringUtils::Format("videodb://movies/titles/%i", m_pDS->fv(0).get_asInt()); + pItem->SetPath(path); + pItem->m_bIsFolder=false; + +@@ -7830,7 +7830,7 @@ void CVideoDatabase::GetMovieDirectorsByName(const CStdString& strSearch, CFileI + continue; + } + +- CStdString strDir = StringUtils::Format("%ld/", m_pDS->fv("directorlinkmovie.idDirector").get_asInt()); ++ CStdString strDir = StringUtils::Format("%i/", m_pDS->fv("directorlinkmovie.idDirector").get_asInt()); + CFileItemPtr pItem(new CFileItem(m_pDS->fv("actors.strActor").get_asString())); + + pItem->SetPath("videodb://movies/directors/"+ strDir); +@@ -7871,7 +7871,7 @@ void CVideoDatabase::GetTvShowsDirectorsByName(const CStdString& strSearch, CFil + continue; + } + +- CStdString strDir = StringUtils::Format("%ld/", m_pDS->fv("directorlinktvshow.idDirector").get_asInt()); ++ CStdString strDir = StringUtils::Format("%i/", m_pDS->fv("directorlinktvshow.idDirector").get_asInt()); + CFileItemPtr pItem(new CFileItem(m_pDS->fv("actors.strActor").get_asString())); + + pItem->SetPath("videodb://tvshows/studios/"+ strDir); +@@ -7912,7 +7912,7 @@ void CVideoDatabase::GetMusicVideoDirectorsByName(const CStdString& strSearch, C + continue; + } + +- CStdString strDir = StringUtils::Format("%ld/", m_pDS->fv("directorlinkmusicvideo.idDirector").get_asInt()); ++ CStdString strDir = StringUtils::Format("%i/", m_pDS->fv("directorlinkmusicvideo.idDirector").get_asInt()); + CFileItemPtr pItem(new CFileItem(m_pDS->fv("actors.strActor").get_asString())); + + pItem->SetPath("videodb://musicvideos/albums/"+ strDir); +diff --git a/xbmc/video/dialogs/GUIDialogVideoBookmarks.cpp b/xbmc/video/dialogs/GUIDialogVideoBookmarks.cpp +index a744218..c792dfc 100644 +--- a/xbmc/video/dialogs/GUIDialogVideoBookmarks.cpp ++++ b/xbmc/video/dialogs/GUIDialogVideoBookmarks.cpp +@@ -220,7 +220,7 @@ void CGUIDialogVideoBookmarks::OnRefreshList() + + CStdString bookmarkTime; + if (m_bookmarks[i].type == CBookmark::EPISODE) +- bookmarkTime = StringUtils::Format("%s %i %s %i", g_localizeStrings.Get(20373).c_str(), m_bookmarks[i].seasonNumber, g_localizeStrings.Get(20359).c_str(), m_bookmarks[i].episodeNumber); ++ bookmarkTime = StringUtils::Format("%s %li %s %li", g_localizeStrings.Get(20373).c_str(), m_bookmarks[i].seasonNumber, g_localizeStrings.Get(20359).c_str(), m_bookmarks[i].episodeNumber); + else + bookmarkTime = StringUtils::SecondsToTimeString((long)m_bookmarks[i].timeInSeconds, TIME_FORMAT_HH_MM_SS); + +diff --git a/xbmc/video/dialogs/GUIDialogVideoInfo.cpp b/xbmc/video/dialogs/GUIDialogVideoInfo.cpp +index a7d0c31..21d2a58 100644 +--- a/xbmc/video/dialogs/GUIDialogVideoInfo.cpp ++++ b/xbmc/video/dialogs/GUIDialogVideoInfo.cpp +@@ -1702,7 +1702,7 @@ bool CGUIDialogVideoInfo::ManageVideoItemArtwork(const CFileItemPtr &item, const + + for (size_t i = 0; i < thumbs.size(); i++) + { +- CFileItemPtr item(new CFileItem(StringUtils::Format("thumb://Remote%i", i), false)); ++ CFileItemPtr item(new CFileItem(StringUtils::Format("thumb://Remote%" PRIuS, i), false)); + item->SetArt("thumb", thumbs[i]); + item->SetIconImage("DefaultPicture.png"); + item->SetLabel(g_localizeStrings.Get(13513)); +diff --git a/xbmc/video/windows/GUIWindowVideoNav.cpp b/xbmc/video/windows/GUIWindowVideoNav.cpp +index 03944cd..7dcca9c 100644 +--- a/xbmc/video/windows/GUIWindowVideoNav.cpp ++++ b/xbmc/video/windows/GUIWindowVideoNav.cpp +@@ -992,7 +992,7 @@ bool CGUIWindowVideoNav::OnContextButton(int itemNumber, CONTEXT_BUTTON button) + CStdString strPath; + CMusicDatabase database; + database.Open(); +- strPath = StringUtils::Format("musicdb://artists/%ld/", ++ strPath = StringUtils::Format("musicdb://artists/%i/", + database.GetArtistByName(StringUtils::Join(m_vecItems->Get(itemNumber)->GetVideoInfoTag()->m_artist, g_advancedSettings.m_videoItemSeparator))); + g_windowManager.ActivateWindow(WINDOW_MUSIC_NAV,strPath); + return true; +@@ -1002,7 +1002,7 @@ bool CGUIWindowVideoNav::OnContextButton(int itemNumber, CONTEXT_BUTTON button) + CStdString strPath; + CMusicDatabase database; + database.Open(); +- strPath = StringUtils::Format("musicdb://albums/%ld/", ++ strPath = StringUtils::Format("musicdb://albums/%i/", + database.GetAlbumByName(m_vecItems->Get(itemNumber)->GetVideoInfoTag()->m_strAlbum)); + g_windowManager.ActivateWindow(WINDOW_MUSIC_NAV,strPath); + return true; +diff --git a/xbmc/windows/GUIMediaWindow.cpp b/xbmc/windows/GUIMediaWindow.cpp +index 5473267..1a87307 100644 +--- a/xbmc/windows/GUIMediaWindow.cpp ++++ b/xbmc/windows/GUIMediaWindow.cpp +@@ -1218,7 +1218,7 @@ void CGUIMediaWindow::GetDirectoryHistoryString(const CFileItem* pItem, std::str + { + // Could be a cue item, all items of a cue share the same filename + // so add the offsets to build the history string +- strHistoryString = StringUtils::Format("%ld%ld", ++ strHistoryString = StringUtils::Format("%i%i", + pItem->m_lStartOffset, + pItem->m_lEndOffset); + strHistoryString += pItem->GetPath(); + +From 8e291c0d32d5996cf4c3ffc4645ebfc46b23fc93 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sat, 27 Sep 2014 15:27:04 +0100 +Subject: [PATCH 092/104] [omxplayer] Don't sync up to passthrough audio + packets - let GPU handle it + +--- + xbmc/cores/omxplayer/OMXAudio.cpp | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp +index 2b7a83a..c0d7d01 100644 +--- a/xbmc/cores/omxplayer/OMXAudio.cpp ++++ b/xbmc/cores/omxplayer/OMXAudio.cpp +@@ -1125,6 +1125,7 @@ unsigned int COMXAudio::AddPackets(const void* data, unsigned int len, double dt + return len; + } + ++#if 0 + if(m_eEncoding == OMX_AUDIO_CodingDTS && m_LostSync && (m_Passthrough || m_HWDecode)) + { + int skip = SyncDTS((uint8_t *)data, len); +@@ -1138,6 +1139,7 @@ unsigned int COMXAudio::AddPackets(const void* data, unsigned int len, double dt + if(skip > 0) + return len; + } ++#endif + + unsigned pitch = (m_Passthrough || m_HWDecode) ? 1:(m_BitsPerSample >> 3) * m_InputChannels; + unsigned int demuxer_samples = len / pitch; + +From c381be449aa55772cc55ae0ba10df7f43024564a Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sat, 27 Sep 2014 15:32:37 +0100 +Subject: [PATCH 093/104] [dvdplayer] exerimental: don't raise priority of + audio thread + +--- + xbmc/cores/dvdplayer/DVDPlayer.cpp | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp +index 32374d4..f19d425 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayer.cpp ++++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp +@@ -3320,7 +3320,11 @@ bool CDVDPlayer::OpenAudioStream(CDVDStreamInfo& hint, bool reset) + m_dvdPlayerAudio->SendMessage(new CDVDMsg(CDVDMsg::PLAYER_STARTED), 1); + + /* audio normally won't consume full cpu, so let it have prio */ ++#ifdef TARGET_RASPBERRY_PI ++ m_dvdPlayerAudio->SetPriority(GetPriority()); ++#else + m_dvdPlayerAudio->SetPriority(GetPriority()+1); ++#endif + return true; + } + + +From f41e1e46ea972bf74526270a1ed1b04e2bf274a6 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sat, 27 Sep 2014 18:15:50 +0100 +Subject: [PATCH 094/104] [mmalrenderer] squash: Make update logging only + verbose + +--- + xbmc/cores/VideoRenderers/MMALRenderer.cpp | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +index b7bcaeb..6c4636e 100644 +--- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp ++++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +@@ -346,7 +346,9 @@ void CMMALRenderer::Flush() + + void CMMALRenderer::Update() + { ++#if defined(MMAL_DEBUG_VERBOSE) + CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); ++#endif + if (!m_bConfigured) return; + ManageDisplay(); + } + +From 95e5a56c6fd12f95755ccfd722e339926e5bbf9f Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sat, 27 Sep 2014 18:23:38 +0100 +Subject: [PATCH 095/104] [mmalcodec] squash: whitespace + +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +index d9a94d5..10af56f 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +@@ -576,7 +576,7 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVide + } + + if ( (m_codingType == MMAL_ENCODING_MP2V && !g_RBP.GetCodecMpg2() ) || +- (m_codingType == MMAL_ENCODING_WVC1 && !g_RBP.GetCodecWvc1() ) ) ++ (m_codingType == MMAL_ENCODING_WVC1 && !g_RBP.GetCodecWvc1() ) ) + { + CLog::Log(LOGWARNING, "%s::%s Codec %s is not supported", CLASSNAME, __func__, m_pFormatName); + return false; + +From 5a59f7db698bdd5185e489cfca5e0145eeb04528 Mon Sep 17 00:00:00 2001 +From: da-anda +Date: Sun, 17 Aug 2014 21:09:59 +0200 +Subject: [PATCH 096/104] handle stereoscopic mode of videos in mixed playlists + +--- + language/English/strings.po | 2 +- + xbmc/guilib/StereoscopicsManager.cpp | 76 +++++++++++++++++++++++------------- + 2 files changed, 49 insertions(+), 29 deletions(-) + +diff --git a/language/English/strings.po b/language/English/strings.po +index 0ca4b23..8ed90bd 100755 +--- a/language/English/strings.po ++++ b/language/English/strings.po +@@ -15596,7 +15596,7 @@ msgstr "" + #. Description of setting "Videos -> Playback -> Disable stereoscopic mode when playback is stopped" with label #36526 + #: system/settings/settings.xml + msgctxt "#36538" +-msgid "[Enabled] Switch GUI (and some TVs) back to 2D mode when playback ended. [Disabled] GUI and TV will stay in stereoscopic 3D mode. For video playlists the stereoscopic 3D mode won't change between videos, not even for non stereoscopic ones." ++msgid "[Enabled] Switch GUI (and some TVs) back to 2D mode when playback ended - also between videos in a playlist if necessary. [Disabled] GUI and TV will stay in stereoscopic 3D mode. For video playlists the stereoscopic 3D mode won't change between videos, not even for non stereoscopic ones." + msgstr "" + + #. Description of setting "System -> Video output -> Stereoscopic mode (current)" with label #36500 +diff --git a/xbmc/guilib/StereoscopicsManager.cpp b/xbmc/guilib/StereoscopicsManager.cpp +index 35ba597..b013942 100644 +--- a/xbmc/guilib/StereoscopicsManager.cpp ++++ b/xbmc/guilib/StereoscopicsManager.cpp +@@ -123,13 +123,23 @@ RENDER_STEREO_MODE CStereoscopicsManager::GetStereoMode(void) + void CStereoscopicsManager::SetStereoMode(const RENDER_STEREO_MODE &mode) + { + RENDER_STEREO_MODE currentMode = GetStereoMode(); +- if (mode != currentMode && mode >= RENDER_STEREO_MODE_OFF) ++ RENDER_STEREO_MODE applyMode = mode; ++ ++ // resolve automatic mode before applying ++ if (mode == RENDER_STEREO_MODE_AUTO) + { +- if(!g_Windowing.SupportsStereo(mode)) +- return; ++ if (g_infoManager.EvaluateBool("videoplayer.isstereoscopic")) ++ applyMode = GetStereoModeOfPlayingVideo(); ++ else ++ applyMode = RENDER_STEREO_MODE_OFF; ++ } + ++ if (applyMode != currentMode && applyMode >= RENDER_STEREO_MODE_OFF) ++ { ++ if (!g_Windowing.SupportsStereo(applyMode)) ++ return; + m_lastStereoMode = currentMode; +- CSettings::Get().SetInt("videoscreen.stereoscopicmode", mode); ++ CSettings::Get().SetInt("videoscreen.stereoscopicmode", applyMode); + } + } + +@@ -210,6 +220,12 @@ RENDER_STEREO_MODE CStereoscopicsManager::GetStereoModeByUserChoice(const CStdSt + if (mode == selectableMode) + pDlgSelect->SetSelected( label ); + } ++ // inject AUTO pseudo mode after OFF ++ if (i == RENDER_STEREO_MODE_OFF) ++ { ++ selectableModes.push_back(RENDER_STEREO_MODE_AUTO); ++ pDlgSelect->Add(GetLabelForStereoMode(RENDER_STEREO_MODE_AUTO)); ++ } + } + + pDlgSelect->DoModal(); +@@ -248,20 +264,7 @@ CStdString CStereoscopicsManager::GetLabelForStereoMode(const RENDER_STEREO_MODE + + RENDER_STEREO_MODE CStereoscopicsManager::GetPreferredPlaybackMode(void) + { +- RENDER_STEREO_MODE playbackMode = m_lastStereoMode; +- int preferredMode = CSettings::Get().GetInt("videoscreen.preferedstereoscopicmode"); +- if (preferredMode == RENDER_STEREO_MODE_AUTO) // automatic mode, detect by movie +- { +- if (g_infoManager.EvaluateBool("videoplayer.isstereoscopic")) +- playbackMode = GetStereoModeOfPlayingVideo(); +- else if (playbackMode == RENDER_STEREO_MODE_OFF) +- playbackMode = GetNextSupportedStereoMode(RENDER_STEREO_MODE_OFF); +- } +- else // predefined mode +- { +- playbackMode = (RENDER_STEREO_MODE) preferredMode; +- } +- return playbackMode; ++ return (RENDER_STEREO_MODE) CSettings::Get().GetInt("videoscreen.preferedstereoscopicmode"); + } + + int CStereoscopicsManager::ConvertVideoToGuiStereoMode(const std::string &mode) +@@ -450,9 +453,6 @@ void CStereoscopicsManager::ApplyStereoMode(const RENDER_STEREO_MODE &mode, bool + + void CStereoscopicsManager::OnPlaybackStarted(void) + { +- if (!g_infoManager.EvaluateBool("videoplayer.isstereoscopic")) +- return; +- + STEREOSCOPIC_PLAYBACK_MODE playbackMode = (STEREOSCOPIC_PLAYBACK_MODE) CSettings::Get().GetInt("videoplayer.stereoscopicplaybackmode"); + RENDER_STEREO_MODE mode = GetStereoMode(); + +@@ -460,8 +460,31 @@ void CStereoscopicsManager::OnPlaybackStarted(void) + if (playbackMode == STEREOSCOPIC_PLAYBACK_MODE_IGNORE && mode == RENDER_STEREO_MODE_OFF) + return; + +- if (mode != RENDER_STEREO_MODE_OFF) ++ if (!g_infoManager.EvaluateBool("videoplayer.isstereoscopic")) ++ { ++ // exit stereo mode if started item is not stereoscopic ++ // and if user prefers to stop 3D playback when movie is finished ++ if (mode != RENDER_STEREO_MODE_OFF && CSettings::Get().GetBool("videoplayer.quitstereomodeonstop")) ++ SetStereoMode(RENDER_STEREO_MODE_OFF); + return; ++ } ++ ++ RENDER_STEREO_MODE preferred = GetPreferredPlaybackMode(); ++ RENDER_STEREO_MODE playing = GetStereoModeOfPlayingVideo(); ++ ++ if (mode != RENDER_STEREO_MODE_OFF) ++ { ++ // don't change mode if user selected to not exit stereomode on playback stop ++ // users selecting this option usually have to manually switch their TV into 3D mode ++ // and would be annoyed by having to switch TV modes when next movies comes up ++ // @todo probably add a new setting for just this behavior ++ if (CSettings::Get().GetBool("videoplayer.quitstereomodeonstop") == false) ++ return; ++ ++ // only change to new stereo mode if not yet in preferred stereo mode ++ if (mode == preferred || (preferred == RENDER_STEREO_MODE_AUTO && mode == playing)) ++ return; ++ } + + switch (playbackMode) + { +@@ -473,9 +496,6 @@ void CStereoscopicsManager::OnPlaybackStarted(void) + pDlgSelect->Reset(); + pDlgSelect->SetHeading(g_localizeStrings.Get(36527).c_str()); + +- RENDER_STEREO_MODE preferred = GetPreferredPlaybackMode(); +- RENDER_STEREO_MODE playing = GetStereoModeOfPlayingVideo(); +- + int idx_playing = -1 + , idx_mono = -1; + +@@ -488,7 +508,7 @@ void CStereoscopicsManager::OnPlaybackStarted(void) + + idx_mono = pDlgSelect->Add(GetLabelForStereoMode(RENDER_STEREO_MODE_MONO)); // mono / 2d + +- if(playing != RENDER_STEREO_MODE_OFF && playing != preferred && g_Windowing.SupportsStereo(playing)) ++ if (playing != RENDER_STEREO_MODE_OFF && playing != preferred && preferred != RENDER_STEREO_MODE_AUTO && g_Windowing.SupportsStereo(playing)) // same as movie + idx_playing = pDlgSelect->Add((CStdString)g_localizeStrings.Get(36532) + + " (" + + GetLabelForStereoMode(playing) +@@ -503,7 +523,7 @@ void CStereoscopicsManager::OnPlaybackStarted(void) + int iItem = pDlgSelect->GetSelectedLabel(); + if (iItem == idx_preferred) mode = preferred; + else if (iItem == idx_mono) mode = RENDER_STEREO_MODE_MONO; +- else if (iItem == idx_playing) mode = playing; ++ else if (iItem == idx_playing) mode = RENDER_STEREO_MODE_AUTO; + else if (iItem == idx_select) mode = GetStereoModeByUserChoice(); + + SetStereoMode(mode); +@@ -513,7 +533,7 @@ void CStereoscopicsManager::OnPlaybackStarted(void) + } + break; + case STEREOSCOPIC_PLAYBACK_MODE_PREFERRED: // Stereoscopic +- SetStereoMode( GetPreferredPlaybackMode() ); ++ SetStereoMode( preferred ); + break; + case 2: // Mono + SetStereoMode( RENDER_STEREO_MODE_MONO ); + +From 54147b9da63d18e41f87bc16a162c237fe70a67c Mon Sep 17 00:00:00 2001 +From: da-anda +Date: Sat, 16 Aug 2014 11:20:54 +0200 +Subject: [PATCH 097/104] remember user selected 3D modes between videos until + playback ended + +--- + xbmc/guilib/StereoscopicsManager.cpp | 79 ++++++++++++++++++++++++++---------- + xbmc/guilib/StereoscopicsManager.h | 6 ++- + xbmc/rendering/RenderSystem.h | 1 + + 3 files changed, 63 insertions(+), 23 deletions(-) + +diff --git a/xbmc/guilib/StereoscopicsManager.cpp b/xbmc/guilib/StereoscopicsManager.cpp +index b013942..3db8eaa 100644 +--- a/xbmc/guilib/StereoscopicsManager.cpp ++++ b/xbmc/guilib/StereoscopicsManager.cpp +@@ -95,7 +95,8 @@ static const struct StereoModeMap StringToGuiModeMap[] = + + CStereoscopicsManager::CStereoscopicsManager(void) + { +- m_lastStereoMode = RENDER_STEREO_MODE_OFF; ++ m_stereoModeSetByUser = RENDER_STEREO_MODE_UNDEFINED; ++ m_lastStereoModeSetByUser = RENDER_STEREO_MODE_UNDEFINED; + } + + CStereoscopicsManager::~CStereoscopicsManager(void) +@@ -110,7 +111,6 @@ CStereoscopicsManager& CStereoscopicsManager::Get(void) + + void CStereoscopicsManager::Initialize(void) + { +- m_lastStereoMode = GetStereoMode(); + // turn off stereo mode on XBMC startup + SetStereoMode(RENDER_STEREO_MODE_OFF); + } +@@ -120,6 +120,16 @@ RENDER_STEREO_MODE CStereoscopicsManager::GetStereoMode(void) + return (RENDER_STEREO_MODE) CSettings::Get().GetInt("videoscreen.stereoscopicmode"); + } + ++void CStereoscopicsManager::SetStereoModeByUser(const RENDER_STEREO_MODE &mode) ++{ ++ // only update last user mode if desired mode is different from current ++ if (mode != m_stereoModeSetByUser) ++ m_lastStereoModeSetByUser = m_stereoModeSetByUser; ++ ++ m_stereoModeSetByUser = mode; ++ SetStereoMode(mode); ++} ++ + void CStereoscopicsManager::SetStereoMode(const RENDER_STEREO_MODE &mode) + { + RENDER_STEREO_MODE currentMode = GetStereoMode(); +@@ -138,7 +148,6 @@ void CStereoscopicsManager::SetStereoMode(const RENDER_STEREO_MODE &mode) + { + if (!g_Windowing.SupportsStereo(applyMode)) + return; +- m_lastStereoMode = currentMode; + CSettings::Get().SetInt("videoscreen.stereoscopicmode", applyMode); + } + } +@@ -384,46 +393,65 @@ bool CStereoscopicsManager::OnAction(const CAction &action) + + if (action.GetID() == ACTION_STEREOMODE_NEXT) + { +- SetStereoMode(GetNextSupportedStereoMode(mode)); ++ SetStereoModeByUser(GetNextSupportedStereoMode(mode)); + return true; + } + else if (action.GetID() == ACTION_STEREOMODE_PREVIOUS) + { +- SetStereoMode(GetNextSupportedStereoMode(mode, RENDER_STEREO_MODE_COUNT - 1)); ++ SetStereoModeByUser(GetNextSupportedStereoMode(mode, RENDER_STEREO_MODE_COUNT - 1)); + return true; + } + else if (action.GetID() == ACTION_STEREOMODE_TOGGLE) + { + if (mode == RENDER_STEREO_MODE_OFF) + { +- RENDER_STEREO_MODE targetMode = m_lastStereoMode; +- if (targetMode == RENDER_STEREO_MODE_OFF) +- targetMode = GetPreferredPlaybackMode(); +- SetStereoMode(targetMode); ++ RENDER_STEREO_MODE targetMode = GetPreferredPlaybackMode(); ++ ++ // if user selected a specific mode before, make sure to ++ // switch back into that mode on toggle. ++ if (m_stereoModeSetByUser != RENDER_STEREO_MODE_UNDEFINED) ++ { ++ // if user mode is set to OFF, he manually turned it off before. In this case use the last user applied mode ++ if (m_stereoModeSetByUser != RENDER_STEREO_MODE_OFF) ++ targetMode = m_stereoModeSetByUser; ++ else if (m_lastStereoModeSetByUser != RENDER_STEREO_MODE_UNDEFINED && m_lastStereoModeSetByUser != RENDER_STEREO_MODE_OFF) ++ targetMode = m_lastStereoModeSetByUser; ++ } ++ ++ SetStereoModeByUser(targetMode); + } + else + { +- SetStereoMode(RENDER_STEREO_MODE_OFF); ++ SetStereoModeByUser(RENDER_STEREO_MODE_OFF); + } + return true; + } + else if (action.GetID() == ACTION_STEREOMODE_SELECT) + { +- SetStereoMode(GetStereoModeByUserChoice()); ++ SetStereoModeByUser(GetStereoModeByUserChoice()); + return true; + } + else if (action.GetID() == ACTION_STEREOMODE_TOMONO) + { + if (mode == RENDER_STEREO_MODE_MONO) + { +- RENDER_STEREO_MODE targetMode = m_lastStereoMode; +- if (targetMode == RENDER_STEREO_MODE_OFF) +- targetMode = GetPreferredPlaybackMode(); +- SetStereoMode(targetMode); ++ RENDER_STEREO_MODE targetMode = GetPreferredPlaybackMode(); ++ ++ // if we have an old userdefined steremode, use that one as toggle target ++ if (m_stereoModeSetByUser != RENDER_STEREO_MODE_UNDEFINED) ++ { ++ // if user mode is set to OFF, he manually turned it off before. In this case use the last user applied mode ++ if (m_stereoModeSetByUser != RENDER_STEREO_MODE_OFF && m_stereoModeSetByUser != mode) ++ targetMode = m_stereoModeSetByUser; ++ else if (m_lastStereoModeSetByUser != RENDER_STEREO_MODE_UNDEFINED && m_lastStereoModeSetByUser != RENDER_STEREO_MODE_OFF && m_lastStereoModeSetByUser != mode) ++ targetMode = m_lastStereoModeSetByUser; ++ } ++ ++ SetStereoModeByUser(targetMode); + } + else + { +- SetStereoMode(RENDER_STEREO_MODE_MONO); ++ SetStereoModeByUser(RENDER_STEREO_MODE_MONO); + } + return true; + } +@@ -431,7 +459,7 @@ bool CStereoscopicsManager::OnAction(const CAction &action) + { + int stereoMode = ConvertStringToGuiStereoMode(action.GetName()); + if (stereoMode > -1) +- SetStereoMode( (RENDER_STEREO_MODE) stereoMode); ++ SetStereoModeByUser( (RENDER_STEREO_MODE) stereoMode ); + return true; + } + +@@ -469,6 +497,13 @@ void CStereoscopicsManager::OnPlaybackStarted(void) + return; + } + ++ // if we're not in stereomode yet, restore previously selected stereo mode in case it was user selected ++ if (m_stereoModeSetByUser != RENDER_STEREO_MODE_UNDEFINED) ++ { ++ SetStereoMode(m_stereoModeSetByUser); ++ return; ++ } ++ + RENDER_STEREO_MODE preferred = GetPreferredPlaybackMode(); + RENDER_STEREO_MODE playing = GetStereoModeOfPlayingVideo(); + +@@ -526,7 +561,7 @@ void CStereoscopicsManager::OnPlaybackStarted(void) + else if (iItem == idx_playing) mode = RENDER_STEREO_MODE_AUTO; + else if (iItem == idx_select) mode = GetStereoModeByUserChoice(); + +- SetStereoMode(mode); ++ SetStereoModeByUser( mode ); + } + + CApplicationMessenger::Get().MediaUnPause(); +@@ -546,8 +581,10 @@ void CStereoscopicsManager::OnPlaybackStarted(void) + void CStereoscopicsManager::OnPlaybackStopped(void) + { + RENDER_STEREO_MODE mode = GetStereoMode(); +- if (CSettings::Get().GetBool("videoplayer.quitstereomodeonstop") == true && mode != RENDER_STEREO_MODE_OFF) +- { ++ if (CSettings::Get().GetBool("videoplayer.quitstereomodeonstop") && mode != RENDER_STEREO_MODE_OFF) + SetStereoMode(RENDER_STEREO_MODE_OFF); +- } ++ // reset user modes on playback end to start over new on next playback and not end up in a probably unwanted mode ++ if (m_stereoModeSetByUser != RENDER_STEREO_MODE_OFF) ++ m_lastStereoModeSetByUser = m_stereoModeSetByUser; ++ m_stereoModeSetByUser = RENDER_STEREO_MODE_UNDEFINED; + } +diff --git a/xbmc/guilib/StereoscopicsManager.h b/xbmc/guilib/StereoscopicsManager.h +index 422cba2..6e9c36d 100644 +--- a/xbmc/guilib/StereoscopicsManager.h ++++ b/xbmc/guilib/StereoscopicsManager.h +@@ -54,8 +54,9 @@ class CStereoscopicsManager : public ISettingCallback, + static CStereoscopicsManager& Get(void); + + void Initialize(void); +- void SetStereoMode(const RENDER_STEREO_MODE &mode); + RENDER_STEREO_MODE GetStereoMode(void); ++ void SetStereoModeByUser(const RENDER_STEREO_MODE &mode); ++ void SetStereoMode(const RENDER_STEREO_MODE &mode); + RENDER_STEREO_MODE GetNextSupportedStereoMode(const RENDER_STEREO_MODE ¤tMode, int step = 1); + std::string DetectStereoModeByString(const std::string &needle); + RENDER_STEREO_MODE GetStereoModeByUserChoice(const CStdString &heading = ""); +@@ -92,5 +93,6 @@ class CStereoscopicsManager : public ISettingCallback, + void OnPlaybackStarted(void); + void OnPlaybackStopped(void); + +- RENDER_STEREO_MODE m_lastStereoMode; ++ RENDER_STEREO_MODE m_stereoModeSetByUser; ++ RENDER_STEREO_MODE m_lastStereoModeSetByUser; + }; +diff --git a/xbmc/rendering/RenderSystem.h b/xbmc/rendering/RenderSystem.h +index c1dfb93..cb54bd0 100644 +--- a/xbmc/rendering/RenderSystem.h ++++ b/xbmc/rendering/RenderSystem.h +@@ -81,6 +81,7 @@ enum RENDER_STEREO_MODE + + // psuevdo modes + RENDER_STEREO_MODE_AUTO = 100, ++ RENDER_STEREO_MODE_UNDEFINED = 999, + }; + + + +From 8a3efec846daa70e9cf64bbdf0e725c927ca7698 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 28 Sep 2014 12:13:37 +0100 +Subject: [PATCH 098/104] [mmalrenderer] Always use higher buffer_num. Avoids + an ENOMEM failure + +--- + xbmc/cores/VideoRenderers/MMALRenderer.cpp | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +index 6c4636e..fdeabf4 100644 +--- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp ++++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +@@ -100,10 +100,7 @@ bool CMMALRenderer::init_vout(MMAL_ES_FORMAT_T *format) + return false; + } + +- if (m_format == RENDER_FMT_YUV420P) +- m_vout_input->buffer_num = NUM_BUFFERS; +- else +- m_vout_input->buffer_num = m_vout_input->buffer_num_min; ++ m_vout_input->buffer_num = NUM_BUFFERS; + m_vout_input->buffer_size = m_vout_input->buffer_size_recommended; + + status = mmal_port_enable(m_vout_input, vout_input_port_cb_static); + +From 22afde57a22b2c9dd2bdb82ab76dd2c8a5a136d0 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 28 Sep 2014 12:35:59 +0100 +Subject: [PATCH 099/104] squash: boost centre + +--- + xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp +index a9a03ce..bb60f9d 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp +@@ -23,6 +23,7 @@ + #if !defined(TARGET_RASPBERRY_PI) + + #include "ActiveAEResample.h" ++#include "settings/Settings.h" + #include "utils/log.h" + + extern "C" { + +From fb7eaeb3a030f53e0458b2e380c1a01b0d437f32 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 28 Sep 2014 16:20:28 +0100 +Subject: [PATCH 100/104] [omxplayer] Fix bad audio when sample_fmt is not + reported on Open + +For most codecs ffmpeg reports m_pCodecContext->sample_fmt on the avcodec_open2 call (e.g. ac3, dts, aac). +However some (PCM on dvd) report AV_SAMPLE_FMT_NONE on open, and only provide the correct format on decode. + +This can cause the GetBitsPerSample call to change between open and decode and results in white noise when the word size is misinterpreted. + +The simple solution is to always convert to float when open doesn't report the format and ensure GetBitsPerSample reports this value +--- + xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp b/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp +index ffbaf56..94b673e 100644 +--- a/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp ++++ b/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp +@@ -302,7 +302,7 @@ int COMXAudioCodecOMX::GetBitsPerSample() + { + if (!m_pCodecContext) + return 0; +- return m_pCodecContext->sample_fmt == AV_SAMPLE_FMT_S16 ? 16 : 32; ++ return m_desiredSampleFormat == AV_SAMPLE_FMT_S16 ? 16 : 32; + } + + int COMXAudioCodecOMX::GetBitRate() + +From 061846bbd7f9b8c63bd1ba593bc5276a0774aeee Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 28 Sep 2014 17:35:31 +0100 +Subject: [PATCH 101/104] [renderer] Avoid warning for too few buffers with + bypass renderer + +Bypass renderer doesn't use a video render queue, so shouldn't generate a warning message +--- + xbmc/cores/VideoRenderers/RenderManager.cpp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp +index e72d791..b02f368 100644 +--- a/xbmc/cores/VideoRenderers/RenderManager.cpp ++++ b/xbmc/cores/VideoRenderers/RenderManager.cpp +@@ -270,7 +270,8 @@ bool CXBMCRenderManager::Configure(unsigned int width, unsigned int height, unsi + if(m_QueueSize < 2) + { + m_QueueSize = 2; +- CLog::Log(LOGWARNING, "CXBMCRenderManager::Configure - queue size too small (%d, %d, %d)", m_QueueSize, renderbuffers, buffers); ++ if (m_format != RENDER_FMT_BYPASS) ++ CLog::Log(LOGWARNING, "CXBMCRenderManager::Configure - queue size too small (%d, %d, %d)", m_QueueSize, renderbuffers, buffers); + } + + m_pRenderer->SetBufferSize(m_QueueSize); + +From 11091ce1c1679e07780ecaaffd088166d2561c04 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 28 Sep 2014 18:55:25 +0100 +Subject: [PATCH 102/104] [mmalrenderer] squash: Remove GetProcessorSize + +--- + xbmc/cores/VideoRenderers/MMALRenderer.cpp | 8 -------- + xbmc/cores/VideoRenderers/MMALRenderer.h | 1 - + 2 files changed, 9 deletions(-) + +diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +index fdeabf4..1e73649 100644 +--- a/xbmc/cores/VideoRenderers/MMALRenderer.cpp ++++ b/xbmc/cores/VideoRenderers/MMALRenderer.cpp +@@ -577,14 +577,6 @@ EINTERLACEMETHOD CMMALRenderer::AutoInterlaceMethod() + return VS_INTERLACEMETHOD_DEINTERLACE_HALF; + } + +-unsigned int CMMALRenderer::GetProcessorSize() +-{ +- if (m_format == RENDER_FMT_MMAL) +- return 1; +- else +- return 0; +-} +- + void CMMALRenderer::SetVideoRect(const CRect& InSrcRect, const CRect& InDestRect) + { + // we get called twice a frame for left/right. Can ignore the rights. +diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.h b/xbmc/cores/VideoRenderers/MMALRenderer.h +index 8cff140..952c154 100644 +--- a/xbmc/cores/VideoRenderers/MMALRenderer.h ++++ b/xbmc/cores/VideoRenderers/MMALRenderer.h +@@ -87,7 +87,6 @@ class CMMALRenderer : public CBaseRenderer, public CThread + + virtual void SetBufferSize(int numBuffers) { m_NumYV12Buffers = numBuffers; } + virtual unsigned int GetMaxBufferSize() { return NUM_BUFFERS; } +- virtual unsigned int GetProcessorSize(); + virtual void SetVideoRect(const CRect& SrcRect, const CRect& DestRect); + + void vout_input_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer); + +From 19e595cb97adbe1f1bce0fefc66db7c90492f8ed Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 28 Sep 2014 17:03:49 +0100 +Subject: [PATCH 103/104] [mmal] Increase number of render buffers + +--- + xbmc/cores/VideoRenderers/MMALRenderer.h | 2 ++ + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 2 +- + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 3 ++- + 3 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.h b/xbmc/cores/VideoRenderers/MMALRenderer.h +index 952c154..3488ce0 100644 +--- a/xbmc/cores/VideoRenderers/MMALRenderer.h ++++ b/xbmc/cores/VideoRenderers/MMALRenderer.h +@@ -31,6 +31,7 @@ + #include "cores/dvdplayer/DVDStreamInfo.h" + #include "guilib/Geometry.h" + #include "threads/Thread.h" ++#include "BaseRenderer.h" + + #include + #include +@@ -87,6 +88,7 @@ class CMMALRenderer : public CBaseRenderer, public CThread + + virtual void SetBufferSize(int numBuffers) { m_NumYV12Buffers = numBuffers; } + virtual unsigned int GetMaxBufferSize() { return NUM_BUFFERS; } ++ virtual unsigned int GetOptimalBufferSize() { return NUM_BUFFERS; } + virtual void SetVideoRect(const CRect& SrcRect, const CRect& DestRect); + + void vout_input_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer); +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +index 10af56f..69e36d8 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +@@ -619,7 +619,7 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVide + if (status != MMAL_SUCCESS) + CLog::Log(LOGERROR, "%s::%s Failed to disable error concealment on %s (status=%x %s)", CLASSNAME, __func__, m_dec_input->name, status, mmal_status_to_string(status)); + +- status = mmal_port_parameter_set_uint32(m_dec_input, MMAL_PARAMETER_EXTRA_BUFFERS, 5); ++ status = mmal_port_parameter_set_uint32(m_dec_input, MMAL_PARAMETER_EXTRA_BUFFERS, NUM_BUFFERS); + if (status != MMAL_SUCCESS) + CLog::Log(LOGERROR, "%s::%s Failed to enable extra buffers on %s (status=%x %s)", CLASSNAME, __func__, m_dec_input->name, status, mmal_status_to_string(status)); + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +index ef83a65..96573c6 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +@@ -39,6 +39,7 @@ + #include "utils/StdString.h" + #include "guilib/Geometry.h" + #include "rendering/RenderSystem.h" ++#include "cores/VideoRenderers/BaseRenderer.h" + + class CMMALVideo; + typedef boost::shared_ptr MMALVideoPtr; +@@ -85,7 +86,7 @@ class CMMALVideo + virtual void Reset(void); + virtual bool GetPicture(DVDVideoPicture *pDvdVideoPicture); + virtual bool ClearPicture(DVDVideoPicture* pDvdVideoPicture); +- virtual unsigned GetAllowedReferences() { return 2; } ++ virtual unsigned GetAllowedReferences() { return NUM_BUFFERS; } + virtual void SetDropState(bool bDrop); + virtual const char* GetName(void) { return (const char*)m_pFormatName; } + virtual bool GetCodecStats(double &pts, int &droppedPics); + +From 35b513bf8db50180ae889f4214b0073565737a5e Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 28 Sep 2014 19:28:17 +0100 +Subject: [PATCH 104/104] [mmalcodec] Introduce a preroll period to buffer up + frames on startup + +--- + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 21 +++++++++++++-------- + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 1 + + 2 files changed, 14 insertions(+), 8 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +index 69e36d8..b77e9e2 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +@@ -135,6 +135,7 @@ CMMALVideo::CMMALVideo() + m_output_busy = 0; + m_demux_queue_length = 0; + m_es_format = mmal_format_alloc(); ++ m_preroll = true; + } + + CMMALVideo::~CMMALVideo() +@@ -689,6 +690,7 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVide + + m_drop_state = false; + m_startframe = false; ++ m_preroll = !m_hints.stills; + + return true; + } +@@ -899,24 +901,26 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) + break; + } + int ret = 0; +- if (!m_output_ready.empty()) ++ if (mmal_queue_length(m_dec_input_pool->queue) > 0 && !m_demux_queue_length) + { + #if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s - got output picture:%d", CLASSNAME, __func__, m_output_ready.size()); ++ CLog::Log(LOGDEBUG, "%s::%s - got space for output: demux_queue(%d) space(%d)", CLASSNAME, __func__, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size); + #endif +- ret |= VC_PICTURE; ++ ret |= VC_BUFFER; + } +- if (mmal_queue_length(m_dec_input_pool->queue) > 0 && !m_demux_queue_length) ++ else ++ m_preroll = false; ++ if (!m_output_ready.empty() && !m_preroll) + { + #if defined(MMAL_DEBUG_VERBOSE) +- CLog::Log(LOGDEBUG, "%s::%s - got space for output: demux_queue(%d) space(%d)", CLASSNAME, __func__, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size); ++ CLog::Log(LOGDEBUG, "%s::%s - got output picture:%d", CLASSNAME, __func__, m_output_ready.size()); + #endif +- ret |= VC_BUFFER; ++ ret |= VC_PICTURE; + } + if (!ret) + { +- CLog::Log(LOGDEBUG, "%s::%s - Nothing to do: dts_queue(%d) ready_queue(%d) busy_queue(%d) demux_queue(%d) space(%d)", +- CLASSNAME, __func__, m_dts_queue.size(), m_output_ready.size(), m_output_busy, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size); ++ CLog::Log(LOGDEBUG, "%s::%s - Nothing to do: dts_queue(%d) ready_queue(%d) busy_queue(%d) demux_queue(%d) space(%d) preroll(%d)", ++ CLASSNAME, __func__, m_dts_queue.size(), m_output_ready.size(), m_output_busy, m_demux_queue_length, mmal_queue_length(m_dec_input_pool->queue) * m_dec_input->buffer_size, m_preroll); + Sleep(10); // otherwise we busy spin + } + return ret; +@@ -960,6 +964,7 @@ void CMMALVideo::Reset(void) + m_decoderPts = DVD_NOPTS_VALUE; + m_droppedPics = 0; + m_decode_frame_number = 1; ++ m_preroll = !m_hints.stills; + } + + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +index 96573c6..99dcd7f 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +@@ -139,6 +139,7 @@ class CMMALVideo + unsigned int m_decode_frame_number; + double m_decoderPts; + unsigned int m_droppedPics; ++ bool m_preroll; + + MMAL_COMPONENT_T *m_dec; + MMAL_PORT_T *m_dec_input;