diff --git a/packages/mediacenter/kodi-theme-Confluence/package.mk b/packages/mediacenter/kodi-theme-Confluence/package.mk index c6174cad06..35ab7e0da4 100644 --- a/packages/mediacenter/kodi-theme-Confluence/package.mk +++ b/packages/mediacenter/kodi-theme-Confluence/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="kodi-theme-Confluence" -PKG_VERSION="14-6acca80" +PKG_VERSION="14-2d88a9a" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/kodi/package.mk b/packages/mediacenter/kodi/package.mk index f8390239fe..0359992c96 100644 --- a/packages/mediacenter/kodi/package.mk +++ b/packages/mediacenter/kodi/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="kodi" -PKG_VERSION="14-6acca80" +PKG_VERSION="14-2d88a9a" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" diff --git a/packages/mediacenter/kodi/patches/kodi-995.01-fernetmenta.patch b/packages/mediacenter/kodi/patches/kodi-995.01-fernetmenta.patch index 9b171f4a2d..a546ecce9a 100644 --- a/packages/mediacenter/kodi/patches/kodi-995.01-fernetmenta.patch +++ b/packages/mediacenter/kodi/patches/kodi-995.01-fernetmenta.patch @@ -1,18 +1,18 @@ -From 48428057ad993372a2ab509c5b24fd82976130db Mon Sep 17 00:00:00 2001 +From 30460a1c4259c3b3591349a894dc51ccbd22fd2b Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 28 May 2012 10:34:39 +0200 -Subject: [PATCH 01/23] videoplayer: adapt lateness detection and dropping to +Subject: [PATCH 01/24] videoplayer: adapt lateness detection and dropping to buffering --- xbmc/cores/VideoRenderers/RenderManager.cpp | 16 +- xbmc/cores/VideoRenderers/RenderManager.h | 12 +- - .../dvdplayer/DVDCodecs/Video/DVDVideoCodec.h | 38 +++- + .../dvdplayer/DVDCodecs/Video/DVDVideoCodec.h | 40 ++++- .../DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 41 +++++ .../DVDCodecs/Video/DVDVideoCodecFFmpeg.h | 7 + xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 199 ++++++++++++++++----- xbmc/cores/dvdplayer/DVDPlayerVideo.h | 23 ++- - 7 files changed, 288 insertions(+), 48 deletions(-) + 7 files changed, 290 insertions(+), 48 deletions(-) diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp index 529f62f..1ecdc16 100644 @@ -114,16 +114,16 @@ index c438651..d3c2f1d 100644 double m_presenterr; double m_errorbuff[ERRORBUFFSIZE]; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h -index 0386abb..e80358f 100644 +index 0386abb..1dd7590 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h @@ -149,6 +149,10 @@ struct DVDVideoUserData #define DVP_FLAG_NOSKIP 0x00000010 // indicate this picture should never be dropped #define DVP_FLAG_DROPPED 0x00000020 // indicate that this picture has been dropped in decoder stage, will have no data -+#define DVP_FLAG_DROPDEINT 0x00000040 // indicate that this picture was requested to have been dropped in deint stage -+#define DVP_FLAG_NO_POSTPROC 0x00000100 // see GetCodecStats -+#define DVP_FLAG_DRAIN 0x00000200 // see GetCodecStats ++#define DVD_CODEC_CTRL_SKIPDEINT 0x01000000 // indicate that this picture was requested to have been dropped in deint stage ++#define DVD_CODEC_CTRL_NO_POSTPROC 0x02000000 // see GetCodecStats ++#define DVD_CODEC_CTRL_DRAIN 0x04000000 // see GetCodecStats + // DVP_FLAG 0x00000100 - 0x00000f00 is in use by libmpeg2! @@ -145,7 +145,7 @@ index 0386abb..e80358f 100644 /** * Number of references to old pictures that are allowed to * be retained when calling decode on the next demux packet -@@ -300,4 +305,35 @@ class CDVDVideoCodec +@@ -300,4 +305,37 @@ class CDVDVideoCodec * Interact with user settings so that user disabled codecs are disabled */ static bool IsCodecDisabled(DVDCodecAvailableType* map, unsigned int size, AVCodecID id); @@ -169,10 +169,12 @@ index 0386abb..e80358f 100644 + /** + * Codec can be informed by player with the following flags: + * -+ * DVP_FLAG_NO_POSTPROC : if speed is not normal the codec can switch off -+ * postprocessing and de-interlacing ++ * DVD_CODEC_CTRL_NO_POSTPROC : ++ * if speed is not normal the codec can switch off ++ * postprocessing and de-interlacing + * -+ * DVP_FLAG_DRAIN : codecs may do postprocessing and de-interlacing. ++ * DVD_CODEC_CTRL_DRAIN : ++ * codecs may do postprocessing and de-interlacing. + * If video buffers in RenderManager are about to run dry, + * this is signaled to codec. Codec can wait for post-proc + * to be finished instead of returning empty and getting another @@ -182,7 +184,7 @@ index 0386abb..e80358f 100644 + virtual void SetCodecControl(int flags) {} }; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -index 0c4f0e5..2d955c2 100644 +index 0c4f0e5..84b1eff 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp @@ -173,6 +173,7 @@ CDVDVideoCodecFFmpeg::CDVDVideoCodecFFmpeg() : CDVDVideoCodec() @@ -227,7 +229,7 @@ index 0c4f0e5..2d955c2 100644 + + if (m_requestSkipDeint) + { -+ pDvdVideoPicture->iFlags |= DVP_FLAG_DROPDEINT; ++ pDvdVideoPicture->iFlags |= DVD_CODEC_CTRL_SKIPDEINT; + m_skippedDeint = 1; + } + else @@ -289,7 +291,7 @@ index 1f564bb..48564d1 100644 + int m_codecControlFlags; }; diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 5a758ab..e0bb4d0 100644 +index 5a758ab..c3db6ba 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -38,6 +38,7 @@ @@ -367,9 +369,9 @@ index 5a758ab..e0bb4d0 100644 + } + int codecControl = 0; + if (iDropDirective & EOS_BUFFER_LEVEL) -+ codecControl |= DVP_FLAG_DRAIN; ++ codecControl |= DVD_CODEC_CTRL_DRAIN; + if (m_speed > DVD_PLAYSPEED_NORMAL) -+ codecControl |= DVP_FLAG_NO_POSTPROC; ++ codecControl |= DVD_CODEC_CTRL_NO_POSTPROC; + m_pVideoCodec->SetCodecControl(codecControl); + if (iDropDirective & EOS_DROPPED) + { @@ -510,7 +512,7 @@ index 5a758ab..e0bb4d0 100644 + m_droppingStats.m_dropRequests = 0; + CLog::Log(LOGDEBUG,"CDVDPlayerVideo::CalcDropRequirement - dropped pictures, Sleeptime: %f, Bufferlevel: %d, Gain: %f", iSleepTime, iBufferLevel, iGain); + } -+ else if (iDroppedPics < 0 && iGain > 1/m_fFrameRate) ++ else if (iDroppedPics < 0 && iGain > (1/m_fFrameRate + 0.001)) + { + CDroppingStats::CGain gain; + gain.gain = iGain; @@ -643,10 +645,10 @@ index dcd0ffd..1f0e661 100644 }; -From d3979dfb41485a01d35de62105b2b9544f19f113 Mon Sep 17 00:00:00 2001 +From 2d14428010383f68e60acdfff79ed9fcba1030af Mon Sep 17 00:00:00 2001 From: xbmc Date: Sun, 2 Sep 2012 16:05:21 +0200 -Subject: [PATCH 02/23] video player: present correct pts to user for a/v sync +Subject: [PATCH 02/24] video player: present correct pts to user for a/v sync (after buffering in renderer) --- @@ -655,7 +657,7 @@ Subject: [PATCH 02/23] video player: present correct pts to user for a/v sync 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index e0bb4d0..43382b5 100644 +index c3db6ba..48f8f60 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -1451,6 +1451,22 @@ void CDVDPlayerVideo::ResetFrameRateCalc() @@ -695,10 +697,10 @@ index 1f0e661..a38a9c3 100644 double GetOutputDelay(); /* returns the expected delay, from that a packet is put in queue */ int GetDecoderFreeSpace() { return 0; } -From e766dcceb4930978a72f0119198c4bc872e988c9 Mon Sep 17 00:00:00 2001 +From 47b6e876f00601c7b15712be16a3e2f13e7aca91 Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 28 May 2012 10:41:31 +0200 -Subject: [PATCH 03/23] videoplayer: update frametime, it might change due to +Subject: [PATCH 03/24] videoplayer: update frametime, it might change due to fps detection --- @@ -706,7 +708,7 @@ Subject: [PATCH 03/23] videoplayer: update frametime, it might change due to 1 file changed, 2 insertions(+) diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index 43382b5..ec0c0eb 100644 +index 48f8f60..4f35e3a 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -705,6 +705,8 @@ void CDVDPlayerVideo::Process() @@ -719,34 +721,10 @@ index 43382b5..ec0c0eb 100644 { m_codecname = m_pVideoCodec->GetName(); -From 37e14f9e3bf28721741d43f7e31a46cf2d9ab0bc Mon Sep 17 00:00:00 2001 -From: xbmc -Date: Mon, 28 May 2012 10:43:06 +0200 -Subject: [PATCH 04/23] videoplayer: give streams with invalid fps a chance for - fps detection - ---- - xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index ec0c0eb..b2ee525 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -+++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1495,7 +1495,7 @@ void CDVDPlayerVideo::CalcFrameRate() - frameduration = m_pullupCorrection.GetMinFrameDuration(); - - if ((frameduration==DVD_NOPTS_VALUE) || -- ((g_advancedSettings.m_videoFpsDetect == 1) && ((m_pullupCorrection.GetPatternLength() > 1) && !m_pullupCorrection.VFRDetection()))) -+ ((g_advancedSettings.m_videoFpsDetect == 1) && ((m_pullupCorrection.GetPatternLength() > 1) && !m_pullupCorrection.VFRDetection() && !m_bFpsInvalid))) - { - //reset the stored framerates if no good framerate was detected - m_fStableFrameRate = 0.0; - -From aa89c7ec1c7108cfec60b2804f3297fa5043a480 Mon Sep 17 00:00:00 2001 +From 5acb9e7a7c70dc38ca18799d4908b96f242551dc Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 28 May 2012 10:49:05 +0200 -Subject: [PATCH 05/23] dvdplayer: allow rewinding at end of stream, do a seek +Subject: [PATCH 04/24] dvdplayer: allow rewinding at end of stream, do a seek after rewind --- @@ -780,10 +758,10 @@ index 63cbe66..f5f697e 100644 // audioplayer, stops outputing audio to audiorendere, but still tries to // sleep an correct amount for each packet -From 782c60b53a253d348b68ac74e3596820e673f431 Mon Sep 17 00:00:00 2001 +From 35a6e814939d4e4f900595f2b1efd5a2aa131ab0 Mon Sep 17 00:00:00 2001 From: xbmc Date: Mon, 20 Aug 2012 16:06:39 +0200 -Subject: [PATCH 06/23] dvdplayer: observe pts counter overflow +Subject: [PATCH 05/24] dvdplayer: observe pts counter overflow --- .../cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 197 ++++++++++++++++++++- @@ -791,7 +769,7 @@ Subject: [PATCH 06/23] dvdplayer: observe pts counter overflow 2 files changed, 199 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -index 81a511e..9626dae 100644 +index a9a8f0a..368de0e 100644 --- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp @@ -18,7 +18,6 @@ @@ -810,8 +788,8 @@ index 81a511e..9626dae 100644 #include "stdint.h" #endif #include "DVDDemuxFFmpeg.h" -@@ -476,6 +476,9 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput, bool streaminfo, bool filein - if (isMpegts && GetNrOfStreams() == 0) +@@ -477,6 +477,9 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput, bool streaminfo, bool filein + if (skipCreateStreams && GetNrOfStreams() == 0) m_program = 0; + m_bPtsWrapChecked = false; @@ -820,7 +798,7 @@ index 81a511e..9626dae 100644 return true; } -@@ -616,6 +619,12 @@ double CDVDDemuxFFmpeg::ConvertTimestamp(int64_t pts, int den, int num) +@@ -617,6 +620,12 @@ double CDVDDemuxFFmpeg::ConvertTimestamp(int64_t pts, int den, int num) if (pts == (int64_t)AV_NOPTS_VALUE) return DVD_NOPTS_VALUE; @@ -833,7 +811,7 @@ index 81a511e..9626dae 100644 // do calculations in floats as they can easily overflow otherwise // we don't care for having a completly exact timestamp anyway double timestamp = (double)pts * num / den; -@@ -762,6 +771,24 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() +@@ -763,6 +772,24 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() m_pkt.pkt.pts = AV_NOPTS_VALUE; } @@ -858,7 +836,7 @@ index 81a511e..9626dae 100644 // copy contents into our own packet pPacket->iSize = m_pkt.pkt.size; -@@ -895,7 +922,16 @@ bool CDVDDemuxFFmpeg::SeekTime(int time, bool backwords, double *startpts) +@@ -896,7 +923,16 @@ bool CDVDDemuxFFmpeg::SeekTime(int time, bool backwords, double *startpts) ret = av_seek_frame(m_pFormatContext, -1, seek_pts, backwords ? AVSEEK_FLAG_BACKWARD : 0); if(ret >= 0) @@ -874,8 +852,8 @@ index 81a511e..9626dae 100644 + } } - if(m_iCurrentPts == DVD_NOPTS_VALUE) -@@ -914,6 +950,165 @@ bool CDVDDemuxFFmpeg::SeekTime(int time, bool backwords, double *startpts) + if(m_currentPts == DVD_NOPTS_VALUE) +@@ -915,6 +951,165 @@ bool CDVDDemuxFFmpeg::SeekTime(int time, bool backwords, double *startpts) return (ret >= 0); } @@ -1042,7 +1020,7 @@ index 81a511e..9626dae 100644 { CSingleLock lock(m_critSection); diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h -index 48f0a69..bdc84b2 100644 +index c2f607d..b7daa34 100644 --- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h +++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h @@ -102,6 +102,7 @@ class CDVDDemuxFFmpeg : public CDVDDemux @@ -1062,10 +1040,10 @@ index 48f0a69..bdc84b2 100644 }; -From f2d82a63baea6ab7324eeca1a3161318db7abbf4 Mon Sep 17 00:00:00 2001 +From eb6c9ab05b9e11f9fba0ec2187102dbf50b48e47 Mon Sep 17 00:00:00 2001 From: xbmc Date: Tue, 2 Oct 2012 13:02:10 +0200 -Subject: [PATCH 07/23] dvdplayer: avoid short screen flicker caused by +Subject: [PATCH 06/24] dvdplayer: avoid short screen flicker caused by unnecessary reconfigure of renderer --- @@ -1073,7 +1051,7 @@ Subject: [PATCH 07/23] dvdplayer: avoid short screen flicker caused by 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index b2ee525..aef2635 100644 +index 4f35e3a..4c0551d 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -1052,13 +1052,16 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) @@ -1095,10 +1073,10 @@ index b2ee525..aef2635 100644 || ( m_output.extended_format != pPicture->extended_format ) || ( m_output.color_matrix != pPicture->color_matrix && pPicture->color_matrix != 0 ) // don't reconfigure on unspecified -From 28a8600a537cdb87495baf7f7b98dbdd97e57d97 Mon Sep 17 00:00:00 2001 +From 8a105d14b71c550128a2bb45a2e620992161ea28 Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 11 Oct 2012 12:05:50 +0200 -Subject: [PATCH 08/23] vdpau: advanced settings for auto deinterlacing +Subject: [PATCH 07/24] vdpau: advanced settings for auto deinterlacing --- xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 8 ++++---- @@ -1161,18 +1139,18 @@ index 7df586e..eccd25c 100644 bool m_videoVDPAUdeintSkipChromaHD; bool m_musicUseTimeSeeking; -From 3b3bdcac20a65cea8bed5de0a90cae5d8c13edf5 Mon Sep 17 00:00:00 2001 +From 399576b60dda39f175c8e06b7f53be5a61e6417f Mon Sep 17 00:00:00 2001 From: xbmc Date: Fri, 2 Nov 2012 13:20:03 +0100 -Subject: [PATCH 09/23] player: fix rewind +Subject: [PATCH 08/24] player: fix rewind --- - xbmc/cores/dvdplayer/DVDMessage.h | 5 ++++- - xbmc/cores/dvdplayer/DVDPlayer.cpp | 30 +++++++++++++++++++----------- - xbmc/cores/dvdplayer/DVDPlayer.h | 7 ++++--- - xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 4 +++- + xbmc/cores/dvdplayer/DVDMessage.h | 5 +++- + xbmc/cores/dvdplayer/DVDPlayer.cpp | 41 ++++++++++++++++++++++----------- + xbmc/cores/dvdplayer/DVDPlayer.h | 8 ++++--- + xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 18 ++++++++++++++- xbmc/cores/dvdplayer/DVDPlayerVideo.h | 1 + - 5 files changed, 31 insertions(+), 16 deletions(-) + 5 files changed, 55 insertions(+), 18 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDMessage.h b/xbmc/cores/dvdplayer/DVDMessage.h index a365821..07366df 100644 @@ -1212,10 +1190,18 @@ index a365821..07366df 100644 class CDVDMsgPlayerSeekChapter : public CDVDMsg diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index f5f697e..7eb564a 100644 +index f5f697e..60dab1f 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -1794,11 +1794,13 @@ void CDVDPlayer::HandlePlaySpeed() +@@ -590,6 +590,7 @@ bool CDVDPlayer::OpenFile(const CFileItem& file, const CPlayerOptions &options) + SetPlaySpeed(DVD_PLAYSPEED_NORMAL); + + m_State.Clear(); ++ memset(&m_SpeedState, 0, sizeof(m_SpeedState)); + m_UpdateApplication = 0; + m_offset_pts = 0; + m_CurrentAudio.originaldts = DVD_NOPTS_VALUE; +@@ -1794,11 +1795,13 @@ void CDVDPlayer::HandlePlaySpeed() } else if (m_CurrentVideo.id >= 0 && (m_CurrentVideo.inited == true || GetPlaySpeed() < 0) // allow rewind at end of file @@ -1230,16 +1216,26 @@ index f5f697e..7eb564a 100644 // check how much off clock video is when ff/rw:ing // a problem here is that seeking isn't very accurate // and since the clock will be resynced after seek -@@ -1817,7 +1819,7 @@ void CDVDPlayer::HandlePlaySpeed() +@@ -1815,9 +1818,15 @@ void CDVDPlayer::HandlePlaySpeed() + + if(error > DVD_MSEC_TO_TIME(1000)) { - CLog::Log(LOGDEBUG, "CDVDPlayer::Process - Seeking to catch up"); - int64_t iTime = (int64_t)DVD_TIME_TO_MSEC(m_clock.GetClock() + m_State.time_offset + 500000.0 * m_playSpeed / DVD_PLAYSPEED_NORMAL); +- CLog::Log(LOGDEBUG, "CDVDPlayer::Process - Seeking to catch up"); +- int64_t iTime = (int64_t)DVD_TIME_TO_MSEC(m_clock.GetClock() + m_State.time_offset + 500000.0 * m_playSpeed / DVD_PLAYSPEED_NORMAL); - m_messenger.Put(new CDVDMsgPlayerSeek((int) iTime, (GetPlaySpeed() < 0), true, false, false, true)); -+ m_messenger.Put(new CDVDMsgPlayerSeek((int) iTime, (GetPlaySpeed() < 0), true, false, false, true, false)); ++ error = (int)DVD_TIME_TO_MSEC(m_clock.GetClock()) - m_SpeedState.lastseekpts; ++ ++ if(abs(error) > 1000) ++ { ++ CLog::Log(LOGDEBUG, "CDVDPlayer::Process - Seeking to catch up"); ++ m_SpeedState.lastseekpts = (int)DVD_TIME_TO_MSEC(m_clock.GetClock()); ++ int iTime = DVD_TIME_TO_MSEC(m_clock.GetClock() + m_State.time_offset + 500000.0 * m_playSpeed / DVD_PLAYSPEED_NORMAL); ++ m_messenger.Put(new CDVDMsgPlayerSeek(iTime, (GetPlaySpeed() < 0), true, false, false, true, false)); ++ } } } } -@@ -2289,7 +2291,7 @@ void CDVDPlayer::HandleMessages() +@@ -2289,7 +2298,7 @@ void CDVDPlayer::HandleMessages() else m_StateInput.dts = start; @@ -1248,7 +1244,7 @@ index f5f697e..7eb564a 100644 } else CLog::Log(LOGWARNING, "error while seeking"); -@@ -2425,9 +2427,10 @@ void CDVDPlayer::HandleMessages() +@@ -2425,9 +2434,10 @@ void CDVDPlayer::HandleMessages() double offset; offset = CDVDClock::GetAbsoluteClock() - m_State.timestamp; offset *= m_playSpeed / DVD_PLAYSPEED_NORMAL; @@ -1260,7 +1256,7 @@ index f5f697e..7eb564a 100644 m_State.timestamp = CDVDClock::GetAbsoluteClock(); } -@@ -2443,7 +2446,8 @@ void CDVDPlayer::HandleMessages() +@@ -2443,7 +2453,8 @@ void CDVDPlayer::HandleMessages() // do a seek after rewind, clock is not in sync with current pts if (m_playSpeed < 0 && speed >= 0) { @@ -1270,7 +1266,7 @@ index f5f697e..7eb564a 100644 } // if playspeed is different then DVD_PLAYSPEED_NORMAL or DVD_PLAYSPEED_PAUSE -@@ -3414,7 +3418,7 @@ void CDVDPlayer::UpdateClockMaster() +@@ -3414,7 +3425,7 @@ void CDVDPlayer::UpdateClockMaster() } } @@ -1279,7 +1275,7 @@ index f5f697e..7eb564a 100644 { double startpts; if(accurate && !m_omxplayer_mode) -@@ -3426,19 +3430,23 @@ void CDVDPlayer::FlushBuffers(bool queued, double pts, bool accurate) +@@ -3426,19 +3437,23 @@ void CDVDPlayer::FlushBuffers(bool queued, double pts, bool accurate) if(startpts != DVD_NOPTS_VALUE) startpts -= m_offset_pts; @@ -1307,7 +1303,7 @@ index f5f697e..7eb564a 100644 m_CurrentTeletext.dts = DVD_NOPTS_VALUE; m_CurrentTeletext.startpts = startpts; -@@ -3482,7 +3490,7 @@ void CDVDPlayer::FlushBuffers(bool queued, double pts, bool accurate) +@@ -3482,7 +3497,7 @@ void CDVDPlayer::FlushBuffers(bool queued, double pts, bool accurate) m_CurrentTeletext.started = false; } @@ -1317,7 +1313,7 @@ index f5f697e..7eb564a 100644 UpdatePlayState(0); diff --git a/xbmc/cores/dvdplayer/DVDPlayer.h b/xbmc/cores/dvdplayer/DVDPlayer.h -index dac00e9..9bcfc02 100644 +index dac00e9..dbce0a0 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.h +++ b/xbmc/cores/dvdplayer/DVDPlayer.h @@ -339,7 +339,7 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer @@ -1329,7 +1325,7 @@ index dac00e9..9bcfc02 100644 void HandleMessages(); void HandlePlaySpeed(); -@@ -393,8 +393,9 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer +@@ -393,8 +393,10 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer int m_playSpeed; struct SSpeedState { @@ -1337,15 +1333,37 @@ index dac00e9..9bcfc02 100644 - double lasttime; + double lastpts; // holds last display pts during ff/rw operations + int64_t lasttime; ++ int lastseekpts; + double lastabstime; } m_SpeedState; int m_errorCount; diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index aef2635..bd97d62 100644 +index 4c0551d..0a4de2c 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1466,7 +1466,7 @@ double CDVDPlayerVideo::GetCurrentPts() +@@ -1160,6 +1160,20 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) + pts += m_iVideoDelay - DVD_SEC_TO_TIME(g_renderManager.GetDisplayLatency()); + } + ++ if (m_speed < 0) ++ { ++ double inputPts = m_droppingStats.m_lastPts; ++ double renderPts = m_droppingStats.m_lastRenderPts; ++ if (pts > renderPts) ++ { ++ if (inputPts >= renderPts) ++ { ++ Sleep(50); ++ } ++ return result | EOS_DROPPED; ++ } ++ } ++ + // calculate the time we need to delay this picture before displaying + double iSleepTime, iClockSleep, iFrameSleep, iPlayingClock, iCurrentClock; + +@@ -1466,7 +1480,7 @@ double CDVDPlayerVideo::GetCurrentPts() if( m_stalled ) iRenderPts = DVD_NOPTS_VALUE; @@ -1354,7 +1372,7 @@ index aef2635..bd97d62 100644 iRenderPts = iRenderPts - max(0.0, iSleepTime); return iRenderPts; -@@ -1567,6 +1567,8 @@ int CDVDPlayerVideo::CalcDropRequirement(double pts) +@@ -1567,6 +1581,8 @@ int CDVDPlayerVideo::CalcDropRequirement(double pts) int iDroppedPics = -1; int iBufferLevel; @@ -1376,17 +1394,17 @@ index a38a9c3..4e1b3d6 100644 unsigned int m_dropRequests; }; -From 3a6811a6f1672382882081e4a73961d69620ee71 Mon Sep 17 00:00:00 2001 +From 48438ffa62caf266c82ef33dcd10d58d914de8ae Mon Sep 17 00:00:00 2001 From: xbmc Date: Thu, 28 Mar 2013 20:50:59 +0100 -Subject: [PATCH 10/23] fix incorrect display of fps when dr kicks in +Subject: [PATCH 09/24] fix incorrect display of fps when dr kicks in --- xbmc/Application.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index d5604dc..1d7990d 100644 +index ee59549..338039e 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp @@ -2326,10 +2326,11 @@ void CApplication::Render() @@ -1403,10 +1421,10 @@ index d5604dc..1d7990d 100644 g_renderManager.UpdateResolution(); -From e3368368565f4266876bba560bfedaa5dcb978cd Mon Sep 17 00:00:00 2001 +From 47eea9d903f1bc98d4fb81365f40dcce508a3ae5 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Thu, 25 Jul 2013 17:18:13 +0200 -Subject: [PATCH 11/23] ActiveAE: slightly reduce buffer size +Subject: [PATCH 10/24] ActiveAE: slightly reduce buffer size --- xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 4 ++-- @@ -1428,10 +1446,10 @@ index 0e4d8da..99538dc 100644 void CEngineStats::Reset(unsigned int sampleRate) -From 52caa1299bb91e7807d24c28cdeb26b53186ca90 Mon Sep 17 00:00:00 2001 +From 55ccc433a49843001e8c2120aca2bc5ae245f521 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sun, 4 Aug 2013 10:11:16 +0200 -Subject: [PATCH 12/23] Revert "vdpau: comment some features that will be added +Subject: [PATCH 11/24] Revert "vdpau: comment some features that will be added later" This reverts commit e00b4f65864d623ab4d2e9e5c06db138e661f1cf. @@ -1484,17 +1502,17 @@ index 8c353af..33ec1f4 100644 m_mixersteps = 1; } -From 562200d01eaaf57f307a228b06360a5a3aa969fc Mon Sep 17 00:00:00 2001 +From e41a871e824620d5b2d7f59cec4bcabba66d75ec Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Tue, 28 Jan 2014 10:05:26 +0100 -Subject: [PATCH 13/23] xbmc pr 3080 +Subject: [PATCH 12/24] xbmc pr 3080 --- xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -index 2d955c2..245ef50 100644 +index 84b1eff..67f0e80 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp @@ -475,6 +475,14 @@ int CDVDVideoCodecFFmpeg::Decode(uint8_t* pData, int iSize, double dts, double p @@ -1513,10 +1531,10 @@ index 2d955c2..245ef50 100644 * Setting it correctly would allow CorePNG decoding. */ avpkt.flags = AV_PKT_FLAG_KEY; -From aad64950df2c09264bff2b96de02be539b3c4be0 Mon Sep 17 00:00:00 2001 +From 2c55fb28f8287d6fdc6dbca4b2f9dd2aea9fabe2 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Tue, 11 Feb 2014 18:15:06 +0100 -Subject: [PATCH 14/23] ActiveAE: add some debug logging +Subject: [PATCH 13/24] ActiveAE: add some debug logging --- xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp | 6 ++++++ @@ -1541,64 +1559,15 @@ index 96bce12..7bd9c9b 100644 return copied; } -From ec7b7635467812012195d432588068198e5afca9 Mon Sep 17 00:00:00 2001 +From 6c08bfc1b52f13e5a28aab3cf59bc780470c9fb8 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sat, 23 Aug 2014 11:42:31 +0200 -Subject: [PATCH 15/23] dvdplayer: rename codec ctrl flags +Subject: [PATCH 14/24] dvdplayer: rename codec ctrl flags --- - xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h | 14 ++++++++------ - .../dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 2 +- - xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 8 ++++---- - xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 4 ++-- - 4 files changed, 15 insertions(+), 13 deletions(-) + xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h -index e80358f..1dd7590 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodec.h -@@ -149,9 +149,9 @@ struct DVDVideoUserData - #define DVP_FLAG_NOSKIP 0x00000010 // indicate this picture should never be dropped - #define DVP_FLAG_DROPPED 0x00000020 // indicate that this picture has been dropped in decoder stage, will have no data - --#define DVP_FLAG_DROPDEINT 0x00000040 // indicate that this picture was requested to have been dropped in deint stage --#define DVP_FLAG_NO_POSTPROC 0x00000100 // see GetCodecStats --#define DVP_FLAG_DRAIN 0x00000200 // see GetCodecStats -+#define DVD_CODEC_CTRL_SKIPDEINT 0x01000000 // indicate that this picture was requested to have been dropped in deint stage -+#define DVD_CODEC_CTRL_NO_POSTPROC 0x02000000 // see GetCodecStats -+#define DVD_CODEC_CTRL_DRAIN 0x04000000 // see GetCodecStats - - // DVP_FLAG 0x00000100 - 0x00000f00 is in use by libmpeg2! - -@@ -325,10 +325,12 @@ class CDVDVideoCodec - /** - * Codec can be informed by player with the following flags: - * -- * DVP_FLAG_NO_POSTPROC : if speed is not normal the codec can switch off -- * postprocessing and de-interlacing -+ * DVD_CODEC_CTRL_NO_POSTPROC : -+ * if speed is not normal the codec can switch off -+ * postprocessing and de-interlacing - * -- * DVP_FLAG_DRAIN : codecs may do postprocessing and de-interlacing. -+ * DVD_CODEC_CTRL_DRAIN : -+ * codecs may do postprocessing and de-interlacing. - * If video buffers in RenderManager are about to run dry, - * this is signaled to codec. Codec can wait for post-proc - * to be finished instead of returning empty and getting another -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -index 245ef50..67f0e80 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -@@ -665,7 +665,7 @@ bool CDVDVideoCodecFFmpeg::GetPictureCommon(DVDVideoPicture* pDvdVideoPicture) - - if (m_requestSkipDeint) - { -- pDvdVideoPicture->iFlags |= DVP_FLAG_DROPDEINT; -+ pDvdVideoPicture->iFlags |= DVD_CODEC_CTRL_SKIPDEINT; - m_skippedDeint = 1; - } - else diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp index 33ec1f4..300b901 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp @@ -1639,27 +1608,11 @@ index 33ec1f4..300b901 100644 { m_mixersteps = 1; } -diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index bd97d62..d30a0ad 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -+++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -523,9 +523,9 @@ void CDVDPlayerVideo::Process() - } - int codecControl = 0; - if (iDropDirective & EOS_BUFFER_LEVEL) -- codecControl |= DVP_FLAG_DRAIN; -+ codecControl |= DVD_CODEC_CTRL_DRAIN; - if (m_speed > DVD_PLAYSPEED_NORMAL) -- codecControl |= DVP_FLAG_NO_POSTPROC; -+ codecControl |= DVD_CODEC_CTRL_NO_POSTPROC; - m_pVideoCodec->SetCodecControl(codecControl); - if (iDropDirective & EOS_DROPPED) - { -From a10235c233e6033b0aa684fe4089871a703b5746 Mon Sep 17 00:00:00 2001 +From dcf0b4a0d5a8786f31eac6ee0693ab83d9f27cbc Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Fri, 13 Jun 2014 14:37:16 +0200 -Subject: [PATCH 16/23] VAAPI: implement codec control flags +Subject: [PATCH 15/24] VAAPI: implement codec control flags --- .../DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 21 ++++++++++++++++++--- @@ -1707,7 +1660,7 @@ index 67f0e80..2984847 100644 pDvdVideoPicture->pts = DVD_NOPTS_VALUE; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp -index 87e66fe..732e92b 100644 +index 707d609..e0709226 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp @@ -739,6 +739,8 @@ int CDecoder::Decode(AVCodecContext* avctx, AVFrame* pFrame) @@ -1763,56 +1716,54 @@ index 87e66fe..732e92b 100644 VAProcFilterParameterBufferDeinterlacing *filterParams; VABufferID pipelineBuf; -From ebcd73d2e432a07f5b6a9730fb947ce3c09c3846 Mon Sep 17 00:00:00 2001 +From 8a0a138bad535b58fb0d485540c21b08888cecb1 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker -Date: Thu, 4 Sep 2014 09:25:48 +0200 -Subject: [PATCH 17/23] consider rounding errors in dropping control +Date: Sun, 28 Sep 2014 13:52:11 +0200 +Subject: [PATCH 16/24] pthreads: use mutex protocol PTHREAD_PRIO_INHERIT --- - xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + xbmc/threads/platform/pthreads/Implementation.cpp | 1 + + 1 file changed, 1 insertion(+) -diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -index d30a0ad..c2d4b31 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -+++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp -@@ -1606,7 +1606,7 @@ int CDVDPlayerVideo::CalcDropRequirement(double pts) - m_droppingStats.m_dropRequests = 0; - CLog::Log(LOGDEBUG,"CDVDPlayerVideo::CalcDropRequirement - dropped pictures, Sleeptime: %f, Bufferlevel: %d, Gain: %f", iSleepTime, iBufferLevel, iGain); - } -- else if (iDroppedPics < 0 && iGain > 1/m_fFrameRate) -+ else if (iDroppedPics < 0 && iGain > (1/m_fFrameRate + 0.001)) - { - CDroppingStats::CGain gain; - gain.gain = iGain; +diff --git a/xbmc/threads/platform/pthreads/Implementation.cpp b/xbmc/threads/platform/pthreads/Implementation.cpp +index 628db54..123526d 100644 +--- a/xbmc/threads/platform/pthreads/Implementation.cpp ++++ b/xbmc/threads/platform/pthreads/Implementation.cpp +@@ -38,6 +38,7 @@ namespace XbmcThreads + { + pthread_mutexattr_init(&recursiveAttr); + pthread_mutexattr_settype(&recursiveAttr,PTHREAD_MUTEX_RECURSIVE); ++ pthread_mutexattr_setprotocol(&recursiveAttr,PTHREAD_PRIO_INHERIT); + alreadyCalled = true; + } + return true; // note, we never call destroy. - -From c71b09b5a21b5ff95527e33ba4ad921ff64a64f3 Mon Sep 17 00:00:00 2001 +From 0d3311557fe32505770ed28bcb8fbcde7c751399 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sat, 4 Oct 2014 21:25:31 +0200 -Subject: [PATCH 19/23] vaapi: lock gfx context on pre-cleanup +Subject: [PATCH 17/24] vaapi: lock gfx context on pre-cleanup --- xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp -index 732e92b..849e26a 100644 +index e0709226..a086d13 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp @@ -618,6 +618,7 @@ long CDecoder::Release() CSingleLock lock(m_DecoderSection); - CLog::Log(LOGNOTICE,"VAAPI::Release pre-cleanup"); + CLog::Log(LOGDEBUG,"VAAPI::Release pre-cleanup"); + CSingleLock lock1(g_graphicsContext); Message *reply; if (m_vaapiOutput.m_controlPort.SendOutMessageSync(COutputControlProtocol::PRECLEANUP, &reply, -From 7aea148f78db91c4a2e75c280972e98735791a28 Mon Sep 17 00:00:00 2001 +From 42bff6329800ba57459d135f54d0ca7d8eef1b79 Mon Sep 17 00:00:00 2001 From: Anssi Hannula Date: Sun, 19 Oct 2014 21:34:47 +0300 -Subject: [PATCH 20/23] [linux] Add FDEventMonitor for monitoring file +Subject: [PATCH 18/24] [linux] Add FDEventMonitor for monitoring file descriptors Add FDEventMonitor helper thread for monitoring file descriptors for @@ -2192,10 +2143,10 @@ index c147d8f..744fd06 100644 SRCS += LinuxTimezone.cpp SRCS += PosixMountProvider.cpp -From b465939ca69cc2e02190a815d7b3e7291e14ca87 Mon Sep 17 00:00:00 2001 +From a7369e2f95722730f22ebd72e1d22bbf3d0fabe5 Mon Sep 17 00:00:00 2001 From: Anssi Hannula Date: Sun, 19 Oct 2014 21:36:44 +0300 -Subject: [PATCH 21/23] [AE] ALSA: Add ALSADeviceMonitor for monitoring card +Subject: [PATCH 19/24] [AE] ALSA: Add ALSADeviceMonitor for monitoring card removals/additions --- @@ -2471,10 +2422,10 @@ index 0000000..f9e2f26 +#endif + -From f5555b53d7886387a624f011e7a58ec5cd247635 Mon Sep 17 00:00:00 2001 +From 51947c5716e52af108d701b6fb573e8ca145f132 Mon Sep 17 00:00:00 2001 From: Anssi Hannula Date: Sun, 19 Oct 2014 21:37:49 +0300 -Subject: [PATCH 22/23] [AE] ALSA: Add ALSADeviceMonitor for monitoring ELD +Subject: [PATCH 20/24] [AE] ALSA: Add ALSADeviceMonitor for monitoring ELD changes ELD changes can happen e.g. when the connected HDMI sink is changed. @@ -2815,17 +2766,120 @@ index 0000000..56dfd50 +#endif + -From 09b1724482fd9666e976c831976e30afe33537ab Mon Sep 17 00:00:00 2001 +From 1800cdd76ee8224dce93b7cea3e96d2c3df9ee49 Mon Sep 17 00:00:00 2001 +From: Anssi Hannula +Date: Sun, 2 Nov 2014 21:10:51 +0200 +Subject: [PATCH 21/24] [AE] ALSA: Add more logging to device change triggers + +--- + xbmc/cores/AudioEngine/Sinks/alsa/ALSADeviceMonitor.cpp | 13 +++++++++++-- + xbmc/cores/AudioEngine/Sinks/alsa/ALSAHControlMonitor.cpp | 2 ++ + 2 files changed, 13 insertions(+), 2 deletions(-) + +diff --git a/xbmc/cores/AudioEngine/Sinks/alsa/ALSADeviceMonitor.cpp b/xbmc/cores/AudioEngine/Sinks/alsa/ALSADeviceMonitor.cpp +index e3269ad..b0243b9 100644 +--- a/xbmc/cores/AudioEngine/Sinks/alsa/ALSADeviceMonitor.cpp ++++ b/xbmc/cores/AudioEngine/Sinks/alsa/ALSADeviceMonitor.cpp +@@ -113,12 +113,21 @@ void CALSADeviceMonitor::FDEventCallback(int id, int fd, short revents, void *da + const char* action = udev_device_get_action(device); + const char* soundInitialized = udev_device_get_property_value(device, "SOUND_INITIALIZED"); + ++ if (!action || !soundInitialized) ++ continue; ++ + /* cardX devices emit a "change" event when ready (i.e. all subdevices added) */ +- if (action && soundInitialized && +- (strcmp(action, "change") == 0 || strcmp(action, "remove") == 0)) ++ if (strcmp(action, "change") == 0) + { ++ CLog::Log(LOGDEBUG, "CALSADeviceMonitor - ALSA card added (\"%s\", \"%s\")", udev_device_get_syspath(device), udev_device_get_devpath(device)); + audioDevicesChanged = true; + } ++ else if (strcmp(action, "remove") == 0) ++ { ++ CLog::Log(LOGDEBUG, "CALSADeviceMonitor - ALSA card removed"); ++ audioDevicesChanged = true; ++ } ++ + udev_device_unref(device); + } + +diff --git a/xbmc/cores/AudioEngine/Sinks/alsa/ALSAHControlMonitor.cpp b/xbmc/cores/AudioEngine/Sinks/alsa/ALSAHControlMonitor.cpp +index 9b595ee..f9ca9ae 100644 +--- a/xbmc/cores/AudioEngine/Sinks/alsa/ALSAHControlMonitor.cpp ++++ b/xbmc/cores/AudioEngine/Sinks/alsa/ALSAHControlMonitor.cpp +@@ -120,6 +120,8 @@ int CALSAHControlMonitor::HCTLCallback(snd_hctl_elem_t *elem, unsigned int mask) + */ + if (mask & SND_CTL_EVENT_MASK_VALUE) + { ++ CLog::Log(LOGDEBUG, "CALSAHControlMonitor - Monitored ALSA hctl value changed"); ++ + CAEFactory::DeviceChange(); + } + + +From f8baf30230b7db45865e13260298830313481263 Mon Sep 17 00:00:00 2001 +From: Anssi Hannula +Date: Tue, 4 Nov 2014 19:22:03 +0200 +Subject: [PATCH 22/24] [AE] ALSA: Fix DeviceChange event triggered by + enumeration + +All hctl elements get an SND_CTL_EVENT_MASK_REMOVE event when the ctl +file descriptor is closed, which is done e.g. when re-enumerating +devices. + +(SND_CTL_EVENT_MASK_REMOVE & SND_CTL_EVENT_MASK_VALUE) is true, and +therefore we re-triggered enumeration (depending a bit on timing). + +Fix that by checking for the special _REMOVE value first and ignoring +those events. +--- + .../cores/AudioEngine/Sinks/alsa/ALSAHControlMonitor.cpp | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +diff --git a/xbmc/cores/AudioEngine/Sinks/alsa/ALSAHControlMonitor.cpp b/xbmc/cores/AudioEngine/Sinks/alsa/ALSAHControlMonitor.cpp +index f9ca9ae..89a7585 100644 +--- a/xbmc/cores/AudioEngine/Sinks/alsa/ALSAHControlMonitor.cpp ++++ b/xbmc/cores/AudioEngine/Sinks/alsa/ALSAHControlMonitor.cpp +@@ -114,14 +114,22 @@ void CALSAHControlMonitor::Stop() + + int CALSAHControlMonitor::HCTLCallback(snd_hctl_elem_t *elem, unsigned int mask) + { +- /* +- * Currently we just re-enumerate on any change. +- * Custom callbacks for handling other control monitoring may be implemented when needed. +- */ ++ /* _REMOVE is a special value instead of a bit and must be checked first */ ++ if (mask == SND_CTL_EVENT_MASK_REMOVE) ++ { ++ /* Either the device was removed (which is handled in ALSADeviceMonitor instead) ++ * or snd_hctl_close() got called. */ ++ return 0; ++ } ++ + if (mask & SND_CTL_EVENT_MASK_VALUE) + { + CLog::Log(LOGDEBUG, "CALSAHControlMonitor - Monitored ALSA hctl value changed"); + ++ /* ++ * Currently we just re-enumerate on any change. ++ * Custom callbacks for handling other control monitoring may be implemented when needed. ++ */ + CAEFactory::DeviceChange(); + } + + +From 8d85a4aec9e17f8ddb7e26e01df83f50b7c53eb2 Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sat, 1 Nov 2014 07:47:16 +0100 -Subject: [PATCH 23/23] videorefclock: use videosync DRM on AMD systems +Subject: [PATCH 23/24] videorefclock: use videosync DRM on AMD systems --- xbmc/video/VideoReferenceClock.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xbmc/video/VideoReferenceClock.cpp b/xbmc/video/VideoReferenceClock.cpp -index 03f8bf3..1d403bd 100644 +index be6be5f..2b506ad 100644 --- a/xbmc/video/VideoReferenceClock.cpp +++ b/xbmc/video/VideoReferenceClock.cpp @@ -99,7 +99,8 @@ void CVideoReferenceClock::Process() @@ -2838,3 +2892,44 @@ index 03f8bf3..1d403bd 100644 m_pVideoSync = new CVideoSyncDRM(); #if defined(HAS_GLX) else + +From f5211d149c7af1b3f9273ed64c08a4af76fbc066 Mon Sep 17 00:00:00 2001 +From: fritsch +Date: Fri, 7 Nov 2014 14:56:49 +0100 +Subject: [PATCH 24/24] DVDVideoCodecFFmpeg: Squash me to: 2551ee3a + +--- + xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +index 368de0e..e9edd0c 100644 +--- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +@@ -928,7 +928,7 @@ bool CDVDDemuxFFmpeg::SeekTime(int time, bool backwords, double *startpts) + + // seek may fail silently on streams which allow discontinuity + // if current timestamp is way off asume a pts overflow and try bisect seek +- if (m_bPtsWrap && fabs(time - m_iCurrentPts/1000) > 10000) ++ if (m_bPtsWrap && fabs(time - m_currentPts/1000) > 10000) + { + ret = SeekTimeDiscont(seek_pts, backwords) ? 1 : -1; + } +@@ -1026,7 +1026,7 @@ bool CDVDDemuxFFmpeg::SeekTimeDiscont(int64_t pts, bool backwards) + bool ret = SeekByte(pos_max); + if (ret) + { +- m_iCurrentPts = ConvertTimestamp(ts_max, m_pFormatContext->streams[defaultStream]->time_base.den, ++ m_currentPts = ConvertTimestamp(ts_max, m_pFormatContext->streams[defaultStream]->time_base.den, + m_pFormatContext->streams[defaultStream]->time_base.num); + } + return ret; +@@ -1103,7 +1103,7 @@ bool CDVDDemuxFFmpeg::SeekTimeDiscont(int64_t pts, bool backwards) + bool ret = SeekByte(pos); + if (ret) + { +- m_iCurrentPts = ConvertTimestamp(ts, m_pFormatContext->streams[defaultStream]->time_base.den, ++ m_currentPts = ConvertTimestamp(ts, m_pFormatContext->streams[defaultStream]->time_base.den, + m_pFormatContext->streams[defaultStream]->time_base.num); + } + diff --git a/packages/mediacenter/kodi/patches/kodi-995.03-ALSA-Fix_DeviceChange_event_triggered_by_enumeration-0.1.patch b/packages/mediacenter/kodi/patches/kodi-995.03-ALSA-Fix_DeviceChange_event_triggered_by_enumeration-0.1.patch deleted file mode 100644 index adfc8bc3d4..0000000000 --- a/packages/mediacenter/kodi/patches/kodi-995.03-ALSA-Fix_DeviceChange_event_triggered_by_enumeration-0.1.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 65342cfaebe4fcbea2e44bb61791b82197772ca1 Mon Sep 17 00:00:00 2001 -From: Anssi Hannula -Date: Tue, 4 Nov 2014 19:22:03 +0200 -Subject: [PATCH] [AE] ALSA: Fix DeviceChange event triggered by enumeration - -All hctl elements get an SND_CTL_EVENT_MASK_REMOVE event when the ctl -file descriptor is closed, which is done e.g. when re-enumerating -devices. - -(SND_CTL_EVENT_MASK_REMOVE & SND_CTL_EVENT_MASK_VALUE) is true, and -therefore we re-triggered enumeration (depending a bit on timing). - -Fix that by checking for the special _REMOVE value first and ignoring -those events. ---- -diff -Naur kodi-14-d6947be/xbmc/cores/AudioEngine/Sinks/alsa/ALSAHControlMonitor.cpp kodi-14-d6947be.patch/xbmc/cores/AudioEngine/Sinks/alsa/ALSAHControlMonitor.cpp ---- kodi-14-d6947be/xbmc/cores/AudioEngine/Sinks/alsa/ALSAHControlMonitor.cpp 2014-11-05 09:22:22.494136199 +0100 -+++ kodi-14-d6947be.patch/xbmc/cores/AudioEngine/Sinks/alsa/ALSAHControlMonitor.cpp 2014-11-05 09:25:41.754440039 +0100 -@@ -114,12 +114,20 @@ - - int CALSAHControlMonitor::HCTLCallback(snd_hctl_elem_t *elem, unsigned int mask) - { -- /* -- * Currently we just re-enumerate on any change. -- * Custom callbacks for handling other control monitoring may be implemented when needed. -- */ -+ /* _REMOVE is a special value instead of a bit and must be checked first */ -+ if (mask == SND_CTL_EVENT_MASK_REMOVE) -+ { -+ /* Either the device was removed (which is handled in ALSADeviceMonitor instead) -+ * or snd_hctl_close() got called. */ -+ return 0; -+ } -+ - if (mask & SND_CTL_EVENT_MASK_VALUE) - { -+ /* -+ * Currently we just re-enumerate on any change. -+ * Custom callbacks for handling other control monitoring may be implemented when needed. -+ */ - CAEFactory::DeviceChange(); - } - diff --git a/projects/RPi/patches/kodi/kodi-001-newclock4.patch b/projects/RPi/patches/kodi/kodi-001-newclock4.patch index 229c19e28b..c55532f809 100644 --- a/projects/RPi/patches/kodi/kodi-001-newclock4.patch +++ b/projects/RPi/patches/kodi/kodi-001-newclock4.patch @@ -1,7 +1,7 @@ -From 9b0b0e301d4e30f3415693122e30b13cc0245cf4 Mon Sep 17 00:00:00 2001 +From 30d186f47ebee71c4571803a8035bc9f5b19b910 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 18:19:32 +0100 -Subject: [PATCH 01/95] [rbp/omxplayer] When opening a stream don't try to +Subject: [PATCH 01/84] [rbp/omxplayer] When opening a stream don't try to update gui so often --- @@ -25,10 +25,10 @@ index e7cfcdd..20b99ad 100644 g_windowManager.ProcessRenderLoop(false); if (allowCancel && dialog->IsCanceled()) -From 0a61d8487f4ca0f84173ba600d72e8c26add02fb Mon Sep 17 00:00:00 2001 +From 95ea2332eff47abc1f91f25683b133572f0aa69b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 29 Apr 2014 15:23:22 +0100 -Subject: [PATCH 02/95] [ffmpeg] Speed up wtv index creation +Subject: [PATCH 02/84] [ffmpeg] Speed up wtv index creation The index creation is O(N^2) with number of entries (typically thousands). On a Pi this can take more than 60 seconds to execute for a recording of a few hours. @@ -114,10 +114,10 @@ index 0000000..4ac5636 + } + } -From 4a4b428720a042f8022172319fc6bfdf696665b2 Mon Sep 17 00:00:00 2001 +From 432579c0f844e9a6dcf9ee0a0999908f474f3df3 Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:49:17 +1300 -Subject: [PATCH 03/95] adds GetTvShowSeasons +Subject: [PATCH 03/84] adds GetTvShowSeasons --- xbmc/video/VideoDatabase.cpp | 30 ++++++++++++++++++++++++------ @@ -125,10 +125,10 @@ Subject: [PATCH 03/95] adds GetTvShowSeasons 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp -index e07a374..8c9273c 100644 +index c18c3b5..14184b1 100644 --- a/xbmc/video/VideoDatabase.cpp +++ b/xbmc/video/VideoDatabase.cpp -@@ -4211,7 +4211,7 @@ bool CVideoDatabase::RemoveArtForItem(int mediaId, const MediaType &mediaType, c +@@ -4209,7 +4209,7 @@ bool CVideoDatabase::RemoveArtForItem(int mediaId, const MediaType &mediaType, c return result; } @@ -137,7 +137,7 @@ index e07a374..8c9273c 100644 { try { -@@ -4222,19 +4222,37 @@ bool CVideoDatabase::GetTvShowSeasonArt(int showId, map +@@ -4220,19 +4220,37 @@ bool CVideoDatabase::GetTvShowSeasonArt(int showId, map CStdString sql = PrepareSQL("select idSeason,season from seasons where idShow=%i", showId); m_pDS2->query(sql.c_str()); @@ -193,10 +193,10 @@ index 78259ed..cbb26b7 100644 bool GetArtTypes(const MediaType &mediaType, std::vector &artTypes); -From 4d40d93e422db2f6b3b9b626ac118b406b3e29e8 Mon Sep 17 00:00:00 2001 +From a847649fab4ee953a3b4d680bb828b6c8e6e279a Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:50:10 +1300 -Subject: [PATCH 04/95] move AddSeason() public. +Subject: [PATCH 04/84] move AddSeason() public. --- xbmc/video/VideoDatabase.h | 2 +- @@ -223,10 +223,10 @@ index cbb26b7..1a79c00 100644 /*! \brief Adds a path to the tvshow link table. \param idShow the id of the show. -From 095e502d8327e7590115781dcf04c397083111a9 Mon Sep 17 00:00:00 2001 +From e7d8d58ecf4eaa6f0b469b13189f9bfd84fc16b4 Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:48:24 +1300 -Subject: [PATCH 05/95] adds GetArt function to (video) scraper, allowing art +Subject: [PATCH 05/84] adds GetArt function to (video) scraper, allowing art to be fetched given the video identifier. --- @@ -341,10 +341,10 @@ index 22ac229..75bc341 100644 enum LOOKUP_STATE { DO_NOTHING = 0, FIND_MOVIE = 1, -From bef0bd652b075a79ac2a0d84b9f368ed18ed5d94 Mon Sep 17 00:00:00 2001 +From 9d49dcdea36dc98d924440d72a1843e00c136a4c Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:53:14 +1300 -Subject: [PATCH 06/95] refresh season art if a new season is found that isn't +Subject: [PATCH 06/84] refresh season art if a new season is found that isn't recorded in the database yet. Fixes #14339 --- @@ -353,10 +353,10 @@ Subject: [PATCH 06/95] refresh season art if a new season is found that isn't 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/xbmc/video/VideoInfoScanner.cpp b/xbmc/video/VideoInfoScanner.cpp -index 22f94ae..35fcc96 100644 +index b4a2672..0d0ad66 100644 --- a/xbmc/video/VideoInfoScanner.cpp +++ b/xbmc/video/VideoInfoScanner.cpp -@@ -1372,6 +1372,10 @@ namespace VIDEO +@@ -1375,6 +1375,10 @@ namespace VIDEO pDlgProgress->Progress(); } @@ -367,7 +367,7 @@ index 22f94ae..35fcc96 100644 EPISODELIST episodes; bool hasEpisodeGuide = false; -@@ -1420,6 +1424,8 @@ namespace VIDEO +@@ -1423,6 +1427,8 @@ namespace VIDEO } if (AddVideo(&item, CONTENT_TVSHOWS, file->isFolder, true, &showInfo) < 0) return INFO_ERROR; @@ -376,7 +376,7 @@ index 22f94ae..35fcc96 100644 continue; } -@@ -1549,6 +1555,8 @@ namespace VIDEO +@@ -1552,6 +1558,8 @@ namespace VIDEO if (AddVideo(&item, CONTENT_TVSHOWS, file->isFolder, useLocal, &showInfo) < 0) return INFO_ERROR; @@ -385,7 +385,7 @@ index 22f94ae..35fcc96 100644 } else { -@@ -1557,9 +1565,27 @@ namespace VIDEO +@@ -1560,9 +1568,27 @@ namespace VIDEO file->cDate.GetAsLocalizedDate().c_str(), file->strTitle.c_str()); } } @@ -413,7 +413,7 @@ index 22f94ae..35fcc96 100644 CStdString CVideoInfoScanner::GetnfoFile(CFileItem *item, bool bGrabAny) const { CStdString nfoFile; -@@ -1824,6 +1850,11 @@ namespace VIDEO +@@ -1827,6 +1853,11 @@ namespace VIDEO } for (int season = -1; season <= maxSeasons; season++) { @@ -425,7 +425,7 @@ index 22f94ae..35fcc96 100644 map art; if (useLocal) { -@@ -1877,7 +1908,7 @@ namespace VIDEO +@@ -1880,7 +1911,7 @@ namespace VIDEO art.insert(make_pair(artTypes.front(), image)); } @@ -448,10 +448,10 @@ index 92883e7..47d5ed4 100644 bool ProcessItemByVideoInfoTag(const CFileItem *item, EPISODELIST &episodeList); -From 31b42c3c4f60673fab2839e9286d5e5173f232b9 Mon Sep 17 00:00:00 2001 +From 8b79d04ea0b7fc0e0e7a869a4603a8050f1a2c74 Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sat, 2 Nov 2013 23:53:34 +1300 -Subject: [PATCH 07/95] REMOVEME: updated thetvdb.com scraper to support art +Subject: [PATCH 07/84] REMOVEME: updated thetvdb.com scraper to support art updates --- @@ -559,10 +559,10 @@ index f27e4fc..bdf329f 100644 -From a78f311f931748c40986c8855a2244420633b903 Mon Sep 17 00:00:00 2001 +From 6bb3f6ed82d656fd15c92861f7cef6541e36c740 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 2 Aug 2014 17:48:04 +0100 -Subject: [PATCH 08/95] [omx] Report decoded image name +Subject: [PATCH 08/84] [omx] Report decoded image name --- xbmc/cores/omxplayer/OMXImage.cpp | 1 + @@ -581,10 +581,10 @@ index aa413b9..22ec3f0 100644 else { -From f990bf5b25aa77a9f621763a62213118575e00b0 Mon Sep 17 00:00:00 2001 +From 2b5186365600487c6b3f5b712ddcf6bc189e7f9d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 14 Dec 2013 16:55:05 +0000 -Subject: [PATCH 09/95] logging: Add microsecond timer to log messages +Subject: [PATCH 09/84] logging: Add microsecond timer to log messages --- xbmc/utils/log.cpp | 17 +++++++++++++++-- @@ -637,11 +637,10 @@ index 3443f12..31c4a99 100644 levelNames[logLevel]) + strData; - -From 0d6d472a537804ad8f50e91f309173c86ba4bc3e Mon Sep 17 00:00:00 2001 +From 232cad5fb449facd176dac3dfa3e087bbf2cb1ca Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 8 Mar 2014 15:36:06 +0000 -Subject: [PATCH 12/95] [hifiberry] Hack: force it to be recognised as IEC958 +Subject: [PATCH 13/84] [hifiberry] Hack: force it to be recognised as IEC958 capable to enable passthrough options --- @@ -664,10 +663,10 @@ index a464b4b..7eba389 100644 info.m_displayName.substr(info.m_displayName.size()-5) == " HDMI") { -From 9c73311e69e1009bc1da2ea96f6a707e5a95b4a9 Mon Sep 17 00:00:00 2001 +From 78f8be64cd8aaa62ab95351f8e1a1fc3ca4f8bea Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 11 Dec 2013 17:21:54 +0000 -Subject: [PATCH 13/95] Move the reference-counting of Begin and End calls from +Subject: [PATCH 14/84] Move the reference-counting of Begin and End calls from DX and GL source files into GUIFontTTF.cpp. --- @@ -1055,10 +1054,10 @@ index c0bb53a..735fb3a 100644 protected: virtual CBaseTexture* ReallocTexture(unsigned int& newHeight); -From 72aacc052e7da47323334a812c795bfc46b79866 Mon Sep 17 00:00:00 2001 +From 8a5762283df853c3ba0f7417cf7c9c6f22ba7379 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 11 Dec 2013 18:47:54 +0000 -Subject: [PATCH 14/95] Convert CGUIFontTTFBase::m_vertex to be managed as a +Subject: [PATCH 15/84] Convert CGUIFontTTFBase::m_vertex to be managed as a std::vector. Also retired CGUIFontTTFBase::m_vertex_count and @@ -1238,10 +1237,10 @@ index 97853fd..b76c6a5 100644 *vertices++ = m_vertex[i]; *vertices++ = m_vertex[i+1]; -From 34e89396340fbd54b8f60e77a33e41d133e255f1 Mon Sep 17 00:00:00 2001 +From 8e79a3e46dfbd5268a0106857f3e5d1bb5aa3cb9 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Mon, 16 Dec 2013 18:58:12 +0000 -Subject: [PATCH 15/95] CGUIFontTTFBase::RenderCharacter can now append to +Subject: [PATCH 16/84] CGUIFontTTFBase::RenderCharacter can now append to arbitrary vectors of vertices rather than only CGUIFontTTFBase::m_vertex --- @@ -1314,10 +1313,10 @@ index 5675725..a5d44f4 100644 virtual CBaseTexture* ReallocTexture(unsigned int& newHeight) = 0; -From 18e3f481eaed05aa4bdf879e529878f2049d59cc Mon Sep 17 00:00:00 2001 +From 7cf321191658dde76c622274a3ac630f0d808697 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 17:18:38 +0000 -Subject: [PATCH 16/95] Add a cache of font glyph bounding box vertices. +Subject: [PATCH 17/84] 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 @@ -2077,10 +2076,10 @@ index f351c99..9036ba9 100644 + return !operator==(a, b); +} -From c039d79de4b2188b5d0ceae4f3aff5fac0ed7dc5 Mon Sep 17 00:00:00 2001 +From b20df31af65e041007f8af8e75c479b31ad0ef0c Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 23 Jan 2014 22:24:17 +0000 -Subject: [PATCH 17/95] Lay the groundwork for hardware clipping. +Subject: [PATCH 18/84] 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 @@ -2342,10 +2341,10 @@ index 98e398a..81ee49e 100644 virtual void ResetScissors(); -From 6ec097a843e1dc5df726647884d07410ffd41096 Mon Sep 17 00:00:00 2001 +From 2ea5644b7bfbe0c9ef308cf17d3c5ad885a77ddc Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 23 Jan 2014 16:42:22 +0000 -Subject: [PATCH 18/95] Increase font cache hit rate by keying on the +Subject: [PATCH 19/84] 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 @@ -2546,10 +2545,10 @@ index 3b93672..258dffa 100644 private: virtual bool FirstBegin() = 0; -From c2188a12cbccfc838edf89afe74eea81b9080e7f Mon Sep 17 00:00:00 2001 +From a0726e3ddc0e874f4d514a788bd39038f72b14ff Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 8 Jan 2014 12:16:33 +0000 -Subject: [PATCH 19/95] Rewrite of scrolling text code. +Subject: [PATCH 20/84] 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 @@ -2865,10 +2864,10 @@ index 2cda726..fbc579e 100644 private: void Process(); -From 7c7c7109dc9ceadeb91e8b458b6f9f761d78dc64 Mon Sep 17 00:00:00 2001 +From 7aa10750d64e3d27d83fb8ddd53e29e546b23f98 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Mon, 27 Jan 2014 23:21:10 +0000 -Subject: [PATCH 20/95] Move the application of the translation offsets into +Subject: [PATCH 21/84] 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 @@ -3062,10 +3061,10 @@ index 9935ea4..18c9358 100644 memset(newTexture->GetPixels(), 0, m_textureHeight * newTexture->GetPitch()); if (m_texture) -From 3e649887fb0914bec03a52ee7a49ad557f79a552 Mon Sep 17 00:00:00 2001 +From edd8c99522b8b8610ce135094df5a490b1dc0599 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 15:28:06 +0000 -Subject: [PATCH 21/95] Rather than applying the translation offsets to the +Subject: [PATCH 22/84] 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. @@ -3209,10 +3208,10 @@ index 81ee49e..d2f9cd1 100644 protected: virtual void SetVSyncImpl(bool enable) = 0; -From dc8782d396b8967c80828a1c10b21c868ad549bc Mon Sep 17 00:00:00 2001 +From 8a97a4fbf7fbe4ce2fe503fba28a01a80c682e79 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 29 Jan 2014 13:21:19 +0000 -Subject: [PATCH 22/95] Enable hardware clipping. +Subject: [PATCH 23/84] Enable hardware clipping. --- xbmc/guilib/GUIFontTTF.cpp | 4 ++-- @@ -3284,10 +3283,10 @@ index ea08bf4..b63e337 100644 glUniformMatrix4fv(modelLoc, 1, GL_FALSE, g_matrices.GetMatrix(MM_MODELVIEW)); } -From a67c38e9fbd94eb32dfb92182ae4a7eb928dd59c Mon Sep 17 00:00:00 2001 +From 484f10587ae2741c799894756552be5cbdb3e6d5 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 15:32:51 +0000 -Subject: [PATCH 23/95] Move the vertex data across to a vertex buffer object +Subject: [PATCH 24/84] Move the vertex data across to a vertex buffer object just prior to drawing. --- @@ -3338,10 +3337,10 @@ index b63e337..b00055d 100644 // Disable the attributes used by this shader -From ff0fe6936d81a7901252b84f5262466d096c0c82 Mon Sep 17 00:00:00 2001 +From 1231a992b2f23491b4538f5b7af792c9c9c09e06 Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Wed, 15 Jan 2014 16:04:04 +0000 -Subject: [PATCH 24/95] Move vertex data into an OpenGL VBO when the font cache +Subject: [PATCH 25/84] 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 @@ -3614,10 +3613,234 @@ index 735fb3a..6102c90 100644 protected: virtual CBaseTexture* ReallocTexture(unsigned int& newHeight); -From 0987f8e8ef02d31ec3d122dfb786a795c008aa2f Mon Sep 17 00:00:00 2001 +From f338b5d790f62b9849a121eaf7aca3791d8f931f Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sat, 1 Nov 2014 22:15:13 +0000 +Subject: [PATCH 26/84] Switch from glDrawArrays() to glDrawElements(). + +This involves setting up a static VBO containing the indexes necessary to +convert from quads to triangles on the fly in the GPU. +--- + xbmc/guilib/GUIFontTTFGL.cpp | 72 +++++++++++++++++++++++++------------ + xbmc/guilib/GUIFontTTFGL.h | 11 +++++- + xbmc/windowing/egl/WinSystemEGL.cpp | 17 +++++++++ + 3 files changed, 77 insertions(+), 23 deletions(-) + +diff --git a/xbmc/guilib/GUIFontTTFGL.cpp b/xbmc/guilib/GUIFontTTFGL.cpp +index aabb9a6..812662c 100644 +--- a/xbmc/guilib/GUIFontTTFGL.cpp ++++ b/xbmc/guilib/GUIFontTTFGL.cpp +@@ -207,6 +207,10 @@ void CGUIFontTTFGL::LastEnd() + if (m_vertexTrans.size() > 0) + { + // Deal with the vertices that can be hardware clipped and therefore translated ++ ++ // Bind our pre-calculated array to GL_ELEMENT_ARRAY_BUFFER ++ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_elementArrayHandle); ++ + for (size_t i = 0; i < m_vertexTrans.size(); i++) + { + // Apply the clip rectangle +@@ -222,14 +226,21 @@ void CGUIFontTTFGL::LastEnd() + // Bind the buffer to the OpenGL context's GL_ARRAY_BUFFER binding point + glBindBuffer(GL_ARRAY_BUFFER, (GLuint) m_vertexTrans[i].vertexBuffer->bufferHandle); + +- // Set up the offsets of the various vertex attributes within the buffer +- // object bound to GL_ARRAY_BUFFER +- glVertexAttribPointer(posLoc, 3, GL_FLOAT, GL_FALSE, sizeof(SVertex), (GLvoid *) offsetof(SVertex, x)); +- glVertexAttribPointer(colLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(SVertex), (GLvoid *) offsetof(SVertex, r)); +- glVertexAttribPointer(tex0Loc, 2, GL_FLOAT, GL_FALSE, sizeof(SVertex), (GLvoid *) offsetof(SVertex, u)); ++ // Do the actual drawing operation, split into groups of characters no ++ // larger than the pre-determined size of the element array ++ for (size_t character = 0; m_vertexTrans[i].vertexBuffer->size > character; character += ELEMENT_ARRAY_MAX_CHAR_INDEX) ++ { ++ size_t count = m_vertexTrans[i].vertexBuffer->size - character; ++ count = std::min(count, ELEMENT_ARRAY_MAX_CHAR_INDEX); ++ ++ // Set up the offsets of the various vertex attributes within the buffer ++ // object bound to GL_ARRAY_BUFFER ++ glVertexAttribPointer(posLoc, 3, GL_FLOAT, GL_FALSE, sizeof(SVertex), (GLvoid *) (character*sizeof(SVertex)*4 + offsetof(SVertex, x))); ++ glVertexAttribPointer(colLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(SVertex), (GLvoid *) (character*sizeof(SVertex)*4 + offsetof(SVertex, r))); ++ glVertexAttribPointer(tex0Loc, 2, GL_FLOAT, GL_FALSE, sizeof(SVertex), (GLvoid *) (character*sizeof(SVertex)*4 + offsetof(SVertex, u))); + +- // Do the actual drawing operation, using the full set of vertices in the buffer +- glDrawArrays(GL_TRIANGLES, 0, 6 * m_vertexTrans[i].vertexBuffer->size); ++ glDrawElements(GL_TRIANGLES, 6 * count, GL_UNSIGNED_SHORT, 0); ++ } + + g_matrices.PopMatrix(); + } +@@ -237,8 +248,9 @@ void CGUIFontTTFGL::LastEnd() + g_Windowing.ResetScissors(); + // Restore the original model view matrix + glUniformMatrix4fv(modelLoc, 1, GL_FALSE, g_matrices.GetMatrix(MM_MODELVIEW)); +- // Unbind GL_ARRAY_BUFFER ++ // Unbind GL_ARRAY_BUFFER and GL_ELEMENT_ARRAY_BUFFER + glBindBuffer(GL_ARRAY_BUFFER, 0); ++ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); + } + + // Disable the attributes used by this shader +@@ -253,19 +265,6 @@ void CGUIFontTTFGL::LastEnd() + #if HAS_GLES + CVertexBuffer CGUIFontTTFGL::CreateVertexBuffer(const std::vector &vertices) const + { +- // Rearrange the vertices to describe triangles +- std::vector triangleVertices; +- triangleVertices.reserve(vertices.size() * 6 / 4); +- for (size_t i = 0; i < vertices.size(); i += 4) +- { +- triangleVertices.push_back(vertices[i]); +- triangleVertices.push_back(vertices[i+1]); +- triangleVertices.push_back(vertices[i+2]); +- triangleVertices.push_back(vertices[i+1]); +- triangleVertices.push_back(vertices[i+3]); +- triangleVertices.push_back(vertices[i+2]); +- } +- + // Generate a unique buffer object name and put it in bufferHandle + GLuint bufferHandle; + glGenBuffers(1, &bufferHandle); +@@ -274,7 +273,7 @@ CVertexBuffer CGUIFontTTFGL::CreateVertexBuffer(const std::vector &vert + // Create a data store for the buffer object bound to the GL_ARRAY_BUFFER + // binding point (i.e. our buffer object) and initialise it from the + // specified client-side pointer +- glBufferData(GL_ARRAY_BUFFER, triangleVertices.size() * sizeof (SVertex), &triangleVertices[0], GL_STATIC_DRAW); ++ glBufferData(GL_ARRAY_BUFFER, vertices.size() * sizeof (SVertex), &vertices[0], GL_STATIC_DRAW); + // Unbind GL_ARRAY_BUFFER + glBindBuffer(GL_ARRAY_BUFFER, 0); + +@@ -393,4 +392,33 @@ void CGUIFontTTFGL::DeleteHardwareTexture() + } + } + ++#if HAS_GLES ++void CGUIFontTTFGL::CreateStaticVertexBuffers(void) ++{ ++ // Bind a new buffer to the OpenGL context's GL_ELEMENT_ARRAY_BUFFER binding point ++ glGenBuffers(1, &m_elementArrayHandle); ++ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_elementArrayHandle); ++ // Create an array holding the mesh indices to convert quads to triangles ++ GLushort index[ELEMENT_ARRAY_MAX_CHAR_INDEX][6]; ++ for (size_t i = 0; i < ELEMENT_ARRAY_MAX_CHAR_INDEX; i++) ++ { ++ index[i][0] = 4*i; ++ index[i][1] = 4*i+1; ++ index[i][2] = 4*i+2; ++ index[i][3] = 4*i+1; ++ index[i][4] = 4*i+3; ++ index[i][5] = 4*i+2; ++ } ++ glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof index, index, GL_STATIC_DRAW); ++ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); ++} ++ ++void CGUIFontTTFGL::DestroyStaticVertexBuffers(void) ++{ ++ glDeleteBuffers(1, &m_elementArrayHandle); ++} ++ ++GLuint CGUIFontTTFGL::m_elementArrayHandle; ++#endif ++ + #endif +diff --git a/xbmc/guilib/GUIFontTTFGL.h b/xbmc/guilib/GUIFontTTFGL.h +index 6102c90..dcf9ca1 100644 +--- a/xbmc/guilib/GUIFontTTFGL.h ++++ b/xbmc/guilib/GUIFontTTFGL.h +@@ -30,6 +30,7 @@ + + #include "GUIFontTTF.h" + #include "system.h" ++#include "system_gl.h" + + + /*! +@@ -47,13 +48,21 @@ class CGUIFontTTFGL : public CGUIFontTTFBase + #if HAS_GLES + virtual CVertexBuffer CreateVertexBuffer(const std::vector &vertices) const; + virtual void DestroyVertexBuffer(CVertexBuffer &bufferHandle) const; ++ static void CreateStaticVertexBuffers(void); ++ static void DestroyStaticVertexBuffers(void); + #endif + + protected: + virtual CBaseTexture* ReallocTexture(unsigned int& newHeight); + virtual bool CopyCharToTexture(FT_BitmapGlyph bitGlyph, unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2); + virtual void DeleteHardwareTexture(); +- ++ ++#if HAS_GLES ++#define ELEMENT_ARRAY_MAX_CHAR_INDEX (1000) ++ ++ static GLuint m_elementArrayHandle; ++#endif ++ + private: + unsigned int m_updateY1; + unsigned int m_updateY2; +diff --git a/xbmc/windowing/egl/WinSystemEGL.cpp b/xbmc/windowing/egl/WinSystemEGL.cpp +index d2a94c9..7b6097a 100644 +--- a/xbmc/windowing/egl/WinSystemEGL.cpp ++++ b/xbmc/windowing/egl/WinSystemEGL.cpp +@@ -29,6 +29,7 @@ + #include "settings/AdvancedSettings.h" + #include "settings/Settings.h" + #include "settings/DisplaySettings.h" ++#include "guilib/GUIFontTTFGL.h" + #include "guilib/DispResource.h" + #include "threads/SingleLock.h" + #include "utils/log.h" +@@ -195,6 +196,9 @@ bool CWinSystemEGL::CreateWindow(RESOLUTION_INFO &res) + return false; + } + ++#if HAS_GLES ++ bool newContext = false; ++#endif + if (m_context == EGL_NO_CONTEXT) + { + if (!m_egl->CreateContext(m_display, m_config, contextAttrs, &m_context)) +@@ -202,6 +206,9 @@ bool CWinSystemEGL::CreateWindow(RESOLUTION_INFO &res) + CLog::Log(LOGERROR, "%s: Could not create context",__FUNCTION__); + return false; + } ++#if HAS_GLES ++ newContext = true; ++#endif + } + + if (!m_egl->BindContext(m_display, m_surface, m_context)) +@@ -210,6 +217,11 @@ bool CWinSystemEGL::CreateWindow(RESOLUTION_INFO &res) + return false; + } + ++#if HAS_GLES ++ if (newContext) ++ CGUIFontTTFGL::CreateStaticVertexBuffers(); ++#endif ++ + // for the non-trivial dirty region modes, we need the EGL buffer to be preserved across updates + if (g_advancedSettings.m_guiAlgorithmDirtyRegions == DIRTYREGION_SOLVER_COST_REDUCTION || + g_advancedSettings.m_guiAlgorithmDirtyRegions == DIRTYREGION_SOLVER_UNION) +@@ -231,7 +243,12 @@ bool CWinSystemEGL::DestroyWindowSystem() + DestroyWindow(); + + if (m_context != EGL_NO_CONTEXT) ++ { ++#if HAS_GLES ++ CGUIFontTTFGL::DestroyStaticVertexBuffers(); ++#endif + m_egl->DestroyContext(m_display, m_context); ++ } + m_context = EGL_NO_CONTEXT; + + if (m_display != EGL_NO_DISPLAY) + +From 2a7edf12816ce7bccd7bf8d2a680b62a68a40ece Mon Sep 17 00:00:00 2001 From: Ben Avison Date: Thu, 1 May 2014 16:28:39 +0100 -Subject: [PATCH 25/95] Improved file buffering in CArchive +Subject: [PATCH 27/84] 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 @@ -3677,10 +3900,10 @@ index 6ed0f8f..8506d95 100644 } else -From ad9a20382f98ce84d02e7cc3258a3ac118c4e2af Mon Sep 17 00:00:00 2001 +From 2eb1c5c116a432340fefc73b8d04155487504877 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 10 Sep 2014 22:07:21 +0100 -Subject: [PATCH 26/95] [mmal] Allow mmal codec for dvd stills +Subject: [PATCH 28/84] [mmal] Allow mmal codec for dvd stills --- xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp | 4 ++++ @@ -3702,11 +3925,10 @@ index f139433..4183a2b 100644 { // If dvd is an mpeg2 and hint.stills - -From 17c0d521016319411e73ee63397b28dea205f7aa Mon Sep 17 00:00:00 2001 +From a0b86b86b8170a0f47452bcbab87bcb89e3e0d16 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 16 Apr 2014 21:18:06 +0100 -Subject: [PATCH 30/95] [omxplayer] Don't propagate 3d flags based on supported +Subject: [PATCH 31/84] [omxplayer] Don't propagate 3d flags based on supported 3d modes --- @@ -3714,7 +3936,7 @@ Subject: [PATCH 30/95] [omxplayer] Don't propagate 3d flags based on supported 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index 2c25fd9..c2bd788 100644 +index ac838ce..605318c9 100644 --- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp @@ -759,36 +759,15 @@ void OMXPlayerVideo::ResolutionUpdateCallBack(uint32_t width, uint32_t height, f @@ -3759,10 +3981,10 @@ index 2c25fd9..c2bd788 100644 unsigned int iDisplayWidth = width; unsigned int iDisplayHeight = height; -From 734c79c3b023ed65cea93e1cdd7c6954006a0ab9 Mon Sep 17 00:00:00 2001 +From b1f514743e289b09a7e217d1d43090245882ee6c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Apr 2014 13:00:52 +0100 -Subject: [PATCH 31/95] [graphics] Don't set stereo mode based on resolution +Subject: [PATCH 32/84] [graphics] Don't set stereo mode based on resolution The resolution change should follow stereo mode --- @@ -3820,10 +4042,10 @@ index 282792c..f1926de 100644 m_iScreenWidth = info_mod.iWidth; -From 52503a4b52321701d8fdd1ae8c85db1c0a83461c Mon Sep 17 00:00:00 2001 +From c848abf5a54a0d0459e0ed3e30143bb5713a4ec3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Apr 2014 13:01:51 +0100 -Subject: [PATCH 32/95] [graphics] Allow switching to a more suitable 3D +Subject: [PATCH 33/84] [graphics] Allow switching to a more suitable 3D resolution --- @@ -3909,10 +4131,10 @@ index 2904c1b..8d3774f 100644 void ResetOverscan(RESOLUTION_INFO &resinfo); void ResetScreenParameters(RESOLUTION res); -From 31c5b885eb375da7e46fc0ac57e520edb4c3b683 Mon Sep 17 00:00:00 2001 +From 3199f48cc4a6e4e95ccd1fe9d6b66d1ea0740877 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 17 Apr 2014 13:38:55 +0100 -Subject: [PATCH 33/95] [3D] Support switching to 3D resolutions +Subject: [PATCH 34/84] [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. @@ -3994,10 +4216,10 @@ index 83c3adb..8076e76 100644 return current; } -From bfc4f4ffb53401a22e90ec73402be6e856e30b03 Mon Sep 17 00:00:00 2001 +From b8e92436f7474a9d2f4e59b39af65aa29b612280 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 23 Apr 2014 00:05:07 +0100 -Subject: [PATCH 34/95] [graphics] Make pixel ratio for 3d modes consistent +Subject: [PATCH 35/84] [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. @@ -4200,10 +4422,10 @@ index c58c28a..bf1e589 100644 AddUniqueResolution(res2, resolutions); -From 3582bbe1c6a20f5ca632e13e11685b8a89917e79 Mon Sep 17 00:00:00 2001 +From 19d4ceef1f582257a00bd73ae2aca668280158da Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 10 Aug 2014 16:45:16 +0100 -Subject: [PATCH 35/95] filesystem: Make support of browsing into archives +Subject: [PATCH 36/84] 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. @@ -4257,7 +4479,7 @@ index f572eed..f3c8a01 100644 diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index ea6bafc..cd1c45c 100644 +index 25c2007..5e0e659 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -226,6 +226,11 @@ @@ -4302,71 +4524,293 @@ index 2fd8777..3b294cd 100644 { // XBMC Smart playlist - just XML renamed to XSP // read the name of the playlist in -From 2154c7ee8b237df786913f802ce9e7767046eadf Mon Sep 17 00:00:00 2001 +From 9dc76036947d4676c10dc2bab8c421868c3f1a97 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 11 Aug 2014 22:56:13 +0100 -Subject: [PATCH 37/95] [omxplayer] Add acceleration option to choose - omxplayer/dvdplayer automatically +Subject: [PATCH 38/84] [omxplayer] Add option to choose omxplayer/dvdplayer + automatically +On Helix dvdplayer is pretty usable on the Pi, and is the only option +in some use cases: + +omxplayer does not support external sound cards (USB or I2S) +omxplayer does not support dvd menus +omxplayer does not support software codecs + +Expecting the user to choose the right player is not ideal, +so make the switch automatically for these three cases. --- - language/English/strings.po | 10 +++++++ - system/settings/settings.xml | 9 ++++++ - xbmc/cores/dvdplayer/DVDPlayer.cpp | 58 ++++++++++++++++++++++++++++++++++++++ - 3 files changed, 77 insertions(+) + xbmc/cores/dvdplayer/DVDPlayer.cpp | 140 +++------------------- + xbmc/cores/dvdplayer/DVDPlayer.h | 1 + + xbmc/cores/omxplayer/Makefile.in | 3 +- + xbmc/cores/omxplayer/OMXPlayer.cpp | 230 +++++++++++++++++++++++++++++++++++++ + 4 files changed, 246 insertions(+), 128 deletions(-) + create mode 100644 xbmc/cores/omxplayer/OMXPlayer.cpp -diff --git a/language/English/strings.po b/language/English/strings.po -index 92c958b..76fa02a 100755 ---- a/language/English/strings.po -+++ b/language/English/strings.po -@@ -16090,3 +16090,13 @@ msgstr "" - msgctxt "#38021" - msgid "Allow viewing and playing files in archives (e.g. zip, rar)" - msgstr "" -+ -+#: system/settings/settings.xml -+msgctxt "#37033" -+msgid "Select omxplayer or dvdplayer automatically" -+msgstr "" -+ -+#: system/settings/settings.xml -+msgctxt "#37034" -+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 cd1c45c..9f5de0e 100644 ---- a/system/settings/settings.xml -+++ b/system/settings/settings.xml -@@ -751,6 +751,15 @@ - true - - -+ -+ HAS_OMXPLAYER -+ -+ 1 -+ -+ 2 -+ true -+ -+ - - HAS_OMXPLAYER - diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index 6cd4f2d..7ae8826 100644 +index 6cd4f2d..8d5c776 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -490,6 +490,62 @@ void CSelectionStreams::Update(CDVDInputStream* input, CDVDDemux* demuxer, std:: +@@ -85,11 +85,6 @@ + #include "utils/LangCodeExpander.h" + #include "video/VideoReferenceClock.h" + +-#ifdef HAS_OMXPLAYER +-#include "cores/omxplayer/OMXPlayerAudio.h" +-#include "cores/omxplayer/OMXPlayerVideo.h" +-#endif +- + using namespace std; + using namespace PVR; + +@@ -490,17 +485,13 @@ void CSelectionStreams::Update(CDVDInputStream* input, CDVDDemux* demuxer, std:: void CDVDPlayer::CreatePlayers() { ++ if (m_omxplayer_mode) ++ OMXCreatePlayers(); ++ + if (m_players_created) + return; + +- if (m_omxplayer_mode) +- { +-#ifdef HAS_OMXPLAYER +- m_dvdPlayerVideo = new OMXPlayerVideo(&m_OmxPlayerState.av_clock, &m_overlayContainer, m_messenger); +- m_dvdPlayerAudio = new OMXPlayerAudio(&m_OmxPlayerState.av_clock, m_messenger); +-#endif +- } +- else ++ if (!m_omxplayer_mode) + { + m_dvdPlayerVideo = new CDVDPlayerVideo(&m_clock, &m_overlayContainer, m_messenger); + m_dvdPlayerAudio = new CDVDPlayerAudio(&m_clock, m_messenger); +@@ -1046,120 +1037,6 @@ void CDVDPlayer::CheckBetterStream(CCurrentStream& current, CDemuxStream* stream + OpenStream(current, stream->iId, stream->source); + } + +-void CDVDPlayer::OMXDoProcessing() +-{ +-#ifdef HAS_OMXPLAYER +- double now = CDVDClock::GetAbsoluteClock(); +- if (m_OmxPlayerState.last_check_time == 0.0 || m_OmxPlayerState.last_check_time + DVD_MSEC_TO_TIME(20) <= now) +- { +- m_OmxPlayerState.last_check_time = now; +- m_OmxPlayerState.stamp = m_OmxPlayerState.av_clock.OMXMediaTime(); +- const bool m_Pause = m_playSpeed == DVD_PLAYSPEED_PAUSE; +- const bool not_accepts_data = (!m_dvdPlayerAudio->AcceptsData() && m_CurrentAudio.id >= 0) || +- (!m_dvdPlayerVideo->AcceptsData() && m_CurrentVideo.id >= 0); +- /* when the video/audio fifos are low, we pause clock, when high we resume */ +- double audio_pts = floor(m_dvdPlayerAudio->GetCurrentPts()); +- double video_pts = floor(m_dvdPlayerVideo->GetCurrentPts()); +- +- float audio_fifo = audio_pts / DVD_TIME_BASE - m_OmxPlayerState.stamp * 1e-6; +- float video_fifo = video_pts / DVD_TIME_BASE - m_OmxPlayerState.stamp * 1e-6; +- float threshold = 0.1f; +- bool audio_fifo_low = false, video_fifo_low = false, audio_fifo_high = false, video_fifo_high = false; +- +- // if deinterlace setting has changed, we should close and open video +- if (m_OmxPlayerState.current_deinterlace != CMediaSettings::Get().GetCurrentVideoSettings().m_DeinterlaceMode) +- { +- CloseStream(m_CurrentVideo, false); +- OpenStream(m_CurrentVideo, m_CurrentVideo.id, m_CurrentVideo.source); +- if (m_State.canseek) +- m_messenger.Put(new CDVDMsgPlayerSeek(GetTime(), true, true, true, true, true)); +- m_OmxPlayerState.current_deinterlace = CMediaSettings::Get().GetCurrentVideoSettings().m_DeinterlaceMode; +- } +- +- m_OmxPlayerState.video_fifo = (int)(100.0*(m_dvdPlayerVideo->GetDecoderBufferSize()-m_dvdPlayerVideo->GetDecoderFreeSpace())/m_dvdPlayerVideo->GetDecoderBufferSize()); +- m_OmxPlayerState.audio_fifo = (int)(100.0*audio_fifo/m_dvdPlayerAudio->GetCacheTotal()); +- +- #ifdef _DEBUG +- static unsigned count; +- if ((count++ & 7) == 0) +- { +- char response[80]; +- if (m_dvdPlayerVideo->GetDecoderBufferSize() && m_dvdPlayerAudio->GetCacheTotal()) +- vc_gencmd(response, sizeof response, "render_bar 4 video_fifo %d %d %d %d", +- m_OmxPlayerState.video_fifo, +- (int)(100.0*video_fifo/m_dvdPlayerAudio->GetCacheTotal()), +- 0, 100); +- if (m_dvdPlayerAudio->GetCacheTotal()) +- vc_gencmd(response, sizeof response, "render_bar 5 audio_fifo %d %d %d %d", +- m_OmxPlayerState.audio_fifo, +- (int)(100.0*m_dvdPlayerAudio->GetDelay()/m_dvdPlayerAudio->GetCacheTotal()), +- 0, 100); +- vc_gencmd(response, sizeof response, "render_bar 6 video_queue %d %d %d %d", +- m_dvdPlayerVideo->GetLevel(), 0, 0, 100); +- vc_gencmd(response, sizeof response, "render_bar 7 audio_queue %d %d %d %d", +- m_dvdPlayerAudio->GetLevel(), 0, 0, 100); +- } +- #endif +- if (audio_pts != DVD_NOPTS_VALUE) +- { +- audio_fifo_low = m_HasAudio && audio_fifo < threshold; +- audio_fifo_high = audio_pts != DVD_NOPTS_VALUE && audio_fifo >= m_OmxPlayerState.threshold; +- } +- if (video_pts != DVD_NOPTS_VALUE) +- { +- video_fifo_low = m_HasVideo && video_fifo < threshold; +- video_fifo_high = video_pts != DVD_NOPTS_VALUE && video_fifo >= m_OmxPlayerState.threshold; +- } +- if (!m_HasAudio && m_HasVideo) +- audio_fifo_high = true; +- if (!m_HasVideo && m_HasAudio) +- video_fifo_high = true; +- +- #ifdef _DEBUG +- CLog::Log(LOGDEBUG, "%s::%s M:%.6f-%.6f (A:%.6f V:%.6f) PEF:%d%d%d S:%.2f A:%.2f V:%.2f/T:%.2f (A:%d%d V:%d%d) A:%d%% V:%d%% (%.2f,%.2f)", "CDVDPlayer", __FUNCTION__, +- m_OmxPlayerState.stamp*1e-6, m_OmxPlayerState.av_clock.OMXClockAdjustment()*1e-6, audio_pts*1e-6, video_pts*1e-6, m_OmxPlayerState.av_clock.OMXIsPaused(), m_OmxPlayerState.bOmxSentEOFs, not_accepts_data, m_playSpeed * (1.0f/DVD_PLAYSPEED_NORMAL), +- audio_pts == DVD_NOPTS_VALUE ? 0.0:audio_fifo, video_pts == DVD_NOPTS_VALUE ? 0.0:video_fifo, m_OmxPlayerState.threshold, +- audio_fifo_low, audio_fifo_high, video_fifo_low, video_fifo_high, +- m_dvdPlayerAudio->GetLevel(), m_dvdPlayerVideo->GetLevel(), m_dvdPlayerAudio->GetDelay(), (float)m_dvdPlayerAudio->GetCacheTotal()); +- #endif +- +- if(!m_Pause && (m_OmxPlayerState.bOmxSentEOFs || not_accepts_data || (audio_fifo_high && video_fifo_high) || m_playSpeed != DVD_PLAYSPEED_NORMAL)) +- { +- if (m_OmxPlayerState.av_clock.OMXIsPaused()) +- { +- CLog::Log(LOGDEBUG, "%s::%s Resume %.2f,%.2f (A:%d%d V:%d%d) EOF:%d FULL:%d T:%.2f", "CDVDPlayer", __FUNCTION__, audio_fifo, video_fifo, +- audio_fifo_low, audio_fifo_high, video_fifo_low, video_fifo_high, m_OmxPlayerState.bOmxSentEOFs, not_accepts_data, m_OmxPlayerState.threshold); +- m_OmxPlayerState.av_clock.OMXResume(); +- } +- } +- else if ((m_Pause || audio_fifo_low || video_fifo_low) && m_playSpeed == DVD_PLAYSPEED_NORMAL) +- { +- if (!m_OmxPlayerState.av_clock.OMXIsPaused()) +- { +- if (!m_Pause) +- m_OmxPlayerState.threshold = std::min(2.0f*m_OmxPlayerState.threshold, 16.0f); +- CLog::Log(LOGDEBUG, "%s::%s Pause %.2f,%.2f (A:%d%d V:%d%d) EOF:%d FULL:%d T:%.2f", "CDVDPlayer", __FUNCTION__, audio_fifo, video_fifo, +- audio_fifo_low, audio_fifo_high, video_fifo_low, video_fifo_high, m_OmxPlayerState.bOmxSentEOFs, not_accepts_data, m_OmxPlayerState.threshold); +- m_OmxPlayerState.av_clock.OMXPause(); +- } +- } +- } +-#endif +-} +- +-bool CDVDPlayer::OMXStillPlaying() +-{ +- if (m_omxplayer_mode) +- { +- // wait for omx components to finish +- if(m_OmxPlayerState.bOmxWaitVideo && !m_dvdPlayerVideo->IsEOS()) +- return true; +- if(m_OmxPlayerState.bOmxWaitAudio && !m_dvdPlayerAudio->IsEOS()) +- return true; +- } +- return false; +-} +- + void CDVDPlayer::Process() + { + if (!OpenInputStream()) +@@ -1187,6 +1064,8 @@ void CDVDPlayer::Process() + m_bAbortRequest = true; + return; + } ++ // give players a chance to reconsider now codecs are known ++ CreatePlayers(); + + // allow renderer to switch to fullscreen if requested + m_dvdPlayerVideo->EnableFullscreen(m_PlayerOptions.fullscreen); +@@ -4433,3 +4312,10 @@ bool CDVDPlayer::CachePVRStream(void) const + !g_PVRManager.IsPlayingRecording() && + g_advancedSettings.m_bPVRCacheInDvdPlayer; + } ++ ++// Stub functions. OMXPlayer.cpp contains the code when HAS_OMXPLAYER is enabled. ++#ifndef HAS_OMXPLAYER ++void CDVDPlayer::OMXDoProcessing() {} ++bool CDVDPlayer::OMXStillPlaying() { return false; } ++void CDVDPlayer::OMXCreatePlayers() {} ++#endif +diff --git a/xbmc/cores/dvdplayer/DVDPlayer.h b/xbmc/cores/dvdplayer/DVDPlayer.h +index dac00e9..92d471d 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayer.h ++++ b/xbmc/cores/dvdplayer/DVDPlayer.h +@@ -299,6 +299,7 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer + void DestroyPlayers(); + void OMXDoProcessing(); + bool OMXStillPlaying(); ++ void OMXCreatePlayers(); + + bool OpenStream(CCurrentStream& current, int iStream, int source, bool reset = true); + bool OpenStreamPlayer(CCurrentStream& current, CDVDStreamInfo& hint, bool reset); +diff --git a/xbmc/cores/omxplayer/Makefile.in b/xbmc/cores/omxplayer/Makefile.in +index 77c25aa..e5cad70 100644 +--- a/xbmc/cores/omxplayer/Makefile.in ++++ b/xbmc/cores/omxplayer/Makefile.in +@@ -1,6 +1,7 @@ + CXXFLAGS += -D__STDC_FORMAT_MACROS + +-SRCS = OMXAudio.cpp ++SRCS = OMXPlayer.cpp ++SRCS += OMXAudio.cpp + SRCS += OMXVideo.cpp + SRCS += OMXAudioCodecOMX.cpp + SRCS += OMXPlayerAudio.cpp +diff --git a/xbmc/cores/omxplayer/OMXPlayer.cpp b/xbmc/cores/omxplayer/OMXPlayer.cpp +new file mode 100644 +index 0000000..562208a +--- /dev/null ++++ b/xbmc/cores/omxplayer/OMXPlayer.cpp +@@ -0,0 +1,230 @@ ++/* ++ * Copyright (C) 2014 Team XBMC ++ * http://xbmc.org ++ * ++ * This Program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2, or (at your option) ++ * any later version. ++ * ++ * This Program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with XBMC; see the file COPYING. If not, see ++ * . ++ * ++ */ ++ ++#include "system.h" ++ +#ifdef HAS_OMXPLAYER ++ ++#include "DVDPlayer.h" ++#include "settings/Settings.h" ++#include "settings/MediaSettings.h" ++#include "DVDInputStreams/DVDInputStream.h" ++#include "cores/omxplayer/OMXPlayerAudio.h" ++#include "cores/omxplayer/OMXPlayerVideo.h" ++ ++#define PREDICATE_RETURN(lh, rh) \ ++ do { \ ++ if((lh) != (rh)) \ ++ return (lh) > (rh); \ ++ } while(0) ++ ++static bool PredicateVideoPriority(const SelectionStream& lh, const SelectionStream& rh) ++{ ++ PREDICATE_RETURN(lh.flags & CDemuxStream::FLAG_DEFAULT ++ , rh.flags & CDemuxStream::FLAG_DEFAULT); ++ return false; ++} ++ ++void CDVDPlayer::OMXCreatePlayers() ++{ + bool omxplayer_mode = m_omxplayer_mode; -+ bool autoomx = CSettings::Get().GetBool("videoplayer.autoomxplayer"); ++ bool autoomx = CSettings::Get().GetBool("videoplayer.usemmal"); ++ + // omxplayer only handles Pi sink + if (autoomx && m_omxplayer_mode && + CSettings::Get().GetString("audiooutput.audiodevice") != "PI:Analogue" && -+ CSettings::Get().GetString("audiooutput.audiodevice") != "PI:HDMI") ++ CSettings::Get().GetString("audiooutput.audiodevice") != "PI:HDMI" && ++ CSettings::Get().GetString("audiooutput.audiodevice") != "PI:Both") + { + CLog::Log(LOGNOTICE, "COMXPlayer::%s OMXPlayer unsuitable due to audio sink", __func__); + m_omxplayer_mode = false; @@ -4414,25 +4858,140 @@ index 6cd4f2d..7ae8826 100644 + + if (m_omxplayer_mode != omxplayer_mode) + DestroyPlayers(); -+#endif + - if (m_players_created) - return; - -@@ -1187,6 +1243,8 @@ void CDVDPlayer::Process() - m_bAbortRequest = true; - return; - } -+ // give players a chance to reconsider now codecs are known -+ CreatePlayers(); - - // allow renderer to switch to fullscreen if requested - m_dvdPlayerVideo->EnableFullscreen(m_PlayerOptions.fullscreen); ++ if (m_players_created) ++ return; ++ ++ if (m_omxplayer_mode) ++ { ++ m_dvdPlayerVideo = new OMXPlayerVideo(&m_OmxPlayerState.av_clock, &m_overlayContainer, m_messenger); ++ m_dvdPlayerAudio = new OMXPlayerAudio(&m_OmxPlayerState.av_clock, m_messenger); ++ } ++ else ++ { ++ m_dvdPlayerVideo = new CDVDPlayerVideo(&m_clock, &m_overlayContainer, m_messenger); ++ m_dvdPlayerAudio = new CDVDPlayerAudio(&m_clock, m_messenger); ++ } ++} ++ ++void CDVDPlayer::OMXDoProcessing() ++{ ++ double now = CDVDClock::GetAbsoluteClock(); ++ if (m_OmxPlayerState.last_check_time == 0.0 || m_OmxPlayerState.last_check_time + DVD_MSEC_TO_TIME(20) <= now) ++ { ++ m_OmxPlayerState.last_check_time = now; ++ m_OmxPlayerState.stamp = m_OmxPlayerState.av_clock.OMXMediaTime(); ++ const bool m_Pause = m_playSpeed == DVD_PLAYSPEED_PAUSE; ++ const bool not_accepts_data = (!m_dvdPlayerAudio->AcceptsData() && m_CurrentAudio.id >= 0) || ++ (!m_dvdPlayerVideo->AcceptsData() && m_CurrentVideo.id >= 0); ++ /* when the video/audio fifos are low, we pause clock, when high we resume */ ++ double audio_pts = floor(m_dvdPlayerAudio->GetCurrentPts()); ++ double video_pts = floor(m_dvdPlayerVideo->GetCurrentPts()); ++ ++ float audio_fifo = audio_pts / DVD_TIME_BASE - m_OmxPlayerState.stamp * 1e-6; ++ float video_fifo = video_pts / DVD_TIME_BASE - m_OmxPlayerState.stamp * 1e-6; ++ float threshold = 0.1f; ++ bool audio_fifo_low = false, video_fifo_low = false, audio_fifo_high = false, video_fifo_high = false; ++ ++ // if deinterlace setting has changed, we should close and open video ++ if (m_OmxPlayerState.current_deinterlace != CMediaSettings::Get().GetCurrentVideoSettings().m_DeinterlaceMode) ++ { ++ CloseStream(m_CurrentVideo, false); ++ OpenStream(m_CurrentVideo, m_CurrentVideo.id, m_CurrentVideo.source); ++ if (m_State.canseek) ++ m_messenger.Put(new CDVDMsgPlayerSeek(GetTime(), true, true, true, true, true)); ++ m_OmxPlayerState.current_deinterlace = CMediaSettings::Get().GetCurrentVideoSettings().m_DeinterlaceMode; ++ } ++ ++ m_OmxPlayerState.video_fifo = (int)(100.0*(m_dvdPlayerVideo->GetDecoderBufferSize()-m_dvdPlayerVideo->GetDecoderFreeSpace())/m_dvdPlayerVideo->GetDecoderBufferSize()); ++ m_OmxPlayerState.audio_fifo = (int)(100.0*audio_fifo/m_dvdPlayerAudio->GetCacheTotal()); ++ ++ #ifdef _DEBUG ++ static unsigned count; ++ if ((count++ & 7) == 0) ++ { ++ char response[80]; ++ if (m_dvdPlayerVideo->GetDecoderBufferSize() && m_dvdPlayerAudio->GetCacheTotal()) ++ vc_gencmd(response, sizeof response, "render_bar 4 video_fifo %d %d %d %d", ++ m_OmxPlayerState.video_fifo, ++ (int)(100.0*video_fifo/m_dvdPlayerAudio->GetCacheTotal()), ++ 0, 100); ++ if (m_dvdPlayerAudio->GetCacheTotal()) ++ vc_gencmd(response, sizeof response, "render_bar 5 audio_fifo %d %d %d %d", ++ m_OmxPlayerState.audio_fifo, ++ (int)(100.0*m_dvdPlayerAudio->GetDelay()/m_dvdPlayerAudio->GetCacheTotal()), ++ 0, 100); ++ vc_gencmd(response, sizeof response, "render_bar 6 video_queue %d %d %d %d", ++ m_dvdPlayerVideo->GetLevel(), 0, 0, 100); ++ vc_gencmd(response, sizeof response, "render_bar 7 audio_queue %d %d %d %d", ++ m_dvdPlayerAudio->GetLevel(), 0, 0, 100); ++ } ++ #endif ++ if (audio_pts != DVD_NOPTS_VALUE) ++ { ++ audio_fifo_low = m_HasAudio && audio_fifo < threshold; ++ audio_fifo_high = audio_pts != DVD_NOPTS_VALUE && audio_fifo >= m_OmxPlayerState.threshold; ++ } ++ if (video_pts != DVD_NOPTS_VALUE) ++ { ++ video_fifo_low = m_HasVideo && video_fifo < threshold; ++ video_fifo_high = video_pts != DVD_NOPTS_VALUE && video_fifo >= m_OmxPlayerState.threshold; ++ } ++ if (!m_HasAudio && m_HasVideo) ++ audio_fifo_high = true; ++ if (!m_HasVideo && m_HasAudio) ++ video_fifo_high = true; ++ ++ #ifdef _DEBUG ++ CLog::Log(LOGDEBUG, "%s::%s M:%.6f-%.6f (A:%.6f V:%.6f) PEF:%d%d%d S:%.2f A:%.2f V:%.2f/T:%.2f (A:%d%d V:%d%d) A:%d%% V:%d%% (%.2f,%.2f)", "CDVDPlayer", __FUNCTION__, ++ m_OmxPlayerState.stamp*1e-6, m_OmxPlayerState.av_clock.OMXClockAdjustment()*1e-6, audio_pts*1e-6, video_pts*1e-6, m_OmxPlayerState.av_clock.OMXIsPaused(), m_OmxPlayerState.bOmxSentEOFs, not_accepts_data, m_playSpeed * (1.0f/DVD_PLAYSPEED_NORMAL), ++ audio_pts == DVD_NOPTS_VALUE ? 0.0:audio_fifo, video_pts == DVD_NOPTS_VALUE ? 0.0:video_fifo, m_OmxPlayerState.threshold, ++ audio_fifo_low, audio_fifo_high, video_fifo_low, video_fifo_high, ++ m_dvdPlayerAudio->GetLevel(), m_dvdPlayerVideo->GetLevel(), m_dvdPlayerAudio->GetDelay(), (float)m_dvdPlayerAudio->GetCacheTotal()); ++ #endif ++ ++ if(!m_Pause && (m_OmxPlayerState.bOmxSentEOFs || not_accepts_data || (audio_fifo_high && video_fifo_high) || m_playSpeed != DVD_PLAYSPEED_NORMAL)) ++ { ++ if (m_OmxPlayerState.av_clock.OMXIsPaused()) ++ { ++ CLog::Log(LOGDEBUG, "%s::%s Resume %.2f,%.2f (A:%d%d V:%d%d) EOF:%d FULL:%d T:%.2f", "CDVDPlayer", __FUNCTION__, audio_fifo, video_fifo, ++ audio_fifo_low, audio_fifo_high, video_fifo_low, video_fifo_high, m_OmxPlayerState.bOmxSentEOFs, not_accepts_data, m_OmxPlayerState.threshold); ++ m_OmxPlayerState.av_clock.OMXResume(); ++ } ++ } ++ else if ((m_Pause || audio_fifo_low || video_fifo_low) && m_playSpeed == DVD_PLAYSPEED_NORMAL) ++ { ++ if (!m_OmxPlayerState.av_clock.OMXIsPaused()) ++ { ++ if (!m_Pause) ++ m_OmxPlayerState.threshold = std::min(2.0f*m_OmxPlayerState.threshold, 16.0f); ++ CLog::Log(LOGDEBUG, "%s::%s Pause %.2f,%.2f (A:%d%d V:%d%d) EOF:%d FULL:%d T:%.2f", "CDVDPlayer", __FUNCTION__, audio_fifo, video_fifo, ++ audio_fifo_low, audio_fifo_high, video_fifo_low, video_fifo_high, m_OmxPlayerState.bOmxSentEOFs, not_accepts_data, m_OmxPlayerState.threshold); ++ m_OmxPlayerState.av_clock.OMXPause(); ++ } ++ } ++ } ++} ++ ++bool CDVDPlayer::OMXStillPlaying() ++{ ++ if (m_omxplayer_mode) ++ { ++ // wait for omx components to finish ++ if(m_OmxPlayerState.bOmxWaitVideo && !m_dvdPlayerVideo->IsEOS()) ++ return true; ++ if(m_OmxPlayerState.bOmxWaitAudio && !m_dvdPlayerAudio->IsEOS()) ++ return true; ++ } ++ return false; ++} ++ ++#endif -From 6ad2474f1fcc376880b8f86df771f5beb1f23ba3 Mon Sep 17 00:00:00 2001 +From 8f7d7983d27d40d79b2d825cab1e14cc70d43bb4 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 27 Oct 2014 13:06:57 +0000 -Subject: [PATCH 38/95] [rbp] Make cachemembuffersize default depend on memory +Subject: [PATCH 39/84] [rbp] Make cachemembuffersize default depend on memory size --- @@ -4488,10 +5047,11 @@ index 7d04872..ca2d33c 100644 // the following setting determines the readRate of a player data // as multiply of the default data read rate -From 57e6972c07859ce506c42d403026f270a22718bb Mon Sep 17 00:00:00 2001 + +From fd2eb889da0192e4432507301b31689964a68de3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 16 Jun 2014 19:06:00 +0100 -Subject: [PATCH 40/95] [experimental] Disable quiet-noise generation +Subject: [PATCH 41/84] [experimental] Disable quiet-noise generation --- xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp | 2 ++ @@ -4518,10 +5078,10 @@ index c6272cc..9111593 100644 void CActiveAESink::SetSilenceTimer() -From fc4c17d301d9fc450651af04bb0b60ee78e42aa3 Mon Sep 17 00:00:00 2001 +From bfc0bf7ce1679fbf49e76f07b05dc44f2146b3d9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 30 May 2014 14:58:43 +0100 -Subject: [PATCH 41/95] [settings] Experiment: Report DESKTOP resolution in +Subject: [PATCH 42/84] [settings] Experiment: Report DESKTOP resolution in video settings --- @@ -4543,10 +5103,10 @@ index 6902f83..50c5f97 100644 StringUtils::Format("%dx%d%s", resolution->width, resolution->height, ModeFlagsToString(resolution->flags, false).c_str()), -From e47d0185f0616788468a14e975167a51dd0d36ba Mon Sep 17 00:00:00 2001 +From 0f32cb56a27b67230812564ba2f9dd48a33c61ae Mon Sep 17 00:00:00 2001 From: macrule Date: Thu, 11 Apr 2013 18:24:42 +0200 -Subject: [PATCH 42/95] Added some vc_tv_* functions that were missing in +Subject: [PATCH 43/84] Added some vc_tv_* functions that were missing in DllBCM. --- @@ -4581,10 +5141,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 9d69138cbd68a0c896220bb052edae9b804fb1a8 Mon Sep 17 00:00:00 2001 +From c1b97c0fc05d206b619ec437bf7b609f418ee4e5 Mon Sep 17 00:00:00 2001 From: macrule Date: Thu, 11 Apr 2013 18:29:03 +0200 -Subject: [PATCH 43/95] Added private utility function to map a float display +Subject: [PATCH 44/84] Added private utility function to map a float display aspect, to the respective SDTV_ASPECT_* enum value. --- @@ -4622,10 +5182,10 @@ index bf1e589..518a87d 100644 bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &resolutions) -From f4cc522ee7b6351c4cf57adfc4f350971d871b81 Mon Sep 17 00:00:00 2001 +From d2b586f8dd1e5fe997ebdd93c3379db815ac5728 Mon Sep 17 00:00:00 2001 From: macrule Date: Thu, 11 Apr 2013 19:50:58 +0200 -Subject: [PATCH 44/95] Changed SDTV resolutions to be treated similarly to +Subject: [PATCH 45/84] 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. @@ -4722,10 +5282,10 @@ index 59401f5..a0acb1a 100644 int m_width; int m_height; -From 67d3f0ac93606832edf2fc1db8e47ff7c7c9ea22 Mon Sep 17 00:00:00 2001 +From 0da9914c6a192bab9675b1b0b56431c244cd7697 Mon Sep 17 00:00:00 2001 From: macrule Date: Thu, 11 Apr 2013 19:54:59 +0200 -Subject: [PATCH 45/95] Added methods SuspendVideoOutput() and +Subject: [PATCH 46/84] 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. @@ -4789,10 +5349,10 @@ index 9dc39d5..ca36082 100644 CEGLNativeTypeRaspberryPI::CEGLNativeTypeRaspberryPI() { -From 9e614bae6b9f6ec543139eea2d3eba03bbbab1f7 Mon Sep 17 00:00:00 2001 +From 15b66d80f48eccb4126a1c9a997c8337743b123e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 11 Aug 2013 15:03:36 +0100 -Subject: [PATCH 46/95] PowerManager (and its IPowerSyscall instance) now gets +Subject: [PATCH 47/84] 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. @@ -4804,7 +5364,7 @@ Subject: [PATCH 46/95] PowerManager (and its IPowerSyscall instance) now gets 4 files changed, 23 insertions(+) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index d5604dc..83852ec 100644 +index ee59549..77fce2e 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp @@ -2359,6 +2359,13 @@ bool CApplication::OnKey(const CKey& key) @@ -4885,10 +5445,10 @@ index 0b1f10a..e42b143 100644 void OnSleep(); void OnWake(); -From 994e7437a05cad13e7bc34ddb693cb516c05741a Mon Sep 17 00:00:00 2001 +From fcfadef47de52c6691d057e88b49d13122500d87 Mon Sep 17 00:00:00 2001 From: macrule Date: Wed, 17 Apr 2013 13:23:01 +0200 -Subject: [PATCH 47/95] Added CPowerSyscallVirtualSleep class, which acts as a +Subject: [PATCH 48/84] 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. @@ -5064,10 +5624,10 @@ index 0000000..ef6e682 + +#endif // _POWER_SYSCALL_VIRTUAL_SLEEP_H_ -From 48e25588edef3f41d6c716d101f43d6a545d1fc9 Mon Sep 17 00:00:00 2001 +From 041dadd68855d2dc59ce068eb081b77836420e53 Mon Sep 17 00:00:00 2001 From: macrule Date: Wed, 17 Apr 2013 13:24:22 +0200 -Subject: [PATCH 48/95] Added power management support for the Raspberry Pi. +Subject: [PATCH 49/84] 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. @@ -5213,10 +5773,10 @@ index 0000000..fd1d67c + +#endif // _RASPBERRY_PI_POWER_SYSCALL_H_ -From 0b1f5338b1b24b9059983c5677c81d3d681198fd Mon Sep 17 00:00:00 2001 +From 47a6a21243c0559ab2881abf13619b43660500e2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Mar 2014 16:16:29 +0000 -Subject: [PATCH 49/95] [power] hack - don't kill lirc or cec +Subject: [PATCH 50/84] [power] hack - don't kill lirc or cec --- xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 37 +++++++++++++++++++++++ @@ -5224,7 +5784,7 @@ Subject: [PATCH 49/95] [power] hack - don't kill lirc or cec 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp -index 3f1a110..baa570b 100644 +index 1a8fd59..495d58a 100644 --- a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp +++ b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp @@ -183,12 +183,49 @@ void CPeripheralCecAdapter::Announce(AnnouncementFlag flag, const char *sender, @@ -5300,10 +5860,10 @@ index 2d8c750..901f449 100644 CBuiltins::Execute("LIRC.Start"); #endif -From 9075e02d9ecc3a7758b84d5e8a4bdcf0d7c9f748 Mon Sep 17 00:00:00 2001 +From 1ab9c6b73ed7d793f728749a1f9d3eb70396483b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Mar 2014 16:47:54 +0000 -Subject: [PATCH 50/95] [power] hack - wake on any action +Subject: [PATCH 51/84] [power] hack - wake on any action --- xbmc/powermanagement/PowerSyscallVirtualSleep.cpp | 6 +++--- @@ -5332,10 +5892,10 @@ index 6a1e47b..a717a09 100644 if(VirtualWake()) { -From f70dc0df263aa306d5c02b7cda9e57ebe71cbf39 Mon Sep 17 00:00:00 2001 +From 9cbf2f371f474c13a838730c1536686e3a72cd9c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 3 Mar 2014 17:30:07 +0000 -Subject: [PATCH 51/95] [power] hack - Make suspend toggle suspend state +Subject: [PATCH 52/84] [power] hack - Make suspend toggle suspend state --- xbmc/powermanagement/PowerSyscallVirtualSleep.cpp | 5 +++++ @@ -5358,10 +5918,10 @@ index a717a09..d39c3ed 100644 return false; } -From 6de2d7c10df07091b0b045a9a4f1e6507b84f112 Mon Sep 17 00:00:00 2001 +From 7a3661be824a636926f6ea163f3de5d8a27d0327 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 4 Mar 2014 19:33:44 +0000 -Subject: [PATCH 52/95] [power] Add back in powerdown and reboot +Subject: [PATCH 53/84] [power] Add back in powerdown and reboot --- .../linux/RaspberryPIPowerSyscall.cpp | 34 ++++++++++++++++++++++ @@ -5439,10 +5999,10 @@ index fd1d67c..062132e 100644 virtual bool CanReboot() { return true; } -From b604b5136bd629e9ca0abe81387f5ff06fd78660 Mon Sep 17 00:00:00 2001 +From 37bb35f10e4af3ae5de7ac8d5f81362ef9be04a1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 26 Apr 2014 17:27:52 +0100 -Subject: [PATCH 53/95] [cec] Don't suspend pi on tv switch off - it can't wake +Subject: [PATCH 54/84] [cec] Don't suspend pi on tv switch off - it can't wake up --- @@ -5450,7 +6010,7 @@ Subject: [PATCH 53/95] [cec] Don't suspend pi on tv switch off - it can't wake 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/peripherals.xml b/system/peripherals.xml -index 57af5d1..d987670 100644 +index a67dc2f..680863e 100644 --- a/system/peripherals.xml +++ b/system/peripherals.xml @@ -16,7 +16,7 @@ @@ -5463,10 +6023,10 @@ index 57af5d1..d987670 100644 -From 379b04d36dfefc062b5c44793cfa697b7253432f Mon Sep 17 00:00:00 2001 +From 3a0fe40bf7d89c4d2aa87b7a256f3a30a6b6643d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 27 Jun 2014 00:01:05 +0100 -Subject: [PATCH 54/95] [rbp] Resume video output on startup +Subject: [PATCH 55/84] [rbp] Resume video output on startup --- xbmc/linux/RBP.cpp | 3 +++ @@ -5487,10 +6047,10 @@ index cb87b77..34866f6 100644 m_omx_image_init = true; return true; -From 35c1c98b14a01aec3475ce9f63ef2990a87d093a Mon Sep 17 00:00:00 2001 +From cd169945ad5ca652235b1251a7121dfb5b5825ca Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 16 Aug 2014 21:01:42 +0100 -Subject: [PATCH 55/95] omxrender: Hacks to reduce GUI rendering rate when +Subject: [PATCH 56/84] omxrender: Hacks to reduce GUI rendering rate when playing video --- @@ -5500,12 +6060,12 @@ Subject: [PATCH 55/95] 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 76fa02a..3aea198 100755 +index 92c958b..941ebea 100755 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -16100,3 +16100,30 @@ msgstr "" - msgctxt "#37034" - msgid "Uses codec information and audio setting to choose dvdplayer or omxplayer as appropriate" +@@ -16090,3 +16090,30 @@ msgstr "" + msgctxt "#38021" + msgid "Allow viewing and playing files in archives (e.g. zip, rar)" msgstr "" + +#: system/settings/settings.xml @@ -5562,7 +6122,7 @@ index f3c8a01..2996c29 100644 diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index 83852ec..2ae376f 100644 +index 77fce2e..3c7b202 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp @@ -2207,6 +2207,23 @@ void CApplication::Render() @@ -5590,10 +6150,10 @@ index 83852ec..2ae376f 100644 int vsync_mode = CSettings::Get().GetInt("videoscreen.vsync"); -From 53c01591057e66ba2c7df182a259fbd081b5f104 Mon Sep 17 00:00:00 2001 +From 230e15144ab95aad90b2326a1cba36245e0eb0a4 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 9 Sep 2014 12:04:26 +0100 -Subject: [PATCH 56/95] egl: Treat unknown display aspect ratio as square pixel +Subject: [PATCH 57/84] egl: Treat unknown display aspect ratio as square pixel --- xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 4 ++-- @@ -5622,53 +6182,23 @@ index ca36082..1529045 100644 SetResolutionString(m_desktopRes); -From 7de3a2e38899e916b15c67dace78bde6e125b4bc Mon Sep 17 00:00:00 2001 +From 50f665a8fc360edd978327e6ea887590e5a8480c Mon Sep 17 00:00:00 2001 From: anaconda Date: Thu, 11 Sep 2014 21:30:43 +0200 -Subject: [PATCH 57/95] Disable textbox autoscrolling while on screensaver. - ---- - xbmc/guilib/GUITextBox.cpp | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/xbmc/guilib/GUITextBox.cpp b/xbmc/guilib/GUITextBox.cpp -index b7ef051..ba68fad 100644 ---- a/xbmc/guilib/GUITextBox.cpp -+++ b/xbmc/guilib/GUITextBox.cpp -@@ -23,6 +23,7 @@ - #include "utils/XBMCTinyXML.h" - #include "utils/MathUtils.h" - #include "utils/StringUtils.h" -+#include "Application.h" - - using namespace std; - -@@ -132,7 +133,7 @@ void CGUITextBox::Process(unsigned int currentTime, CDirtyRegionList &dirtyregio - // update our auto-scrolling as necessary - if (m_autoScrollTime && m_lines.size() > m_itemsPerPage) - { -- if (!m_autoScrollCondition || m_autoScrollCondition->Get()) -+ if ((!m_autoScrollCondition || m_autoScrollCondition->Get()) && !g_application.IsInScreenSaver()) - { - if (m_lastRenderTime) - m_autoScrollDelayTime += currentTime - m_lastRenderTime; - -From 5b6dceab62f5014a0c6319bfb824e5804ae65ed1 Mon Sep 17 00:00:00 2001 -From: anaconda -Date: Sat, 13 Sep 2014 19:49:01 +0200 -Subject: [PATCH 58/95] SQUASH: only if dim or black +Subject: [PATCH 58/84] Disable textbox autoscrolling while on screensaver. +SQUASH: only if dim or black --- xbmc/Application.cpp | 7 +++++++ xbmc/Application.h | 2 ++ - xbmc/guilib/GUITextBox.cpp | 4 +++- - 3 files changed, 12 insertions(+), 1 deletion(-) + xbmc/guilib/GUITextBox.cpp | 5 ++++- + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index 2ae376f..e81835d 100644 +index 3c7b202..2cf9d11 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp -@@ -5851,3 +5851,10 @@ void CApplication::CloseNetworkShares() +@@ -5853,3 +5853,10 @@ void CApplication::CloseNetworkShares() CSFTPSessionManager::DisconnectAllSessions(); #endif } @@ -5693,14 +6223,22 @@ index 23fd4cf..fd8908a 100644 virtual bool OnSettingsSaving() const; diff --git a/xbmc/guilib/GUITextBox.cpp b/xbmc/guilib/GUITextBox.cpp -index ba68fad..e149418 100644 +index b7ef051..e149418 100644 --- a/xbmc/guilib/GUITextBox.cpp +++ b/xbmc/guilib/GUITextBox.cpp -@@ -133,7 +133,9 @@ void CGUITextBox::Process(unsigned int currentTime, CDirtyRegionList &dirtyregio +@@ -23,6 +23,7 @@ + #include "utils/XBMCTinyXML.h" + #include "utils/MathUtils.h" + #include "utils/StringUtils.h" ++#include "Application.h" + + using namespace std; + +@@ -132,7 +133,9 @@ void CGUITextBox::Process(unsigned int currentTime, CDirtyRegionList &dirtyregio // update our auto-scrolling as necessary if (m_autoScrollTime && m_lines.size() > m_itemsPerPage) { -- if ((!m_autoScrollCondition || m_autoScrollCondition->Get()) && !g_application.IsInScreenSaver()) +- if (!m_autoScrollCondition || m_autoScrollCondition->Get()) + if ((!m_autoScrollCondition || m_autoScrollCondition->Get()) && !(g_application.IsInScreenSaver() && + (g_application.GetScreenSaverId() == "screensaver.xbmc.builtin.black" || + g_application.GetScreenSaverId() == "screensaver.xbmc.builtin.dim"))) @@ -5708,10 +6246,10 @@ index ba68fad..e149418 100644 if (m_lastRenderTime) m_autoScrollDelayTime += currentTime - m_lastRenderTime; -From 36a7a17e3ffbb5153e5455f9a11f744f0e645a59 Mon Sep 17 00:00:00 2001 +From b7fc33db7a9e57cf0bf27599d33d1b866e502a90 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Thu, 18 Sep 2014 14:24:56 +0100 -Subject: [PATCH 59/95] [omxplayer] Only enable audio clock master when A/V +Subject: [PATCH 59/84] [omxplayer] Only enable audio clock master when A/V sync method is set to audio clock --- @@ -5719,7 +6257,7 @@ Subject: [PATCH 59/95] [omxplayer] Only enable audio clock master when A/V 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp -index 6c7fcc2..08808dd 100644 +index 549700c..db0886e 100644 --- a/xbmc/cores/omxplayer/OMXAudio.cpp +++ b/xbmc/cores/omxplayer/OMXAudio.cpp @@ -252,7 +252,8 @@ bool COMXAudio::PortSettingsChanged() @@ -5742,10 +6280,10 @@ index 6c7fcc2..08808dd 100644 OMX_CONFIG_BOOLEANTYPE configBool; OMX_INIT_STRUCTURE(configBool); -From 75e772637c503071df665c413c6ad8f7a07829b9 Mon Sep 17 00:00:00 2001 +From a09ca0ad8c371795aa8ebaa5bf66b31f82e38e5e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 19 Sep 2014 11:54:49 +0100 -Subject: [PATCH 60/95] [dvdplayer/rbp] Add pi specific option to maintain +Subject: [PATCH 60/84] [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". @@ -5764,10 +6302,10 @@ Needed updated firmware 7 files changed, 76 insertions(+), 3 deletions(-) diff --git a/language/English/strings.po b/language/English/strings.po -index 3aea198..079f7cd 100755 +index 941ebea..27fb08a 100755 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -16127,3 +16127,8 @@ msgstr "" +@@ -16117,3 +16117,8 @@ msgstr "" msgctxt "#38005" msgid "24 fps" msgstr "" @@ -5943,10 +6481,10 @@ index f947acc..606c24f 100644 void SuspendVideoOutput(); void ResumeVideoOutput(); -From cad83fe6a44515dfe47fedb6f588748738fb8493 Mon Sep 17 00:00:00 2001 +From 7f5d27a9a0406d05987b3d58bca83a8d5e4ebfae Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 21 Sep 2014 18:31:31 +0100 -Subject: [PATCH 61/95] hack: revert squash: don't update originaldts when +Subject: [PATCH 61/84] hack: revert squash: don't update originaldts when marked as invalid --- @@ -5954,10 +6492,10 @@ Subject: [PATCH 61/95] hack: revert squash: don't update originaldts when 1 file changed, 1 insertion(+) diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index 7ae8826..7406be9 100644 +index 8d5c776..39cd96f 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -2106,6 +2106,7 @@ void CDVDPlayer::CheckContinuity(CCurrentStream& current, DemuxPacket* pPacket) +@@ -1927,6 +1927,7 @@ void CDVDPlayer::CheckContinuity(CCurrentStream& current, DemuxPacket* pPacket) // not sure yet - flags the packets as unknown until we get confirmation on another audio/video packet pPacket->dts = DVD_NOPTS_VALUE; pPacket->pts = DVD_NOPTS_VALUE; @@ -5966,41 +6504,271 @@ index 7ae8826..7406be9 100644 } else -From f2e00759f17947e20bcb24b34fb19d132b0eed63 Mon Sep 17 00:00:00 2001 +From 4bd3f761adccd7108d592c6d699e7837b9fe0fcf Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 27 Sep 2014 15:27:04 +0100 -Subject: [PATCH 62/95] [omxplayer] Don't sync up to passthrough audio packets +Subject: [PATCH 62/84] [omxplayer] Don't sync up to passthrough audio packets - let GPU handle it +This code was just broken. +When sync is lost it attempts to identify how many bytes to skip to regain sync, +but does nothing with that skip count - just drops the whole frame. + +The GPU has similar sync detection code which does avoid dropping the whole frame, +so just pass the packets through and let GPU deal with it. --- - xbmc/cores/omxplayer/OMXAudio.cpp | 2 ++ - 1 file changed, 2 insertions(+) + xbmc/cores/omxplayer/OMXAudio.cpp | 179 -------------------------------------- + xbmc/cores/omxplayer/OMXAudio.h | 3 - + 2 files changed, 182 deletions(-) diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp -index 08808dd..6d9cca4 100644 +index db0886e..d402384 100644 --- a/xbmc/cores/omxplayer/OMXAudio.cpp +++ b/xbmc/cores/omxplayer/OMXAudio.cpp -@@ -1117,6 +1117,7 @@ unsigned int COMXAudio::AddPackets(const void* data, unsigned int len, double dt +@@ -55,11 +55,6 @@ using namespace std; + #define AUDIO_DECODE_OUTPUT_BUFFER (32*1024) + static const char rounded_up_channels_shift[] = {0,0,1,2,2,3,3,3,3}; + +-static const uint16_t AC3Bitrates[] = {32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 448, 512, 576, 640}; +-static const uint16_t AC3FSCod [] = {48000, 44100, 32000, 0}; +- +-static const uint16_t DTSFSCod [] = {0, 8000, 16000, 32000, 0, 0, 11025, 22050, 44100, 0, 0, 12000, 24000, 48000, 0, 0}; +- + ////////////////////////////////////////////////////////////////////// + // Construction/Destruction + ////////////////////////////////////////////////////////////////////// +@@ -86,7 +81,6 @@ COMXAudio::COMXAudio() : + m_av_clock (NULL ), + m_settings_changed(false ), + m_setStartTime (false ), +- m_LostSync (true ), + m_SampleRate (0 ), + m_eEncoding (OMX_AUDIO_CodingPCM), + m_extradata (NULL ), +@@ -978,7 +972,6 @@ bool COMXAudio::Deinitialize() + m_av_clock = NULL; + + m_Initialized = false; +- m_LostSync = true; + m_HWDecode = false; + + if(m_extradata) +@@ -1018,7 +1011,6 @@ void COMXAudio::Flush() + m_last_pts = DVD_NOPTS_VALUE; + m_submitted = 0.0f; + m_maxLevel = 0.0f; +- m_LostSync = true; + m_setStartTime = true; + } + +@@ -1117,20 +1109,6 @@ 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); -@@ -1130,6 +1131,7 @@ unsigned int COMXAudio::AddPackets(const void* data, unsigned int len, double dt - if(skip > 0) - return len; - } -+#endif - +- if(m_eEncoding == OMX_AUDIO_CodingDTS && m_LostSync && (m_Passthrough || m_HWDecode)) +- { +- int skip = SyncDTS((uint8_t *)data, len); +- if(skip > 0) +- return len; +- } +- +- if(m_eEncoding == OMX_AUDIO_CodingDDP && m_LostSync && (m_Passthrough || m_HWDecode)) +- { +- int skip = SyncAC3((uint8_t *)data, len); +- if(skip > 0) +- return len; +- } +- unsigned pitch = (m_Passthrough || m_HWDecode) ? 1:(m_BitsPerSample >> 3) * m_InputChannels; unsigned int demuxer_samples = len / pitch; + unsigned int demuxer_samples_sent = 0; +@@ -1644,160 +1622,3 @@ void COMXAudio::PrintDTS(OMX_AUDIO_PARAM_DTSTYPE *dtsparam) + + PrintChannels(dtsparam->eChannelMapping); + } +- +-/* ========================== SYNC FUNCTIONS ========================== */ +-unsigned int COMXAudio::SyncDTS(BYTE* pData, unsigned int iSize) +-{ +- OMX_INIT_STRUCTURE(m_dtsParam); +- +- unsigned int skip; +- unsigned int srCode; +- unsigned int dtsBlocks; +- bool littleEndian; +- +- for(skip = 0; iSize - skip > 8; ++skip, ++pData) +- { +- if (pData[0] == 0x7F && pData[1] == 0xFE && pData[2] == 0x80 && pData[3] == 0x01) +- { +- /* 16bit le */ +- littleEndian = true; +- dtsBlocks = ((pData[4] >> 2) & 0x7f) + 1; +- m_dtsParam.nFormat = 0x1 | 0x2; +- } +- else if (pData[0] == 0x1F && pData[1] == 0xFF && pData[2] == 0xE8 && pData[3] == 0x00 && pData[4] == 0x07 && (pData[5] & 0xF0) == 0xF0) +- { +- /* 14bit le */ +- littleEndian = true; +- dtsBlocks = (((pData[4] & 0x7) << 4) | (pData[7] & 0x3C) >> 2) + 1; +- m_dtsParam.nFormat = 0x1 | 0x0; +- } +- else if (pData[1] == 0x7F && pData[0] == 0xFE && pData[3] == 0x80 && pData[2] == 0x01) +- { +- /* 16bit be */ +- littleEndian = false; +- dtsBlocks = ((pData[5] >> 2) & 0x7f) + 1; +- m_dtsParam.nFormat = 0x0 | 0x2; +- } +- else if (pData[1] == 0x1F && pData[0] == 0xFF && pData[3] == 0xE8 && pData[2] == 0x00 && pData[5] == 0x07 && (pData[4] & 0xF0) == 0xF0) +- { +- /* 14bit be */ +- littleEndian = false; +- dtsBlocks = (((pData[5] & 0x7) << 4) | (pData[6] & 0x3C) >> 2) + 1; +- m_dtsParam.nFormat = 0x0 | 0x0; +- } +- else +- { +- continue; +- } +- +- if (littleEndian) +- { +- /* if it is not a termination frame, check the next 6 bits are set */ +- if ((pData[4] & 0x80) == 0x80 && (pData[4] & 0x7C) != 0x7C) +- continue; +- +- /* get the frame size */ +- m_dtsParam.nDtsFrameSizeBytes = ((((pData[5] & 0x3) << 8 | pData[6]) << 4) | ((pData[7] & 0xF0) >> 4)) + 1; +- srCode = (pData[8] & 0x3C) >> 2; +- } +- else +- { +- /* if it is not a termination frame, check the next 6 bits are set */ +- if ((pData[5] & 0x80) == 0x80 && (pData[5] & 0x7C) != 0x7C) +- continue; +- +- /* get the frame size */ +- m_dtsParam.nDtsFrameSizeBytes = ((((pData[4] & 0x3) << 8 | pData[7]) << 4) | ((pData[6] & 0xF0) >> 4)) + 1; +- srCode = (pData[9] & 0x3C) >> 2; +- } +- +- /* make sure the framesize is sane */ +- if (m_dtsParam.nDtsFrameSizeBytes < 96 || m_dtsParam.nDtsFrameSizeBytes > 16384) +- continue; +- +- m_dtsParam.nSampleRate = DTSFSCod[srCode]; +- +- switch(dtsBlocks << 5) +- { +- case 512 : +- m_dtsParam.nDtsType = 1; +- break; +- case 1024: +- m_dtsParam.nDtsType = 2; +- break; +- case 2048: +- m_dtsParam.nDtsType = 3; +- break; +- default: +- m_dtsParam.nDtsType = 0; +- break; +- } +- +- //m_dtsParam.nFormat = 1; +- m_dtsParam.nDtsType = 1; +- +- m_LostSync = false; +- +- return skip; +- } +- +- m_LostSync = true; +- return iSize; +-} +- +-unsigned int COMXAudio::SyncAC3(BYTE* pData, unsigned int iSize) +-{ +- unsigned int skip = 0; +- +- for(skip = 0; iSize - skip > 6; ++skip, ++pData) +- { +- /* search for an ac3 sync word */ +- if(pData[0] != 0x0b || pData[1] != 0x77) +- continue; +- +- uint8_t fscod = pData[4] >> 6; +- uint8_t frmsizecod = pData[4] & 0x3F; +- uint8_t bsid = pData[5] >> 3; +- +- /* sanity checks on the header */ +- if ( +- fscod == 3 || +- frmsizecod > 37 || +- bsid > 0x11 +- ) continue; +- +- /* get the details we need to check crc1 and framesize */ +- uint16_t bitrate = AC3Bitrates[frmsizecod >> 1]; +- unsigned int framesize = 0; +- switch(fscod) +- { +- case 0: framesize = bitrate * 2; break; +- case 1: framesize = (320 * bitrate / 147 + (frmsizecod & 1 ? 1 : 0)); break; +- case 2: framesize = bitrate * 4; break; +- } +- +- m_SampleRate = AC3FSCod[fscod]; +- +- /* dont do extensive testing if we have not lost sync */ +- if (!m_LostSync && skip == 0) +- return 0; +- +- unsigned int crc_size; +- /* if we have enough data, validate the entire packet, else try to validate crc2 (5/8 of the packet) */ +- if (framesize <= iSize - skip) +- crc_size = framesize - 1; +- else crc_size = (framesize >> 1) + (framesize >> 3) - 1; +- +- if (crc_size <= iSize - skip) +- if(av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, &pData[2], crc_size * 2)) +- continue; +- +- /* if we get here, we can sync */ +- m_LostSync = false; +- return skip; +- } +- +- /* if we get here, the entire packet is invalid and we have lost sync */ +- m_LostSync = true; +- return iSize; +-} +diff --git a/xbmc/cores/omxplayer/OMXAudio.h b/xbmc/cores/omxplayer/OMXAudio.h +index 7cf10ad..f014364 100644 +--- a/xbmc/cores/omxplayer/OMXAudio.h ++++ b/xbmc/cores/omxplayer/OMXAudio.h +@@ -89,8 +89,6 @@ class COMXAudio + void PrintPCM(OMX_AUDIO_PARAM_PCMMODETYPE *pcm, std::string direction); + void PrintDDP(OMX_AUDIO_PARAM_DDPTYPE *ddparm); + void PrintDTS(OMX_AUDIO_PARAM_DTSTYPE *dtsparam); +- unsigned int SyncDTS(BYTE* pData, unsigned int iSize); +- unsigned int SyncAC3(BYTE* pData, unsigned int iSize); + void UpdateAttenuation(); + + bool BadState() const { return !m_Initialized; }; +@@ -119,7 +117,6 @@ class COMXAudio + OMXClock *m_av_clock; + bool m_settings_changed; + bool m_setStartTime; +- bool m_LostSync; + int m_SampleRate; + OMX_AUDIO_CODINGTYPE m_eEncoding; + uint8_t *m_extradata; -From 0e1a02e98a6ccc0d6876b089db85c17c1c68ad3b Mon Sep 17 00:00:00 2001 +From c577e54a5671508911906aac4c5c19cd7fc175e3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 27 Sep 2014 15:32:37 +0100 -Subject: [PATCH 63/95] [dvdplayer] exerimental: don't raise priority of audio +Subject: [PATCH 63/84] [dvdplayer] exerimental: don't raise priority of audio thread --- @@ -6008,10 +6776,10 @@ Subject: [PATCH 63/95] [dvdplayer] exerimental: don't raise priority of audio 1 file changed, 4 insertions(+) diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index 7406be9..8868bcb 100644 +index 39cd96f..cefbada 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -3320,7 +3320,11 @@ bool CDVDPlayer::OpenAudioStream(CDVDStreamInfo& hint, bool reset) +@@ -3141,7 +3141,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 */ @@ -6024,10 +6792,10 @@ index 7406be9..8868bcb 100644 } -From de6ea0412c53a6dec029395657ebbbc97816e54b Mon Sep 17 00:00:00 2001 +From 5a33b8386118c07456e9017c519e21f63ba5b9df Mon Sep 17 00:00:00 2001 From: da-anda Date: Sun, 17 Aug 2014 21:09:59 +0200 -Subject: [PATCH 64/95] handle stereoscopic mode of videos in mixed playlists +Subject: [PATCH 64/84] handle stereoscopic mode of videos in mixed playlists --- language/English/strings.po | 2 +- @@ -6035,7 +6803,7 @@ Subject: [PATCH 64/95] handle stereoscopic mode of videos in mixed playlists 2 files changed, 49 insertions(+), 29 deletions(-) diff --git a/language/English/strings.po b/language/English/strings.po -index 079f7cd..497d436 100755 +index 27fb08a..78965a2 100755 --- a/language/English/strings.po +++ b/language/English/strings.po @@ -15751,7 +15751,7 @@ msgstr "" @@ -6195,10 +6963,10 @@ index 35ba597..b013942 100644 case 2: // Mono SetStereoMode( RENDER_STEREO_MODE_MONO ); -From 0f952ac62ba0db83d6e51a7e5d7df89c8cd087eb Mon Sep 17 00:00:00 2001 +From c99fd0c13ba5fb22fde25dea5ac1b2596450bd78 Mon Sep 17 00:00:00 2001 From: da-anda Date: Sat, 16 Aug 2014 11:20:54 +0200 -Subject: [PATCH 65/95] remember user selected 3D modes between videos until +Subject: [PATCH 65/84] remember user selected 3D modes between videos until playback ended --- @@ -6415,38 +7183,68 @@ index c1dfb93..cb54bd0 100644 -From 29298807f3cd2be1d8ed0fb9d584cb21277c18dd Mon Sep 17 00:00:00 2001 +From ac892f139b4633dafeb2d7535cbb60fcdc1af2e4 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 28 Sep 2014 19:28:17 +0100 -Subject: [PATCH 66/95] [mmalcodec] Introduce a preroll period to buffer up +Subject: [PATCH 66/84] [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(-) + .../DVDCodecs/Video/DVDVideoCodecMMAL.cpp | 5 ++++ + .../dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h | 1 + + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 35 +++++++++++++++++----- + xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 3 ++ + 4 files changed, 36 insertions(+), 8 deletions(-) +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp +index 55b9969..262283d 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp +@@ -96,4 +96,9 @@ bool CDVDVideoCodecMMAL::GetCodecStats(double &pts, int &droppedPics) + return m_decoder->GetCodecStats(pts, droppedPics); + } + ++void CDVDVideoCodecMMAL::SetSpeed(int iSpeed) ++{ ++ m_decoder->SetSpeed(iSpeed); ++} ++ + #endif +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h +index 67aa505..a768e70 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h +@@ -42,6 +42,7 @@ class CDVDVideoCodecMMAL : public CDVDVideoCodec + virtual void SetDropState(bool bDrop); + virtual const char* GetName(void); + virtual bool GetCodecStats(double &pts, int &droppedPics); ++ virtual void SetSpeed(int iSpeed); + + protected: + MMALVideoPtr m_decoder; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index 6a1f70a..c9aa390 100644 +index 6a1f70a..42886b3 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -136,6 +136,7 @@ CMMALVideo::CMMALVideo() +@@ -136,6 +136,8 @@ CMMALVideo::CMMALVideo() m_output_busy = 0; m_demux_queue_length = 0; m_es_format = mmal_format_alloc(); + m_preroll = true; ++ m_speed = DVD_PLAYSPEED_NORMAL; } CMMALVideo::~CMMALVideo() -@@ -699,6 +700,7 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVide +@@ -699,6 +701,8 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVide m_drop_state = false; m_startframe = false; + m_preroll = !m_hints.stills; ++ m_speed = DVD_PLAYSPEED_NORMAL; return true; } -@@ -910,24 +912,26 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) +@@ -910,24 +914,30 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) break; } int ret = 0; @@ -6463,6 +7261,10 @@ index 6a1f70a..c9aa390 100644 - if (mmal_queue_length(m_dec_input_pool->queue) > 0 && !m_demux_queue_length) + else + m_preroll = false; ++ ++ if (m_preroll && m_output_ready.size() >= GetAllowedReferences()) ++ m_preroll = false; ++ + if (!m_output_ready.empty() && !m_preroll) { #if defined(MMAL_DEBUG_VERBOSE) @@ -6481,44 +7283,63 @@ index 6a1f70a..c9aa390 100644 Sleep(10); // otherwise we busy spin } return ret; -@@ -971,6 +975,7 @@ void CMMALVideo::Reset(void) +@@ -971,8 +981,17 @@ void CMMALVideo::Reset(void) m_decoderPts = DVD_NOPTS_VALUE; m_droppedPics = 0; m_decode_frame_number = 1; -+ m_preroll = !m_hints.stills; ++ m_preroll = !m_hints.stills && (m_speed == DVD_PLAYSPEED_NORMAL || m_speed == DVD_PLAYSPEED_PAUSE); } ++void CMMALVideo::SetSpeed(int iSpeed) ++{ ++#if defined(MMAL_DEBUG_VERBOSE) ++ CLog::Log(LOGDEBUG, "%s::%s %d->%d", CLASSNAME, __func__, m_speed, iSpeed); ++#endif ++ ++ m_speed = iSpeed; ++} + void CMMALVideo::ReturnBuffer(CMMALVideoBuffer *buffer) + { diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -index b4aa571..a2da46b 100644 +index b4aa571..4f81bbd 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -140,6 +140,7 @@ class CMMALVideo +@@ -90,6 +90,7 @@ class CMMALVideo + virtual void SetDropState(bool bDrop); + virtual const char* GetName(void) { return (const char*)m_pFormatName; } + virtual bool GetCodecStats(double &pts, int &droppedPics); ++ virtual void SetSpeed(int iSpeed); + + // MMAL decoder callback routines. + void ReleaseBuffer(CMMALVideoBuffer *buffer); +@@ -140,6 +141,8 @@ class CMMALVideo unsigned int m_decode_frame_number; double m_decoderPts; unsigned int m_droppedPics; ++ int m_speed; + bool m_preroll; MMAL_COMPONENT_T *m_dec; MMAL_PORT_T *m_dec_input; -From b472250a130a13e5d9673543feb98e189dd4809c Mon Sep 17 00:00:00 2001 +From 0acabc2e7c55c81381ff491d7e0bd840c3a10103 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 11 Apr 2014 16:12:27 +0100 -Subject: [PATCH 67/95] [omxplayer] Add ability to log more timestamp info in +Subject: [PATCH 67/84] [omxplayer] Add ability to log more timestamp info in extra debug settings --- language/English/strings.po | 5 +++++ xbmc/commons/ilog.h | 1 + - xbmc/cores/dvdplayer/DVDPlayer.cpp | 10 ++++++---- + xbmc/cores/omxplayer/OMXPlayer.cpp | 12 +++++++----- xbmc/cores/omxplayer/OMXPlayerAudio.cpp | 8 ++++---- xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 9 +++++---- xbmc/settings/AdvancedSettings.cpp | 3 +++ - 6 files changed, 24 insertions(+), 12 deletions(-) + 6 files changed, 25 insertions(+), 13 deletions(-) diff --git a/language/English/strings.po b/language/English/strings.po -index 497d436..54bc484 100755 +index 78965a2..a3d7ac3 100755 --- a/language/English/strings.po +++ b/language/English/strings.po @@ -2887,6 +2887,11 @@ msgctxt "#679" @@ -6545,11 +7366,19 @@ index 92e2835..ad02d95 100644 #include "utils/params_check_macros.h" -diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index 8868bcb..099cef0 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayer.cpp -+++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -1135,7 +1135,8 @@ void CDVDPlayer::OMXDoProcessing() +diff --git a/xbmc/cores/omxplayer/OMXPlayer.cpp b/xbmc/cores/omxplayer/OMXPlayer.cpp +index 562208a..df449e8 100644 +--- a/xbmc/cores/omxplayer/OMXPlayer.cpp ++++ b/xbmc/cores/omxplayer/OMXPlayer.cpp +@@ -23,6 +23,7 @@ + #ifdef HAS_OMXPLAYER + + #include "DVDPlayer.h" ++#include "settings/AdvancedSettings.h" + #include "settings/Settings.h" + #include "settings/MediaSettings.h" + #include "DVDInputStreams/DVDInputStream.h" +@@ -147,7 +148,8 @@ void CDVDPlayer::OMXDoProcessing() m_OmxPlayerState.video_fifo = (int)(100.0*(m_dvdPlayerVideo->GetDecoderBufferSize()-m_dvdPlayerVideo->GetDecoderFreeSpace())/m_dvdPlayerVideo->GetDecoderBufferSize()); m_OmxPlayerState.audio_fifo = (int)(100.0*audio_fifo/m_dvdPlayerAudio->GetCacheTotal()); @@ -6559,7 +7388,7 @@ index 8868bcb..099cef0 100644 static unsigned count; if ((count++ & 7) == 0) { -@@ -1155,7 +1156,7 @@ void CDVDPlayer::OMXDoProcessing() +@@ -167,7 +169,7 @@ void CDVDPlayer::OMXDoProcessing() vc_gencmd(response, sizeof response, "render_bar 7 audio_queue %d %d %d %d", m_dvdPlayerAudio->GetLevel(), 0, 0, 100); } @@ -6568,7 +7397,7 @@ index 8868bcb..099cef0 100644 if (audio_pts != DVD_NOPTS_VALUE) { audio_fifo_low = m_HasAudio && audio_fifo < threshold; -@@ -1171,13 +1172,14 @@ void CDVDPlayer::OMXDoProcessing() +@@ -183,14 +185,14 @@ void CDVDPlayer::OMXDoProcessing() if (!m_HasVideo && m_HasAudio) video_fifo_high = true; @@ -6581,10 +7410,11 @@ index 8868bcb..099cef0 100644 audio_fifo_low, audio_fifo_high, video_fifo_low, video_fifo_high, m_dvdPlayerAudio->GetLevel(), m_dvdPlayerVideo->GetLevel(), m_dvdPlayerAudio->GetDelay(), (float)m_dvdPlayerAudio->GetCacheTotal()); - #endif +- + } - if(!m_Pause && (m_OmxPlayerState.bOmxSentEOFs || not_accepts_data || (audio_fifo_high && video_fifo_high) || m_playSpeed != DVD_PLAYSPEED_NORMAL)) { + if (m_OmxPlayerState.av_clock.OMXIsPaused()) diff --git a/xbmc/cores/omxplayer/OMXPlayerAudio.cpp b/xbmc/cores/omxplayer/OMXPlayerAudio.cpp index f1208e6..f6ef16f 100644 --- a/xbmc/cores/omxplayer/OMXPlayerAudio.cpp @@ -6605,7 +7435,7 @@ index f1208e6..f6ef16f 100644 { // we are not running until something is cached in output device diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index c2bd788..5c4a515 100644 +index 605318c9..783ac20 100644 --- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp +++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp @@ -42,6 +42,7 @@ @@ -6646,10 +7476,10 @@ index ca2d33c..997ed38 100644 void CAdvancedSettings::setExtraLogLevel(const std::vector &components) -From 43b99d483c746cd866e1624999276d9e9349da7e Mon Sep 17 00:00:00 2001 +From a78854f9e915423dd8e76800b30a77cd82d240c4 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 7 Apr 2014 23:13:55 +0100 -Subject: [PATCH 68/95] [omxplayer] Add ability to dump out audio/video data +Subject: [PATCH 68/84] [omxplayer] Add ability to dump out audio/video data for later debugging --- @@ -6661,7 +7491,7 @@ Subject: [PATCH 68/95] [omxplayer] Add ability to dump out audio/video data 5 files changed, 112 insertions(+) diff --git a/language/English/strings.po b/language/English/strings.po -index 54bc484..9719773 100755 +index a3d7ac3..5dff38e 100755 --- a/language/English/strings.po +++ b/language/English/strings.po @@ -2892,6 +2892,16 @@ msgctxt "#697" @@ -6695,12 +7525,12 @@ index ad02d95..be40370 100644 #include "utils/params_check_macros.h" diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp -index 6d9cca4..d3f590a 100644 +index d402384..b5e86ae 100644 --- a/xbmc/cores/omxplayer/OMXAudio.cpp +++ b/xbmc/cores/omxplayer/OMXAudio.cpp -@@ -60,6 +60,49 @@ static const uint16_t AC3FSCod [] = {48000, 44100, 32000, 0}; - - static const uint16_t DTSFSCod [] = {0, 8000, 16000, 32000, 0, 0, 11025, 22050, 44100, 0, 0, 12000, 24000, 48000, 0, 0}; +@@ -55,6 +55,49 @@ using namespace std; + #define AUDIO_DECODE_OUTPUT_BUFFER (32*1024) + static const char rounded_up_channels_shift[] = {0,0,1,2,2,3,3,3,3}; +//#define DEBUG_PLAYBACK +static void dump_omx_buffer(OMX_BUFFERHEADERTYPE *omx_buffer) @@ -6748,7 +7578,7 @@ index 6d9cca4..d3f590a 100644 ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// -@@ -867,6 +910,7 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo +@@ -861,6 +904,7 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo memcpy((unsigned char *)omx_buffer->pBuffer, &m_wave_header, omx_buffer->nFilledLen); omx_buffer->nFlags = OMX_BUFFERFLAG_CODECCONFIG | OMX_BUFFERFLAG_ENDOFFRAME; @@ -6756,7 +7586,7 @@ index 6d9cca4..d3f590a 100644 omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); if (omx_err != OMX_ErrorNone) { -@@ -899,6 +943,7 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo +@@ -893,6 +937,7 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo memcpy((unsigned char *)omx_buffer->pBuffer, m_extradata, omx_buffer->nFilledLen); omx_buffer->nFlags = OMX_BUFFERFLAG_CODECCONFIG | OMX_BUFFERFLAG_ENDOFFRAME; @@ -6764,7 +7594,7 @@ index 6d9cca4..d3f590a 100644 omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); if (omx_err != OMX_ErrorNone) { -@@ -935,6 +980,8 @@ bool COMXAudio::Deinitialize() +@@ -929,6 +974,8 @@ bool COMXAudio::Deinitialize() { CSingleLock lock (m_critSection); @@ -6773,7 +7603,7 @@ index 6d9cca4..d3f590a 100644 if ( m_omx_tunnel_clock_analog.IsInitialized() ) m_omx_tunnel_clock_analog.Deestablish(); if ( m_omx_tunnel_clock_hdmi.IsInitialized() ) -@@ -1241,6 +1288,7 @@ unsigned int COMXAudio::AddPackets(const void* data, unsigned int len, double dt +@@ -1217,6 +1264,7 @@ unsigned int COMXAudio::AddPackets(const void* data, unsigned int len, double dt int nRetry = 0; while(true) { @@ -6781,7 +7611,7 @@ index 6d9cca4..d3f590a 100644 omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); if (omx_err == OMX_ErrorNone) { -@@ -1488,6 +1536,7 @@ void COMXAudio::SubmitEOS() +@@ -1464,6 +1512,7 @@ void COMXAudio::SubmitEOS() omx_buffer->nFlags = OMX_BUFFERFLAG_ENDOFFRAME | OMX_BUFFERFLAG_EOS | OMX_BUFFERFLAG_TIME_UNKNOWN; @@ -6891,116 +7721,19 @@ index 997ed38..7d2aa35 100644 void CAdvancedSettings::setExtraLogLevel(const std::vector &components) -From 46579625a84ad6cf60e2bcb400fabb1dea76d5aa Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 1 Oct 2014 16:34:51 +0100 -Subject: [PATCH 69/95] [mmalcodec] squash: Avoid preroll when using trickplay - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp | 5 +++++ - xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h | 1 + - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 12 +++++++++++- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h | 2 ++ - 4 files changed, 19 insertions(+), 1 deletion(-) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp -index 55b9969..262283d 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.cpp -@@ -96,4 +96,9 @@ bool CDVDVideoCodecMMAL::GetCodecStats(double &pts, int &droppedPics) - return m_decoder->GetCodecStats(pts, droppedPics); - } - -+void CDVDVideoCodecMMAL::SetSpeed(int iSpeed) -+{ -+ m_decoder->SetSpeed(iSpeed); -+} -+ - #endif -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h -index 67aa505..a768e70 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecMMAL.h -@@ -42,6 +42,7 @@ class CDVDVideoCodecMMAL : public CDVDVideoCodec - virtual void SetDropState(bool bDrop); - virtual const char* GetName(void); - virtual bool GetCodecStats(double &pts, int &droppedPics); -+ virtual void SetSpeed(int iSpeed); - - protected: - MMALVideoPtr m_decoder; -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index c9aa390..cee1499 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -137,6 +137,7 @@ CMMALVideo::CMMALVideo() - m_demux_queue_length = 0; - m_es_format = mmal_format_alloc(); - m_preroll = true; -+ m_speed = DVD_PLAYSPEED_NORMAL; - } - - CMMALVideo::~CMMALVideo() -@@ -701,6 +702,7 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options, MMALVide - m_drop_state = false; - m_startframe = false; - m_preroll = !m_hints.stills; -+ m_speed = DVD_PLAYSPEED_NORMAL; - - return true; - } -@@ -975,9 +977,17 @@ void CMMALVideo::Reset(void) - m_decoderPts = DVD_NOPTS_VALUE; - m_droppedPics = 0; - m_decode_frame_number = 1; -- m_preroll = !m_hints.stills; -+ m_preroll = !m_hints.stills && (m_speed == DVD_PLAYSPEED_NORMAL || m_speed == DVD_PLAYSPEED_PAUSE); - } - -+void CMMALVideo::SetSpeed(int iSpeed) -+{ -+#if defined(MMAL_DEBUG_VERBOSE) -+ CLog::Log(LOGDEBUG, "%s::%s %d->%d", CLASSNAME, __func__, m_speed, iSpeed); -+#endif -+ -+ m_speed = iSpeed; -+} - - void CMMALVideo::ReturnBuffer(CMMALVideoBuffer *buffer) - { -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -index a2da46b..4f81bbd 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h -@@ -90,6 +90,7 @@ class CMMALVideo - virtual void SetDropState(bool bDrop); - virtual const char* GetName(void) { return (const char*)m_pFormatName; } - virtual bool GetCodecStats(double &pts, int &droppedPics); -+ virtual void SetSpeed(int iSpeed); - - // MMAL decoder callback routines. - void ReleaseBuffer(CMMALVideoBuffer *buffer); -@@ -140,6 +141,7 @@ class CMMALVideo - unsigned int m_decode_frame_number; - double m_decoderPts; - unsigned int m_droppedPics; -+ int m_speed; - bool m_preroll; - - MMAL_COMPONENT_T *m_dec; - -From 45a6144aa5d9a13aa91de62f489cfd219b6727a0 Mon Sep 17 00:00:00 2001 +From 4727dba883271771bab806bf8c2d3df7a39ae16b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 Oct 2014 22:45:09 +0100 -Subject: [PATCH 70/95] [mmalrenderer] Add choice of 3 deinterlace schemes +Subject: [PATCH 69/84] [mmalrenderer] Add choice of 3 deinterlace schemes --- xbmc/cores/VideoRenderers/MMALRenderer.cpp | 4 ++++ xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 4 +++- - xbmc/cores/dvdplayer/DVDPlayer.cpp | 5 ++++- + xbmc/cores/dvdplayer/DVDPlayer.cpp | 1 + xbmc/cores/dvdplayer/DVDPlayer.h | 1 + + xbmc/cores/omxplayer/OMXPlayer.cpp | 10 +++++++++- xbmc/cores/omxplayer/OMXVideo.cpp | 11 ++++++++--- - 5 files changed, 20 insertions(+), 5 deletions(-) + 6 files changed, 26 insertions(+), 5 deletions(-) diff --git a/xbmc/cores/VideoRenderers/MMALRenderer.cpp b/xbmc/cores/VideoRenderers/MMALRenderer.cpp index 5fb6dce..9cb4d60 100644 @@ -7018,7 +7751,7 @@ index 5fb6dce..9cb4d60 100644 return false; } diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index cee1499..42c62db 100644 +index 42886b3..0498ec7 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp @@ -366,7 +366,9 @@ bool CMMALVideo::CreateDeinterlace(EINTERLACEMETHOD interlace_method) @@ -7033,25 +7766,48 @@ index cee1499..42c62db 100644 if (status != MMAL_SUCCESS) { diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index 099cef0..c3f9b6a 100644 +index cefbada..c8fd0d7 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -618,6 +618,7 @@ CDVDPlayer::CDVDPlayer(IPlayerCallback& callback) +@@ -553,6 +553,7 @@ CDVDPlayer::CDVDPlayer(IPlayerCallback& callback) m_OmxPlayerState.bOmxSentEOFs = false; m_OmxPlayerState.threshold = 0.2f; m_OmxPlayerState.current_deinterlace = CMediaSettings::Get().GetCurrentVideoSettings().m_DeinterlaceMode; -+ m_OmxPlayerState.interlace_method = g_renderManager.AutoInterlaceMethod(CMediaSettings::Get().GetCurrentVideoSettings().m_InterlaceMethod); ++ m_OmxPlayerState.interlace_method = VS_INTERLACEMETHOD_MAX; #ifdef HAS_OMXPLAYER m_omxplayer_mode = CSettings::Get().GetBool("videoplayer.useomxplayer"); #else -@@ -1123,13 +1124,15 @@ void CDVDPlayer::OMXDoProcessing() +diff --git a/xbmc/cores/dvdplayer/DVDPlayer.h b/xbmc/cores/dvdplayer/DVDPlayer.h +index 92d471d..7aa18cf 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayer.h ++++ b/xbmc/cores/dvdplayer/DVDPlayer.h +@@ -542,6 +542,7 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer + { + OMXClock av_clock; // openmax clock component + EDEINTERLACEMODE current_deinterlace; // whether deinterlace is currently enabled ++ EINTERLACEMETHOD interlace_method; // current deinterlace method + bool bOmxWaitVideo; // whether we need to wait for video to play out on EOS + bool bOmxWaitAudio; // whether we need to wait for audio to play out on EOS + bool bOmxSentEOFs; // flag if we've send EOFs to audio/video players +diff --git a/xbmc/cores/omxplayer/OMXPlayer.cpp b/xbmc/cores/omxplayer/OMXPlayer.cpp +index df449e8..0092d13 100644 +--- a/xbmc/cores/omxplayer/OMXPlayer.cpp ++++ b/xbmc/cores/omxplayer/OMXPlayer.cpp +@@ -135,14 +135,22 @@ void CDVDPlayer::OMXDoProcessing() + float threshold = 0.1f; bool audio_fifo_low = false, video_fifo_low = false, audio_fifo_high = false, video_fifo_high = false; ++ if (m_OmxPlayerState.interlace_method == VS_INTERLACEMETHOD_MAX) ++ m_OmxPlayerState.interlace_method = g_renderManager.AutoInterlaceMethod(CMediaSettings::Get().GetCurrentVideoSettings().m_InterlaceMethod); ++ // if deinterlace setting has changed, we should close and open video - if (m_OmxPlayerState.current_deinterlace != CMediaSettings::Get().GetCurrentVideoSettings().m_DeinterlaceMode) + if (m_OmxPlayerState.current_deinterlace != CMediaSettings::Get().GetCurrentVideoSettings().m_DeinterlaceMode || -+ m_OmxPlayerState.interlace_method != g_renderManager.AutoInterlaceMethod(CMediaSettings::Get().GetCurrentVideoSettings().m_InterlaceMethod)) ++ (m_OmxPlayerState.current_deinterlace != VS_DEINTERLACEMODE_OFF && m_OmxPlayerState.interlace_method != g_renderManager.AutoInterlaceMethod(CMediaSettings::Get().GetCurrentVideoSettings().m_InterlaceMethod))) { ++ CLog::Log(LOGERROR, "%s - Reopen stream due to interlace change (%d,%d,%d,%d)", __FUNCTION__, m_OmxPlayerState.current_deinterlace, CMediaSettings::Get().GetCurrentVideoSettings().m_DeinterlaceMode, ++ m_OmxPlayerState.interlace_method, g_renderManager.AutoInterlaceMethod(CMediaSettings::Get().GetCurrentVideoSettings().m_InterlaceMethod)); ++ CloseStream(m_CurrentVideo, false); OpenStream(m_CurrentVideo, m_CurrentVideo.id, m_CurrentVideo.source); if (m_State.canseek) @@ -7061,18 +7817,6 @@ index 099cef0..c3f9b6a 100644 } m_OmxPlayerState.video_fifo = (int)(100.0*(m_dvdPlayerVideo->GetDecoderBufferSize()-m_dvdPlayerVideo->GetDecoderFreeSpace())/m_dvdPlayerVideo->GetDecoderBufferSize()); -diff --git a/xbmc/cores/dvdplayer/DVDPlayer.h b/xbmc/cores/dvdplayer/DVDPlayer.h -index dac00e9..88f5cf8 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayer.h -+++ b/xbmc/cores/dvdplayer/DVDPlayer.h -@@ -541,6 +541,7 @@ class CDVDPlayer : public IPlayer, public CThread, public IDVDPlayer - { - OMXClock av_clock; // openmax clock component - EDEINTERLACEMODE current_deinterlace; // whether deinterlace is currently enabled -+ EINTERLACEMETHOD interlace_method; // current deinterlace method - bool bOmxWaitVideo; // whether we need to wait for video to play out on EOS - bool bOmxWaitAudio; // whether we need to wait for audio to play out on EOS - bool bOmxSentEOFs; // flag if we've send EOFs to audio/video players diff --git a/xbmc/cores/omxplayer/OMXVideo.cpp b/xbmc/cores/omxplayer/OMXVideo.cpp index 6cfb148..37765b1 100644 --- a/xbmc/cores/omxplayer/OMXVideo.cpp @@ -7111,10 +7855,10 @@ index 6cfb148..37765b1 100644 image_filter.eImageFilter = OMX_ImageFilterDeInterlaceFast; else -From 34a9b898e30f8827346cafe07e74f1d11d82081f Mon Sep 17 00:00:00 2001 +From df03904a9d5e7d071735cefeea073786f4a37aa6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 24 Sep 2014 23:13:52 +0100 -Subject: [PATCH 71/95] [audio] Add settings option to boost centre channel +Subject: [PATCH 70/84] [audio] Add settings option to boost centre channel when downmixing This allows a dB volume increase to be added to centre channel. @@ -7132,10 +7876,10 @@ Should work with Pi Sink (dvdplayer/paplayer) and omxplayer 5 files changed, 45 insertions(+) diff --git a/language/English/strings.po b/language/English/strings.po -index 9719773..1157ee9 100755 +index 5dff38e..d8ae1f5 100755 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -16147,3 +16147,17 @@ msgstr "" +@@ -16137,3 +16137,17 @@ msgstr "" msgctxt "#38006" msgid "Adjust PLL" msgstr "" @@ -7154,10 +7898,10 @@ index 9719773..1157ee9 100755 +msgctxt "#38009" +msgid "%i dB" diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index 9f5de0e..d8c3c32 100644 +index 5e0e659..7fb6708 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml -@@ -2457,6 +2457,18 @@ +@@ -2451,6 +2451,18 @@ true @@ -7219,10 +7963,10 @@ index 6565cdb..a50cd70 100644 if (remapLayout) { diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp -index d3f590a..e9646b0 100644 +index b5e86ae..00bae83 100644 --- a/xbmc/cores/omxplayer/OMXAudio.cpp +++ b/xbmc/cores/omxplayer/OMXAudio.cpp -@@ -682,6 +682,12 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo +@@ -676,6 +676,12 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo { av_opt_set_double(m_pContext, "rematrix_maxval", 1.0, 0); } @@ -7236,10 +7980,10 @@ index d3f590a..e9646b0 100644 // stereo upmix if (upmix && m_src_channels == 2 && m_dst_channels > 2) -From 84a5ce396926746b17400c258ffa8204de844b05 Mon Sep 17 00:00:00 2001 +From 536617d3f3dfc7719dc7a75737542d139a185a98 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 3 Oct 2014 18:38:07 +0100 -Subject: [PATCH 72/95] [omxcore] Skip out of flush on error +Subject: [PATCH 71/84] [omxcore] Skip out of flush on error --- xbmc/linux/OMXCore.cpp | 4 ++-- @@ -7268,10 +8012,10 @@ index 4ae29ba..4caa304 100644 OMX_ERRORTYPE omx_err = OMX_ErrorNone; -From 5dd968298108aff52f9859567c15127e7ca3dd36 Mon Sep 17 00:00:00 2001 +From 4e005fa986338da8ec05692d0e1071303762d6db Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 3 Oct 2014 18:40:06 +0100 -Subject: [PATCH 73/95] [SinkPi] Handle multichannel layout more like OMXAudio +Subject: [PATCH 72/84] [SinkPi] Handle multichannel layout more like OMXAudio --- xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp | 14 +++++++------- @@ -7330,10 +8074,10 @@ index 89684e4..fd9a03d 100644 m_format = format; m_sinkbuffer_sec_per_byte = 1.0 / (double)(m_format.m_frameSize * m_format.m_sampleRate); -From cafbe99a74ba29f31b8aa6e4c9554c9467da09b0 Mon Sep 17 00:00:00 2001 +From 4d5273974445b0dd87bc7d56b734b05779e1677b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 5 Oct 2014 14:05:25 +0100 -Subject: [PATCH 74/95] [PiSink] Allow audio output latency to be set in +Subject: [PATCH 73/84] [PiSink] Allow audio output latency to be set in settings --- @@ -7344,10 +8088,10 @@ Subject: [PATCH 74/95] [PiSink] Allow audio output latency to be set in 4 files changed, 36 insertions(+), 5 deletions(-) diff --git a/language/English/strings.po b/language/English/strings.po -index 1157ee9..b370638 100755 +index d8ae1f5..e3e2e03 100755 --- a/language/English/strings.po +++ b/language/English/strings.po -@@ -16161,3 +16161,18 @@ msgstr "" +@@ -16151,3 +16151,18 @@ msgstr "" #: system/settings/settings.xml msgctxt "#38009" msgid "%i dB" @@ -7461,124 +8205,10 @@ index 5c57999..cac5051 100644 bool m_Initialized; uint32_t m_submitted; -From bfc62655a0824e89db28e36489f966aadd649b7f Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Mon, 6 Oct 2014 21:29:41 +0100 -Subject: [PATCH 75/95] [AE] Don't submit data to resampler when more than one - frame is buffered - ---- - xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.cpp -index e40ac2e..9e42385 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.cpp -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.cpp -@@ -258,7 +258,7 @@ bool CActiveAEBufferPoolResample::ResampleBuffers(int64_t timestamp) - - bool skipInput = false; - // avoid that ffmpeg resample buffer grows too large -- if (out_samples > free_samples * 2 && !m_empty) -+ if (out_samples > free_samples && !m_empty) - skipInput = true; - - bool hasInput = !m_inputSamples.empty(); - -From 40798004a378e5f1645ad1db2e6e583fe84a42d8 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sat, 18 Oct 2014 18:13:43 +0100 -Subject: [PATCH 76/95] [mmal] Exit preroll when we have some decoded frames - ---- - xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -index 42c62db..0498ec7 100644 ---- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.cpp -@@ -925,6 +925,10 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - } - else - m_preroll = false; -+ -+ if (m_preroll && m_output_ready.size() >= GetAllowedReferences()) -+ m_preroll = false; -+ - if (!m_output_ready.empty() && !m_preroll) - { - #if defined(MMAL_DEBUG_VERBOSE) - -From aab65f7bac642dc943430ed06781123cf4e0c6e0 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sat, 18 Oct 2014 20:28:49 +0100 -Subject: [PATCH 77/95] config: Add -finstrument-functions - ---- - tools/depends/configure.in | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/tools/depends/configure.in b/tools/depends/configure.in -index 9c4ef7a..bd96e41 100644 ---- a/tools/depends/configure.in -+++ b/tools/depends/configure.in -@@ -303,14 +303,14 @@ if test "$use_platform" = "raspberry-pi"; then - -mfpu=vfp -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated \ - -Wno-deprecated-declarations -isystem${use_firmware}/opt/vc/include \ - -isystem${use_firmware}/opt/vc/include/interface/vcos/pthreads \ -- -isystem${use_firmware}/opt/vc/include/interface/vmcs_host/linux" -+ -isystem${use_firmware}/opt/vc/include/interface/vmcs_host/linux -finstrument-functions" - platform_cxxflags="-pipe -mcpu=arm1176jzf-s -mtune=arm1176jzf-s \ - -mfloat-abi=hard -mfpu=vfp -mabi=aapcs-linux -Wno-psabi \ - -Wa,-mno-warn-deprecated -Wno-deprecated-declarations \ - -isystem${use_firmware}/opt/vc/include \ - -isystem${use_firmware}/opt/vc/include/interface/vcos/pthreads \ -- -isystem${use_firmware}/opt/vc/include/interface/vmcs_host/linux" -- platform_ldflags="-L${use_firmware}/opt/vc/lib -lEGL -lGLESv2 -lbcm_host -lvcos \ -+ -isystem${use_firmware}/opt/vc/include/interface/vmcs_host/linux -finstrument-functions" -+ platform_ldflags="-L${use_firmware}/opt/vc/lib -lEGL -lGLESv2 -lbcm_host -lvcos -lmmal -lmmal_core -lmmal_util \ - -lvchiq_arm" - fi - - -From 50410e2024041bfd2241a81b98fb5a6f301a5145 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sat, 18 Oct 2014 23:02:57 +0100 -Subject: [PATCH 78/95] Revert "config: Add -finstrument-functions" - -This reverts commit 13e6b5aab2e86e8c38202147475d5251236b4e51. ---- - tools/depends/configure.in | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/tools/depends/configure.in b/tools/depends/configure.in -index bd96e41..9c4ef7a 100644 ---- a/tools/depends/configure.in -+++ b/tools/depends/configure.in -@@ -303,14 +303,14 @@ if test "$use_platform" = "raspberry-pi"; then - -mfpu=vfp -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated \ - -Wno-deprecated-declarations -isystem${use_firmware}/opt/vc/include \ - -isystem${use_firmware}/opt/vc/include/interface/vcos/pthreads \ -- -isystem${use_firmware}/opt/vc/include/interface/vmcs_host/linux -finstrument-functions" -+ -isystem${use_firmware}/opt/vc/include/interface/vmcs_host/linux" - platform_cxxflags="-pipe -mcpu=arm1176jzf-s -mtune=arm1176jzf-s \ - -mfloat-abi=hard -mfpu=vfp -mabi=aapcs-linux -Wno-psabi \ - -Wa,-mno-warn-deprecated -Wno-deprecated-declarations \ - -isystem${use_firmware}/opt/vc/include \ - -isystem${use_firmware}/opt/vc/include/interface/vcos/pthreads \ -- -isystem${use_firmware}/opt/vc/include/interface/vmcs_host/linux -finstrument-functions" -- platform_ldflags="-L${use_firmware}/opt/vc/lib -lEGL -lGLESv2 -lbcm_host -lvcos -lmmal -lmmal_core -lmmal_util \ -+ -isystem${use_firmware}/opt/vc/include/interface/vmcs_host/linux" -+ platform_ldflags="-L${use_firmware}/opt/vc/lib -lEGL -lGLESv2 -lbcm_host -lvcos \ - -lvchiq_arm" - fi - - -From fbb9e8af049393deecda73d71e2a58c6fba5f666 Mon Sep 17 00:00:00 2001 +From 422d0c4312c44eef4d0a826f940b54dd0d5fdb54 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 19 Oct 2014 13:43:46 +0100 -Subject: [PATCH 79/95] Revert "hack: revert squash: don't update originaldts +Subject: [PATCH 74/84] Revert "hack: revert squash: don't update originaldts when marked as invalid" This reverts commit 4085c67b535627e1723ca8d7f82f3cdeaa67f54e. @@ -7587,10 +8217,10 @@ This reverts commit 4085c67b535627e1723ca8d7f82f3cdeaa67f54e. 1 file changed, 1 deletion(-) diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index c3f9b6a..5ceec72 100644 +index c8fd0d7..a12a749 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -2111,7 +2111,6 @@ void CDVDPlayer::CheckContinuity(CCurrentStream& current, DemuxPacket* pPacket) +@@ -1928,7 +1928,6 @@ void CDVDPlayer::CheckContinuity(CCurrentStream& current, DemuxPacket* pPacket) // not sure yet - flags the packets as unknown until we get confirmation on another audio/video packet pPacket->dts = DVD_NOPTS_VALUE; pPacket->pts = DVD_NOPTS_VALUE; @@ -7599,96 +8229,10 @@ index c3f9b6a..5ceec72 100644 } else -From b875e111805a2b8f2239577dde4433e1dfa6dd78 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sun, 19 Oct 2014 15:28:47 +0100 -Subject: [PATCH 80/95] [omxplayer] Remove unused function - ---- - xbmc/cores/omxplayer/OMXAudio.cpp | 12 ------------ - xbmc/cores/omxplayer/OMXAudio.h | 1 - - 2 files changed, 13 deletions(-) - -diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp -index e9646b0..516a1a6 100644 ---- a/xbmc/cores/omxplayer/OMXAudio.cpp -+++ b/xbmc/cores/omxplayer/OMXAudio.cpp -@@ -1858,15 +1858,3 @@ unsigned int COMXAudio::SyncAC3(BYTE* pData, unsigned int iSize) - m_LostSync = true; - return iSize; - } -- --void COMXAudio::CheckOutputBufferSize(void **buffer, int *oldSize, int newSize) --{ -- if (newSize > *oldSize) -- { -- if (*buffer) -- _aligned_free(*buffer); -- *buffer = _aligned_malloc(newSize, 16); -- *oldSize = newSize; -- } -- memset(*buffer, 0x0, *oldSize); --} -diff --git a/xbmc/cores/omxplayer/OMXAudio.h b/xbmc/cores/omxplayer/OMXAudio.h -index 85a0b98..7cf10ad 100644 ---- a/xbmc/cores/omxplayer/OMXAudio.h -+++ b/xbmc/cores/omxplayer/OMXAudio.h -@@ -157,7 +157,6 @@ class COMXAudio - COMXCoreTunel m_omx_tunnel_splitter_analog; - COMXCoreTunel m_omx_tunnel_splitter_hdmi; - -- static void CheckOutputBufferSize(void **buffer, int *oldSize, int newSize); - CCriticalSection m_critSection; - }; - #endif - -From 533924d9ba04c05d85275dacdef61bdb5b086159 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Sun, 19 Oct 2014 17:41:35 +0100 -Subject: [PATCH 81/95] [omxplayer] Avoid reopening stream when interlace - hasn't really changed - ---- - xbmc/cores/dvdplayer/DVDPlayer.cpp | 10 ++++++++-- - 1 file changed, 8 insertions(+), 2 deletions(-) - -diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp -index 5ceec72..20fbdef 100644 ---- a/xbmc/cores/dvdplayer/DVDPlayer.cpp -+++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp -@@ -618,7 +618,7 @@ CDVDPlayer::CDVDPlayer(IPlayerCallback& callback) - m_OmxPlayerState.bOmxSentEOFs = false; - m_OmxPlayerState.threshold = 0.2f; - m_OmxPlayerState.current_deinterlace = CMediaSettings::Get().GetCurrentVideoSettings().m_DeinterlaceMode; -- m_OmxPlayerState.interlace_method = g_renderManager.AutoInterlaceMethod(CMediaSettings::Get().GetCurrentVideoSettings().m_InterlaceMethod); -+ m_OmxPlayerState.interlace_method = VS_INTERLACEMETHOD_MAX; - #ifdef HAS_OMXPLAYER - m_omxplayer_mode = CSettings::Get().GetBool("videoplayer.useomxplayer"); - #else -@@ -1123,10 +1123,16 @@ void CDVDPlayer::OMXDoProcessing() - float threshold = 0.1f; - bool audio_fifo_low = false, video_fifo_low = false, audio_fifo_high = false, video_fifo_high = false; - -+ if (m_OmxPlayerState.interlace_method == VS_INTERLACEMETHOD_MAX) -+ m_OmxPlayerState.interlace_method = g_renderManager.AutoInterlaceMethod(CMediaSettings::Get().GetCurrentVideoSettings().m_InterlaceMethod); -+ - // if deinterlace setting has changed, we should close and open video - if (m_OmxPlayerState.current_deinterlace != CMediaSettings::Get().GetCurrentVideoSettings().m_DeinterlaceMode || -- m_OmxPlayerState.interlace_method != g_renderManager.AutoInterlaceMethod(CMediaSettings::Get().GetCurrentVideoSettings().m_InterlaceMethod)) -+ (m_OmxPlayerState.current_deinterlace != VS_DEINTERLACEMODE_OFF && m_OmxPlayerState.interlace_method != g_renderManager.AutoInterlaceMethod(CMediaSettings::Get().GetCurrentVideoSettings().m_InterlaceMethod))) - { -+ CLog::Log(LOGERROR, "%s - Reopen stream due to interlace change (%d,%d,%d,%d)", __FUNCTION__, m_OmxPlayerState.current_deinterlace, CMediaSettings::Get().GetCurrentVideoSettings().m_DeinterlaceMode, -+ m_OmxPlayerState.interlace_method, g_renderManager.AutoInterlaceMethod(CMediaSettings::Get().GetCurrentVideoSettings().m_InterlaceMethod)); -+ - CloseStream(m_CurrentVideo, false); - OpenStream(m_CurrentVideo, m_CurrentVideo.id, m_CurrentVideo.source); - if (m_State.canseek) - - -From aa3b9a73c1684d5806106c2e5167c1e30d1b23b1 Mon Sep 17 00:00:00 2001 +From e9706bde5eef577e597260027a23265e6571f6fa Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 18 Aug 2014 19:09:32 +0100 -Subject: [PATCH 83/95] rbp: Use new dispmanx function for vsync callbacks +Subject: [PATCH 75/84] rbp: Use new dispmanx function for vsync callbacks --- xbmc/linux/RBP.cpp | 85 ++++++++++++++----------- @@ -7900,10 +8444,10 @@ index 1529045..b6bf1fc 100644 } DLOG("CEGLNativeTypeRaspberryPI::DestroyDispmaxWindow\n"); -From 8f7a268f3eb76094309f2a33ae0fb849ded5e4e3 Mon Sep 17 00:00:00 2001 +From acb17cab3258ba839c2c4b3a6418c95d666f2e5b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 19 Aug 2014 17:56:45 +0100 -Subject: [PATCH 84/95] Revert "rbp: Use new dispmanx function for vsync +Subject: [PATCH 76/84] Revert "rbp: Use new dispmanx function for vsync callbacks" This reverts commit afbf8fbceaa6649fb4a6bbd9a1cee6087590412b. @@ -8117,10 +8661,10 @@ index b6bf1fc..1529045 100644 } DLOG("CEGLNativeTypeRaspberryPI::DestroyDispmaxWindow\n"); -From afe35a1f9268711df6c3fc483835eab11454609c Mon Sep 17 00:00:00 2001 +From d17545d6ad47b87b7165026966b62adbb151da4d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 27 Oct 2014 15:23:51 +0000 -Subject: [PATCH 85/95] [rbp] Default extract thumbnails to false +Subject: [PATCH 77/84] [rbp] Default extract thumbnails to false It can take 80 seconds for a single file on a Pi. It can cause crashes with out-of-memory errors. It genereates a lot of support issues. Best to default to disabled and let users enable it if they must @@ -8149,3 +8693,532 @@ index b8e6e59..40be71e 100644
+ + +From b455f4245bab8fd7df5ec1335a98fb23a72642c5 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 3 Nov 2014 17:16:54 +0000 +Subject: [PATCH 79/84] Revert "[omxplayer] Add ability to dump out audio/video + data for later debugging" + +This reverts commit 417416bd29d00f1b42c77488d06e9e6840b8c4f4. +--- + language/English/strings.po | 10 -------- + xbmc/commons/ilog.h | 2 -- + xbmc/cores/omxplayer/OMXAudio.cpp | 49 -------------------------------------- + xbmc/cores/omxplayer/OMXVideo.cpp | 47 ------------------------------------ + xbmc/settings/AdvancedSettings.cpp | 4 ---- + 5 files changed, 112 deletions(-) + +diff --git a/language/English/strings.po b/language/English/strings.po +index 35048a5..fda9370 100755 +--- a/language/English/strings.po ++++ b/language/English/strings.po +@@ -2892,16 +2892,6 @@ msgctxt "#697" + msgid "Verbose logging for OMXPLAYER" + msgstr "" + +-#: xbmc/settings/AdvancedSettings.cpp +-msgctxt "#698" +-msgid "Dump video frames to debug file" +-msgstr "" +- +-#: xbmc/settings/AdvancedSettings.cpp +-msgctxt "#699" +-msgid "Dump audio frames to debug file" +-msgstr "" +- + #empty strings from id 680 to 699 + + msgctxt "#700" +diff --git a/xbmc/commons/ilog.h b/xbmc/commons/ilog.h +index be40370..ad02d95 100644 +--- a/xbmc/commons/ilog.h ++++ b/xbmc/commons/ilog.h +@@ -54,8 +54,6 @@ + #define LOGUPNP (1 << (LOGMASKBIT + 9)) + #define LOGCEC (1 << (LOGMASKBIT + 10)) + #define LOGOMXPLAYER (1 << (LOGMASKBIT+11)) +-#define LOGDUMPVIDEO (1 << (LOGMASKBIT+12)) +-#define LOGDUMPAUDIO (1 << (LOGMASKBIT+13)) + + #include "utils/params_check_macros.h" + +diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp +index 00bae83..f17df87 100644 +--- a/xbmc/cores/omxplayer/OMXAudio.cpp ++++ b/xbmc/cores/omxplayer/OMXAudio.cpp +@@ -55,49 +55,6 @@ using namespace std; + #define AUDIO_DECODE_OUTPUT_BUFFER (32*1024) + static const char rounded_up_channels_shift[] = {0,0,1,2,2,3,3,3,3}; + +-//#define DEBUG_PLAYBACK +-static void dump_omx_buffer(OMX_BUFFERHEADERTYPE *omx_buffer) +-{ +- if (!(g_advancedSettings.CanLogComponent(LOGDUMPAUDIO))) +- return; +- static FILE *fp; +- if (!omx_buffer) +- { +- if (fp) +- { +- fclose(fp); +- fp = NULL; +- } +- return; +- } +- if (!fp) +- { +- char filename[1024]; +- strcpy(filename, g_advancedSettings.m_logFolder.c_str()); +- strcat(filename, "audio.dat"); +-#ifdef DEBUG_PLAYBACK +- fp = fopen(filename, "rb"); +-#else +- fp = fopen(filename, "wb"); +-#endif +- } +- if (fp) +- { +-#ifdef DEBUG_PLAYBACK +- OMX_BUFFERHEADERTYPE omx = {0}; +- int s = fread(&omx, sizeof omx, 1, fp); +- omx_buffer->nFilledLen = omx.nFilledLen; +- omx_buffer->nFlags = omx.nFlags; +- omx_buffer->nTimeStamp = omx.nTimeStamp; +- if (s==1) +- fread(omx_buffer->pBuffer, omx_buffer->nFilledLen, 1, fp); +-#else +- if (fwrite(omx_buffer, sizeof *omx_buffer, 1, fp) == 1) +- fwrite(omx_buffer->pBuffer, omx_buffer->nFilledLen, 1, fp); +-#endif +- } +-} +- + ////////////////////////////////////////////////////////////////////// + // Construction/Destruction + ////////////////////////////////////////////////////////////////////// +@@ -910,7 +867,6 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo + memcpy((unsigned char *)omx_buffer->pBuffer, &m_wave_header, omx_buffer->nFilledLen); + omx_buffer->nFlags = OMX_BUFFERFLAG_CODECCONFIG | OMX_BUFFERFLAG_ENDOFFRAME; + +- dump_omx_buffer(omx_buffer); + omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); + if (omx_err != OMX_ErrorNone) + { +@@ -943,7 +899,6 @@ bool COMXAudio::Initialize(AEAudioFormat format, OMXClock *clock, CDVDStreamInfo + memcpy((unsigned char *)omx_buffer->pBuffer, m_extradata, omx_buffer->nFilledLen); + omx_buffer->nFlags = OMX_BUFFERFLAG_CODECCONFIG | OMX_BUFFERFLAG_ENDOFFRAME; + +- dump_omx_buffer(omx_buffer); + omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); + if (omx_err != OMX_ErrorNone) + { +@@ -980,8 +935,6 @@ bool COMXAudio::Deinitialize() + { + CSingleLock lock (m_critSection); + +- dump_omx_buffer(NULL); +- + if ( m_omx_tunnel_clock_analog.IsInitialized() ) + m_omx_tunnel_clock_analog.Deestablish(); + if ( m_omx_tunnel_clock_hdmi.IsInitialized() ) +@@ -1270,7 +1223,6 @@ unsigned int COMXAudio::AddPackets(const void* data, unsigned int len, double dt + int nRetry = 0; + while(true) + { +- dump_omx_buffer(omx_buffer); + omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); + if (omx_err == OMX_ErrorNone) + { +@@ -1518,7 +1470,6 @@ void COMXAudio::SubmitEOS() + + omx_buffer->nFlags = OMX_BUFFERFLAG_ENDOFFRAME | OMX_BUFFERFLAG_EOS | OMX_BUFFERFLAG_TIME_UNKNOWN; + +- dump_omx_buffer(omx_buffer); + omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); + if (omx_err != OMX_ErrorNone) + { +diff --git a/xbmc/cores/omxplayer/OMXVideo.cpp b/xbmc/cores/omxplayer/OMXVideo.cpp +index 37765b1..6e07e0a 100644 +--- a/xbmc/cores/omxplayer/OMXVideo.cpp ++++ b/xbmc/cores/omxplayer/OMXVideo.cpp +@@ -65,49 +65,6 @@ + + #define MAX_TEXT_LENGTH 1024 + +-//#define DEBUG_PLAYBACK +-static void dump_omx_buffer(OMX_BUFFERHEADERTYPE *omx_buffer) +-{ +- if (!(g_advancedSettings.CanLogComponent(LOGDUMPVIDEO))) +- return; +- static FILE *fp; +- if (!omx_buffer) +- { +- if (fp) +- { +- fclose(fp); +- fp = NULL; +- } +- return; +- } +- if (!fp) +- { +- char filename[1024]; +- strcpy(filename, g_advancedSettings.m_logFolder.c_str()); +- strcat(filename, "video.dat"); +-#ifdef DEBUG_PLAYBACK +- fp = fopen(filename, "rb"); +-#else +- fp = fopen(filename, "wb"); +-#endif +- } +- if (fp) +- { +-#ifdef DEBUG_PLAYBACK +- OMX_BUFFERHEADERTYPE omx = {0}; +- int s = fread(&omx, sizeof omx, 1, fp); +- omx_buffer->nFilledLen = omx.nFilledLen; +- omx_buffer->nFlags = omx.nFlags; +- omx_buffer->nTimeStamp = omx.nTimeStamp; +- if (s==1) +- fread(omx_buffer->pBuffer, omx_buffer->nFilledLen, 1, fp); +-#else +- if (fwrite(omx_buffer, sizeof *omx_buffer, 1, fp) == 1) +- fwrite(omx_buffer->pBuffer, omx_buffer->nFilledLen, 1, fp); +-#endif +- } +-} +- + COMXVideo::COMXVideo() : m_video_codec_name("") + { + m_is_open = false; +@@ -163,7 +120,6 @@ bool COMXVideo::SendDecoderConfig() + memcpy((unsigned char *)omx_buffer->pBuffer, m_extradata, omx_buffer->nFilledLen); + omx_buffer->nFlags = OMX_BUFFERFLAG_CODECCONFIG | OMX_BUFFERFLAG_ENDOFFRAME; + +- dump_omx_buffer(omx_buffer); + omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); + if (omx_err != OMX_ErrorNone) + { +@@ -756,7 +712,6 @@ bool COMXVideo::Open(CDVDStreamInfo &hints, OMXClock *clock, EDEINTERLACEMODE de + void COMXVideo::Close() + { + CSingleLock lock (m_critSection); +- dump_omx_buffer(NULL); + m_omx_tunnel_clock.Deestablish(); + m_omx_tunnel_decoder.Deestablish(); + if(m_deinterlace) +@@ -851,7 +806,6 @@ int COMXVideo::Decode(uint8_t *pData, int iSize, double pts) + int nRetry = 0; + while(true) + { +- dump_omx_buffer(omx_buffer); + omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); + if (omx_err == OMX_ErrorNone) + { +@@ -982,7 +936,6 @@ void COMXVideo::SubmitEOS() + + omx_buffer->nFlags = OMX_BUFFERFLAG_ENDOFFRAME | OMX_BUFFERFLAG_EOS | OMX_BUFFERFLAG_TIME_UNKNOWN; + +- dump_omx_buffer(omx_buffer); + omx_err = m_omx_decoder.EmptyThisBuffer(omx_buffer); + if (omx_err != OMX_ErrorNone) + { +diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp +index 7d2aa35..997ed38 100644 +--- a/xbmc/settings/AdvancedSettings.cpp ++++ b/xbmc/settings/AdvancedSettings.cpp +@@ -1388,10 +1388,6 @@ void CAdvancedSettings::SettingOptionsLoggingComponentsFiller(const CSetting *se + #ifdef TARGET_RASPBERRY_PI + list.push_back(std::make_pair(g_localizeStrings.Get(697), LOGOMXPLAYER)); + #endif +-#ifdef TARGET_RASPBERRY_PI +- list.push_back(std::make_pair(g_localizeStrings.Get(698), LOGDUMPVIDEO)); +- list.push_back(std::make_pair(g_localizeStrings.Get(699), LOGDUMPAUDIO)); +-#endif + } + + void CAdvancedSettings::setExtraLogLevel(const std::vector &components) + +From 87b41d3a0f4959b4e4248a5cd784c90c7caeefd4 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 7 Apr 2014 23:13:55 +0100 +Subject: [PATCH 80/84] [omxplayer] Add ability to dump out audio/video data + for later debugging + +--- + language/English/strings.po | 10 ++++++ + xbmc/commons/ilog.h | 2 ++ + xbmc/cores/dvdplayer/DVDPlayer.cpp | 63 ++++++++++++++++++++++++++++++++++++++ + xbmc/settings/AdvancedSettings.cpp | 4 +++ + 4 files changed, 79 insertions(+) + +diff --git a/language/English/strings.po b/language/English/strings.po +index fda9370..35048a5 100755 +--- a/language/English/strings.po ++++ b/language/English/strings.po +@@ -2892,6 +2892,16 @@ msgctxt "#697" + msgid "Verbose logging for OMXPLAYER" + msgstr "" + ++#: xbmc/settings/AdvancedSettings.cpp ++msgctxt "#698" ++msgid "Dump video frames to debug file" ++msgstr "" ++ ++#: xbmc/settings/AdvancedSettings.cpp ++msgctxt "#699" ++msgid "Dump audio frames to debug file" ++msgstr "" ++ + #empty strings from id 680 to 699 + + msgctxt "#700" +diff --git a/xbmc/commons/ilog.h b/xbmc/commons/ilog.h +index ad02d95..be40370 100644 +--- a/xbmc/commons/ilog.h ++++ b/xbmc/commons/ilog.h +@@ -54,6 +54,8 @@ + #define LOGUPNP (1 << (LOGMASKBIT + 9)) + #define LOGCEC (1 << (LOGMASKBIT + 10)) + #define LOGOMXPLAYER (1 << (LOGMASKBIT+11)) ++#define LOGDUMPVIDEO (1 << (LOGMASKBIT+12)) ++#define LOGDUMPAUDIO (1 << (LOGMASKBIT+13)) + + #include "utils/params_check_macros.h" + +diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp +index a12a749..037f10b 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayer.cpp ++++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp +@@ -88,6 +88,61 @@ + using namespace std; + using namespace PVR; + ++//#define DEBUG_PLAYBACK ++static void dump_packet(DemuxPacket *packet, bool video, bool audio) ++{ ++ static CCriticalSection m_section; ++ static FILE *fp_video, *fp_audio; ++ if ((!video || !g_advancedSettings.CanLogComponent(LOGDUMPVIDEO)) && ++ (!audio || !g_advancedSettings.CanLogComponent(LOGDUMPAUDIO))) ++ return; ++ const char *fname = video ? "video.dat" : "audio.dat"; ++ FILE *&fp = video ? fp_video : fp_audio; ++ CSingleLock lock(m_section); ++ if (!packet) ++ { ++ if (fp) ++ { ++ CLog::Log(LOGNOTICE, "%s:: Closing file %p", __func__, fp); ++ fclose(fp); ++ fp = NULL; ++ } ++ return; ++ } ++ if (!fp) ++ { ++ char filename[1024]; ++ strcpy(filename, g_advancedSettings.m_logFolder.c_str()); ++ strcat(filename, fname); ++#ifdef DEBUG_PLAYBACK ++ fp = fopen(filename, "rb"); ++#else ++ fp = fopen(filename, "wb"); ++#endif ++ CLog::Log(LOGNOTICE, "%s:: Opening file %s = %p", __func__, filename, fp); ++ } ++ if (fp) ++ { ++#ifdef DEBUG_PLAYBACK ++ DemuxPacket p = {0}; ++ int s = fread(&p, sizeof p, 1, fp); ++ if (s==1) ++ { ++ packet->iSize = p.iSize; ++ packet->dts = p.dts; ++ packet->pts = p.pts; ++ _aligned_free(packet->pData); ++ packet->pData = (uint8_t*)_aligned_malloc(packet->iSize + FF_INPUT_BUFFER_PADDING_SIZE, 16); ++ fread(packet->pData, packet->iSize, 1, fp); ++ } ++#else ++ if (fwrite(packet, sizeof *packet, 1, fp) == 1) ++ fwrite(packet->pData, packet->iSize, 1, fp); ++#endif ++ } ++} ++ ++ + void CSelectionStreams::Clear(StreamType type, StreamSource source) + { + CSingleLock lock(m_section); +@@ -915,6 +970,12 @@ bool CDVDPlayer::ReadPacket(DemuxPacket*& packet, CDemuxStream*& stream) + return true; + } + ++ if(m_pDemuxer) ++ { ++ stream = m_pDemuxer->GetStream(packet->iStreamId); ++ if (stream) ++ dump_packet(packet, CheckIsCurrent(m_CurrentVideo, stream, packet), CheckIsCurrent(m_CurrentAudio, stream, packet)); ++ } + UpdateCorrection(packet, m_offset_pts); + + if(packet->iStreamId < 0) +@@ -3257,6 +3318,8 @@ bool CDVDPlayer::CloseStream(CCurrentStream& current, bool bWaitForBuffers) + if(bWaitForBuffers) + SetCaching(CACHESTATE_DONE); + ++ dump_packet(NULL, current.player == DVDPLAYER_VIDEO, current.player == DVDPLAYER_AUDIO); ++ + IDVDStreamPlayer* player = GetStreamPlayer(current.player); + if(player) + player->CloseStream(bWaitForBuffers); +diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp +index 997ed38..7d2aa35 100644 +--- a/xbmc/settings/AdvancedSettings.cpp ++++ b/xbmc/settings/AdvancedSettings.cpp +@@ -1388,6 +1388,10 @@ void CAdvancedSettings::SettingOptionsLoggingComponentsFiller(const CSetting *se + #ifdef TARGET_RASPBERRY_PI + list.push_back(std::make_pair(g_localizeStrings.Get(697), LOGOMXPLAYER)); + #endif ++#ifdef TARGET_RASPBERRY_PI ++ list.push_back(std::make_pair(g_localizeStrings.Get(698), LOGDUMPVIDEO)); ++ list.push_back(std::make_pair(g_localizeStrings.Get(699), LOGDUMPAUDIO)); ++#endif + } + + void CAdvancedSettings::setExtraLogLevel(const std::vector &components) + + + +From 5979033267d217df157faf9677a9e3aa0d2434e8 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 5 Nov 2014 14:51:16 +0000 +Subject: [PATCH 83/84] [DVDMessageQueue] Remove pi specific logging ifdef + +--- + xbmc/cores/dvdplayer/DVDMessageQueue.cpp | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDMessageQueue.cpp b/xbmc/cores/dvdplayer/DVDMessageQueue.cpp +index 92fa67a..f6ad8d0 100644 +--- a/xbmc/cores/dvdplayer/DVDMessageQueue.cpp ++++ b/xbmc/cores/dvdplayer/DVDMessageQueue.cpp +@@ -162,9 +162,7 @@ MsgQueueReturnCode CDVDMessageQueue::Get(CDVDMsg** pMsg, unsigned int iTimeoutIn + + if(m_list.empty() && m_bEmptied == false && priority == 0 && m_owner != "teletext") + { +-#if !defined(TARGET_RASPBERRY_PI) + CLog::Log(LOGWARNING, "CDVDMessageQueue(%s)::Get - asked for new data packet, with nothing available", m_owner.c_str()); +-#endif + m_bEmptied = true; + } + + +From bf844e9a224e312ec02a6aa5d7433ea13fa42f82 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Thu, 6 Nov 2014 16:20:30 +0000 +Subject: [PATCH 84/84] [ResamplePi] Add support for formats that need shifting + +This case is triggered by HiFiBerry's 24-bit format. +Requires updated firmware +--- + .../Engines/ActiveAE/ActiveAEResamplePi.cpp | 28 +++++++++++++--------- + .../Engines/ActiveAE/ActiveAEResamplePi.h | 1 + + 2 files changed, 18 insertions(+), 11 deletions(-) + +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp +index a50cd70..84505bf 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp +@@ -115,10 +115,6 @@ bool CActiveAEResamplePi::Init(uint64_t dst_chan_layout, int dst_channels, int d + + CLog::Log(LOGINFO, "%s::%s remap:%p chan:%d->%d rate:%d->%d format:%d->%d bits:%d->%d dither:%d->%d norm:%d upmix:%d", CLASSNAME, __func__, remapLayout, src_channels, dst_channels, src_rate, dst_rate, src_fmt, dst_fmt, src_bits, dst_bits, src_dither, dst_dither, normalize, upmix); + +- if (!src_bits) +- src_bits = format_to_bits(src_fmt); +- if (!dst_bits) +- dst_bits = format_to_bits(dst_fmt); + m_dst_chan_layout = dst_chan_layout; + m_dst_channels = dst_channels; + m_dst_rate = dst_rate; +@@ -132,6 +128,12 @@ bool CActiveAEResamplePi::Init(uint64_t dst_chan_layout, int dst_channels, int d + m_src_bits = src_bits; + m_src_dither_bits = src_dither; + m_offset = 0; ++ m_src_pitch = format_to_bits(m_src_fmt) >> 3; ++ m_dst_pitch = format_to_bits(m_dst_fmt) >> 3; ++ ++ // special handling for S24 formats which are carried in S32 (S24NE3) ++ if ((m_dst_fmt == AV_SAMPLE_FMT_S32 || m_dst_fmt == AV_SAMPLE_FMT_S32P) && m_dst_bits == 24 && m_dst_dither_bits == -8) ++ m_dst_pitch = 24; + + if (m_dst_chan_layout == 0) + m_dst_chan_layout = av_get_default_channel_layout(m_dst_channels); +@@ -304,7 +306,7 @@ bool CActiveAEResamplePi::Init(uint64_t dst_chan_layout, int dst_channels, int d + m_pcm_input.eNumData = OMX_NumericalDataSigned; + m_pcm_input.eEndian = OMX_EndianLittle; + m_pcm_input.bInterleaved = OMX_TRUE; +- m_pcm_input.nBitPerSample = m_src_bits; ++ m_pcm_input.nBitPerSample = m_src_pitch << 3; + // 0x8000 = float, 0x10000 = planar + uint32_t flags = 0; + if (m_src_fmt == AV_SAMPLE_FMT_FLT || m_src_fmt == AV_SAMPLE_FMT_FLTP) +@@ -324,12 +326,16 @@ bool CActiveAEResamplePi::Init(uint64_t dst_chan_layout, int dst_channels, int d + m_pcm_output.eNumData = OMX_NumericalDataSigned; + m_pcm_output.eEndian = OMX_EndianLittle; + m_pcm_output.bInterleaved = OMX_TRUE; +- m_pcm_output.nBitPerSample = m_dst_bits; ++ m_pcm_output.nBitPerSample = m_dst_pitch << 3; + flags = 0; + if (m_dst_fmt == AV_SAMPLE_FMT_FLT || m_dst_fmt == AV_SAMPLE_FMT_FLTP) + flags |= 0x8000; + if (m_dst_fmt >= AV_SAMPLE_FMT_U8P) + flags |= 0x10000; ++ // shift bits if destination format requires it, swr_resamples aligns to the left ++ if (m_dst_bits != 32 && (m_dst_dither_bits + m_dst_bits) != 32) ++ flags |= (32 - m_dst_bits - m_dst_dither_bits) << 8; ++ + m_pcm_output.ePCMMode = flags == 0 ? OMX_AUDIO_PCMModeLinear : (OMX_AUDIO_PCMMODETYPE)flags; + m_pcm_output.nChannels = dst_channels; + m_pcm_output.nSamplingRate = dst_rate; +@@ -440,11 +446,11 @@ int CActiveAEResamplePi::Resample(uint8_t **dst_buffer, int dst_samples, uint8_t + const int d_planes = m_dst_fmt >= AV_SAMPLE_FMT_U8P ? m_dst_channels : 1; + const int s_chans = m_src_fmt >= AV_SAMPLE_FMT_U8P ? 1 : m_src_channels; + const int d_chans = m_dst_fmt >= AV_SAMPLE_FMT_U8P ? 1 : m_dst_channels; +- const int s_pitch = s_chans * m_src_bits >> 3; +- const int d_pitch = d_chans * m_dst_bits >> 3; ++ const int s_pitch = s_chans * m_src_pitch; ++ const int d_pitch = d_chans * m_dst_pitch; + +- const int s_samplesize = m_src_channels * m_src_bits >> 3; +- const int d_samplesize = m_dst_channels * m_dst_bits >> 3; ++ const int s_samplesize = m_src_channels * m_src_pitch; ++ const int d_samplesize = m_dst_channels * m_dst_pitch; + const int max_src_samples = BUFFERSIZE / s_samplesize; + const int max_dst_samples = (long long)(BUFFERSIZE / d_samplesize) * m_src_rate / (m_dst_rate + m_src_rate-1); + +@@ -550,7 +556,7 @@ int CActiveAEResamplePi::GetBufferedSamples() + int samples = 0; + if (m_encoded_buffer) + { +- const int d_samplesize = m_dst_channels * m_dst_bits >> 3; ++ const int d_samplesize = m_dst_channels * m_src_pitch; + samples = m_encoded_buffer->nFilledLen / d_samplesize - m_offset; + } + #ifdef DEBUG_VERBOSE +diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.h +index dfa3e4a..25588d4 100644 +--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.h ++++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.h +@@ -47,6 +47,7 @@ class CActiveAEResamplePi : public IAEResample + int m_src_channels, m_dst_channels; + AVSampleFormat m_src_fmt, m_dst_fmt; + int m_src_bits, m_dst_bits; ++ int m_src_pitch, m_dst_pitch; + int m_src_dither_bits, m_dst_dither_bits; + + OMX_AUDIO_PARAM_PCMMODETYPE m_pcm_input;