[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#988616: release.debian.org: kodi-inputstream-ffmpegdirect/1.21.3+ds1-1



Package: release.debian.org
Followup-For: Bug #988616

Hi Sebastian,

I made a new release under a 'bullseye' branch at Salsa repo, with backported
patches excluding ffmpeg 4.4 integration. The debdiff attached.

Cheers,
Vasyl
diff -Nru kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/changelog kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/changelog
--- kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/changelog	2021-02-18 23:38:47.000000000 +0000
+++ kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/changelog	2021-06-07 06:45:39.000000000 +0000
@@ -1,3 +1,11 @@
+kodi-inputstream-ffmpegdirect (1.19.2+ds1-2) UNRELEASED; urgency=medium
+
+  * Branch out bullseye
+  * Backport fixes into bullseye
+  * Fix link to github release tarball
+
+ -- Vasyl Gello <vasek.gello@gmail.com>  Mon, 07 Jun 2021 06:45:39 +0000
+
 kodi-inputstream-ffmpegdirect (1.19.2+ds1-1) unstable; urgency=medium
 
   * New upstream version 1.19.2+ds1
diff -Nru kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/control kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/control
--- kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/control	2021-02-18 23:38:47.000000000 +0000
+++ kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/control	2021-06-07 06:45:39.000000000 +0000
@@ -22,7 +22,7 @@
 Standards-Version: 4.5.1
 Rules-Requires-Root: no
 Vcs-Browser: https://salsa.debian.org/multimedia-team/kodi-media-center/kodi-inputstream-ffmpegdirect
-Vcs-Git: https://salsa.debian.org/multimedia-team/kodi-media-center/kodi-inputstream-ffmpegdirect.git
+Vcs-Git: https://salsa.debian.org/multimedia-team/kodi-media-center/kodi-inputstream-ffmpegdirect.git -b bullseye
 Homepage: https://kodi.tv/
 
 Package: kodi-inputstream-ffmpegdirect
diff -Nru kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/gbp.conf kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/gbp.conf
--- kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/gbp.conf	2021-02-18 23:38:47.000000000 +0000
+++ kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/gbp.conf	2021-06-07 06:45:39.000000000 +0000
@@ -1,4 +1,5 @@
 # Configuration file for git-buildpackage and friends
 
 [DEFAULT]
+debian-branch = bullseye
 filter = */.git*
diff -Nru kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/patches/bullseye-freeze/0000-move-verbose-playback-timeshift-logging-to-debug-lev.patch kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/patches/bullseye-freeze/0000-move-verbose-playback-timeshift-logging-to-debug-lev.patch
--- kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/patches/bullseye-freeze/0000-move-verbose-playback-timeshift-logging-to-debug-lev.patch	1970-01-01 00:00:00.000000000 +0000
+++ kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/patches/bullseye-freeze/0000-move-verbose-playback-timeshift-logging-to-debug-lev.patch	2021-06-07 06:45:39.000000000 +0000
@@ -0,0 +1,66 @@
+From 972b9033434a71b218d6a51cd7375a8e20c04d79 Mon Sep 17 00:00:00 2001
+From: phunkyfish <phunkyfish@gmail.com>
+Date: Thu, 18 Mar 2021 08:56:39 +0000
+Subject: [PATCH 01/19] move verbose playback timeshift logging to debug level
+
+---
+ src/stream/TimeshiftBuffer.cpp  | 8 ++++----
+ src/stream/TimeshiftSegment.cpp | 2 +-
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/stream/TimeshiftBuffer.cpp b/src/stream/TimeshiftBuffer.cpp
+index 3128ef8..1167924 100644
+--- a/src/stream/TimeshiftBuffer.cpp
++++ b/src/stream/TimeshiftBuffer.cpp
+@@ -128,7 +128,7 @@ void TimeshiftBuffer::AddPacket(DEMUX_PACKET* packet)
+       std::shared_ptr<TimeshiftSegment> m_previousWriteSegment = m_writeSegment;
+       m_previousWriteSegment->MarkAsComplete();
+ 
+-      Log(LOGLEVEL_INFO, "%s - Writing new segment - seconds: %d, last seg seconds: %d, last seg packet count: %d, new seg index: %d, pts %.2f, dts: %.2f, pts sec: %.0f, dts sec: %.0f",
++      Log(LOGLEVEL_DEBUG, "%s - Writing new segment - seconds: %d, last seg seconds: %d, last seg packet count: %d, new seg index: %d, pts %.2f, dts: %.2f, pts sec: %.0f, dts sec: %.0f",
+                          __FUNCTION__, secondsSinceStart, m_lastSegmentSecondsSinceStart, m_previousWriteSegment->GetPacketCount(), m_currentSegmentIndex,
+                          packet->pts, packet->dts, packet->pts / STREAM_TIME_BASE, packet->dts / STREAM_TIME_BASE);
+ 
+@@ -176,7 +176,7 @@ void TimeshiftBuffer::RemoveOldestInMemoryAndOnDiskSegments()
+       if (kodi::vfs::FileExists(m_timeshiftBufferPath + "/" + segmentFilename))
+       {
+         kodi::vfs::DeleteFile(m_timeshiftBufferPath + "/" + segmentFilename);
+-        Log(LOGLEVEL_INFO, "%s - Removed oldest on disk segment with ID: %d - currentDemuxTimeSeconds: %d, min on disk time: %d", __FUNCTION__, m_earliestOnDiskSegmentId, m_currentDemuxTimeIndex, m_minOnDiskSeekTimeIndex);
++        Log(LOGLEVEL_DEBUG, "%s - Removed oldest on disk segment with ID: %d - currentDemuxTimeSeconds: %d, min on disk time: %d", __FUNCTION__, m_earliestOnDiskSegmentId, m_currentDemuxTimeIndex, m_minOnDiskSeekTimeIndex);
+         m_earliestOnDiskSegmentId++;
+         m_segmentTotalCount--;
+ 
+@@ -214,7 +214,7 @@ DEMUX_PACKET* TimeshiftBuffer::ReadPacket()
+ 
+       m_previousReadSegment->ClearPackets();
+       if (m_readSegment)
+-        Log(LOGLEVEL_INFO, "%s - Reading next segment with id: %d, packet count: %d", __FUNCTION__, m_readSegment->GetSegmentId(), m_readSegment->GetPacketCount());
++        Log(LOGLEVEL_DEBUG, "%s - Reading next segment with id: %d, packet count: %d", __FUNCTION__, m_readSegment->GetSegmentId(), m_readSegment->GetPacketCount());
+     }
+ 
+     if (packet && packet->pts != STREAM_NOPTS_VALUE && packet->pts > 0)
+@@ -248,7 +248,7 @@ bool TimeshiftBuffer::Seek(double timeMs)
+     else // Jump to live segment
+       m_readSegment = m_segmentTimeIndexMap.rbegin()->second;
+ 
+-    Log(LOGLEVEL_INFO, "%s - Buffer - SegmentID: %d, SeekSeconds: %d", __FUNCTION__, m_readSegment->GetSegmentId(), seekSeconds);
++    Log(LOGLEVEL_DEBUG, "%s - Buffer - SegmentID: %d, SeekSeconds: %d", __FUNCTION__, m_readSegment->GetSegmentId(), seekSeconds);
+ 
+     m_readSegment->LoadSegment();
+     if (m_readSegment->Seek(timeMs))
+diff --git a/src/stream/TimeshiftSegment.cpp b/src/stream/TimeshiftSegment.cpp
+index a06e02c..9629127 100644
+--- a/src/stream/TimeshiftSegment.cpp
++++ b/src/stream/TimeshiftSegment.cpp
+@@ -447,7 +447,7 @@ bool TimeshiftSegment::Seek(double timeMs)
+     int timeIndexStart = it->first;
+     auto it2 = m_packetTimeIndexMap.rbegin();
+     int timeIndexEnd = it2->first;
+-    Log(LOGLEVEL_INFO, "%s - Seek segment packet - segment ID: %d, packet index: %d, seek seconds: %d, segment start seconds: %d, segment end seconds: %d", __FUNCTION__, m_segmentId, m_readPacketIndex, seekSeconds, timeIndexStart, timeIndexEnd);
++    Log(LOGLEVEL_DEBUG, "%s - Seek segment packet - segment ID: %d, packet index: %d, seek seconds: %d, segment start seconds: %d, segment end seconds: %d", __FUNCTION__, m_segmentId, m_readPacketIndex, seekSeconds, timeIndexStart, timeIndexEnd);
+ 
+     return true;
+   }
+-- 
+2.32.0.rc0
+
diff -Nru kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/patches/bullseye-freeze/0001-Update-cmakelists-to-reference-FFMPEGDIRECT-at-build.patch kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/patches/bullseye-freeze/0001-Update-cmakelists-to-reference-FFMPEGDIRECT-at-build.patch
--- kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/patches/bullseye-freeze/0001-Update-cmakelists-to-reference-FFMPEGDIRECT-at-build.patch	1970-01-01 00:00:00.000000000 +0000
+++ kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/patches/bullseye-freeze/0001-Update-cmakelists-to-reference-FFMPEGDIRECT-at-build.patch	2021-06-07 06:45:39.000000000 +0000
@@ -0,0 +1,111 @@
+From 6cdfe0abca1712dafa894b6a5c43c0bdf26ab623 Mon Sep 17 00:00:00 2001
+From: phunkyfish <phunkyfish@gmail.com>
+Date: Thu, 18 Mar 2021 08:59:42 +0000
+Subject: [PATCH 02/19] Update cmakelists to reference FFMPEGDIRECT at build
+ time
+
+---
+ CMakeLists.txt | 78 +++++++++++++++++++++++++-------------------------
+ 1 file changed, 39 insertions(+), 39 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 78408ad..19508c8 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -14,43 +14,43 @@ find_package(FFMPEG REQUIRED)
+ find_package(ZLIB REQUIRED)
+ find_package(BZip2 REQUIRED)
+ 
+-set(CATCHUP_SOURCES src/StreamManager.cpp
+-                    src/stream/DemuxStream.cpp
+-                    src/stream/FFmpegCatchupStream.cpp
+-                    src/stream/FFmpegLog.cpp
+-                    src/stream/FFmpegStream.cpp
+-                    src/stream/CurlCatchupInput.cpp
+-                    src/stream/CurlInput.cpp
+-                    src/stream/TimeshiftBuffer.cpp
+-                    src/stream/TimeshiftSegment.cpp
+-                    src/stream/TimeshiftStream.cpp
+-                    src/stream/url/URL.cpp
+-                    src/stream/url/UrlOptions.cpp
+-                    src/stream/url/Variant.cpp
+-                    src/utils/DiskUtils.cpp
+-                    src/utils/FilenameUtils.cpp)
++set(FFMPEGDIRECT_SOURCES src/StreamManager.cpp
++                         src/stream/DemuxStream.cpp
++                         src/stream/FFmpegCatchupStream.cpp
++                         src/stream/FFmpegLog.cpp
++                         src/stream/FFmpegStream.cpp
++                         src/stream/CurlCatchupInput.cpp
++                         src/stream/CurlInput.cpp
++                         src/stream/TimeshiftBuffer.cpp
++                         src/stream/TimeshiftSegment.cpp
++                         src/stream/TimeshiftStream.cpp
++                         src/stream/url/URL.cpp
++                         src/stream/url/UrlOptions.cpp
++                         src/stream/url/Variant.cpp
++                         src/utils/DiskUtils.cpp
++                         src/utils/FilenameUtils.cpp)
+ 
+-set(CATCHUP_HEADERS src/StreamManager.h
+-                    src/stream/BaseStream.h
+-                    src/stream/DemuxStream.h
+-                    src/stream/FFmpegCatchupStream.h
+-                    src/stream/FFmpegLog.h
+-                    src/stream/FFmpegStream.h
+-                    src/stream/CurlCatchupInput.h
+-                    src/stream/CurlInput.h
+-                    src/stream/IManageDemuxPacket.h
+-                    src/stream/TimeshiftBuffer.h
+-                    src/stream/TimeshiftSegment.h
+-                    src/stream/TimeshiftStream.h
+-                    src/utils/HttpProxy.h
+-                    src/utils/DiskUtils.h
+-                    src/utils/FilenameUtils.h
+-                    src/utils/Log.h
+-                    src/utils/Properties.h
+-                    src/utils/TimeUtils.h
+-                    src/stream/url/URL.h
+-                    src/stream/url/UrlOptions.h
+-                    src/stream/url/Variant.h)
++set(FFMPEGDIRECT_HEADERS src/StreamManager.h
++                         src/stream/BaseStream.h
++                         src/stream/DemuxStream.h
++                         src/stream/FFmpegCatchupStream.h
++                         src/stream/FFmpegLog.h
++                         src/stream/FFmpegStream.h
++                         src/stream/CurlCatchupInput.h
++                         src/stream/CurlInput.h
++                         src/stream/IManageDemuxPacket.h
++                         src/stream/TimeshiftBuffer.h
++                         src/stream/TimeshiftSegment.h
++                         src/stream/TimeshiftStream.h
++                         src/utils/HttpProxy.h
++                         src/utils/DiskUtils.h
++                         src/utils/FilenameUtils.h
++                         src/utils/Log.h
++                         src/utils/Properties.h
++                         src/utils/TimeUtils.h
++                         src/stream/url/URL.h
++                         src/stream/url/UrlOptions.h
++                         src/stream/url/Variant.h)
+ 
+ include_directories(${INCLUDES}
+                     ${FFMPEG_INCLUDE_DIRS}
+@@ -101,10 +101,10 @@ else()
+   list(APPEND DEPLIBS ${FFMPEG_LIBRARIES})
+ endif()
+ 
+-addon_version(inputstream.ffmpegdirect CATCHUP)
+-add_definitions(-DCATCHUP_VERSION=${CATCHUP_VERSION})
++addon_version(inputstream.ffmpegdirect FFMPEGDIRECT)
++add_definitions(-DFFMPEGDIRECT_VERSION=${FFMPEGDIRECT_VERSION})
+ 
+-build_addon(inputstream.ffmpegdirect CATCHUP DEPLIBS)
++build_addon(inputstream.ffmpegdirect FFMPEGDIRECT DEPLIBS)
+ 
+ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+   # Due to a bug in CMake and frameworks on OSX we strip them from FFMPEG_LDFLAGS
+-- 
+2.32.0.rc0
+
diff -Nru kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/patches/bullseye-freeze/0002-Fix-locking-on-EOF-detection-of-terminating-catchup-.patch kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/patches/bullseye-freeze/0002-Fix-locking-on-EOF-detection-of-terminating-catchup-.patch
--- kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/patches/bullseye-freeze/0002-Fix-locking-on-EOF-detection-of-terminating-catchup-.patch	1970-01-01 00:00:00.000000000 +0000
+++ kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/patches/bullseye-freeze/0002-Fix-locking-on-EOF-detection-of-terminating-catchup-.patch	2021-06-07 06:45:39.000000000 +0000
@@ -0,0 +1,81 @@
+From 443285753c62b48ee1fca4471bb0c1b05cc9e377 Mon Sep 17 00:00:00 2001
+From: phunkyfish <phunkyfish@gmail.com>
+Date: Tue, 23 Mar 2021 10:05:42 +0000
+Subject: [PATCH 04/19] Fix locking on EOF detection of terminating catchup
+ stream by using std:recursive_mutex
+
+---
+ src/stream/FFmpegCatchupStream.cpp | 6 +++---
+ src/stream/FFmpegStream.cpp        | 4 ++--
+ src/stream/FFmpegStream.h          | 2 +-
+ 3 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/src/stream/FFmpegCatchupStream.cpp b/src/stream/FFmpegCatchupStream.cpp
+index 6205ff0..2065bc2 100644
+--- a/src/stream/FFmpegCatchupStream.cpp
++++ b/src/stream/FFmpegCatchupStream.cpp
+@@ -89,7 +89,7 @@ bool FFmpegCatchupStream::DemuxSeekTime(double timeMs, bool backwards, double& s
+   if (seekResult >= 0)
+   {
+     {
+-      std::lock_guard<std::mutex> lock(m_mutex);
++      std::lock_guard<std::recursive_mutex> lock(m_mutex);
+       m_seekOffset = seekResult;
+     }
+ 
+@@ -115,7 +115,7 @@ DEMUX_PACKET* FFmpegCatchupStream::DemuxRead()
+   DEMUX_PACKET* pPacket = FFmpegStream::DemuxRead();
+   if (pPacket)
+   {
+-    std::lock_guard<std::mutex> lock(m_mutex);
++    std::lock_guard<std::recursive_mutex> lock(m_mutex);
+     pPacket->pts += m_seekOffset;
+     pPacket->dts += m_seekOffset;
+ 
+@@ -174,7 +174,7 @@ void FFmpegCatchupStream::DemuxSetSpeed(int speed)
+   else if (!IsPaused() && speed == STREAM_PLAYSPEED_PAUSE)
+   {
+     // Pause Playback
+-    std::lock_guard<std::mutex> lock(m_mutex);
++    std::lock_guard<std::recursive_mutex> lock(m_mutex);
+     m_pauseStartTime = m_currentDemuxTime;
+     Log(LOGLEVEL_DEBUG, "%s - DemuxSetSpeed - Pause time: %lld", __FUNCTION__, static_cast<long long>(m_pauseStartTime));
+   }
+diff --git a/src/stream/FFmpegStream.cpp b/src/stream/FFmpegStream.cpp
+index 861b1f0..67b8d82 100644
+--- a/src/stream/FFmpegStream.cpp
++++ b/src/stream/FFmpegStream.cpp
+@@ -292,7 +292,7 @@ DEMUX_PACKET* FFmpegStream::DemuxRead()
+   // on some cases where the received packet is invalid we will need to return an empty packet (0 length) otherwise the main loop (in CVideoPlayer)
+   // would consider this the end of stream and stop.
+   bool bReturnEmpty = false;
+-  { std::lock_guard<std::mutex> lock(m_mutex); // open lock scope
++  { std::lock_guard<std::recursive_mutex> lock(m_mutex); // open lock scope
+   if (m_pFormatContext)
+   {
+     // assume we are not eof
+@@ -1471,7 +1471,7 @@ bool FFmpegStream::SeekTime(double time, bool backwards, double* startpts)
+ 
+   int ret;
+   {
+-    std::lock_guard<std::mutex> lock(m_mutex);
++    std::lock_guard<std::recursive_mutex> lock(m_mutex);
+     ret = av_seek_frame(m_pFormatContext, m_seekStream, seek_pts, backwards ? AVSEEK_FLAG_BACKWARD : 0);
+ 
+     if (ret < 0)
+diff --git a/src/stream/FFmpegStream.h b/src/stream/FFmpegStream.h
+index ac73c51..406058b 100644
+--- a/src/stream/FFmpegStream.h
++++ b/src/stream/FFmpegStream.h
+@@ -109,7 +109,7 @@ protected:
+   virtual bool CheckReturnEmptyOnPacketResult(int result);
+ 
+   int64_t m_demuxerId;
+-  mutable std::mutex m_mutex;
++  mutable std::recursive_mutex m_mutex;
+   double m_currentPts; // used for stream length estimation
+   bool m_demuxResetOpenSuccess = false;
+   std::string m_streamUrl;
+-- 
+2.32.0.rc0
+
diff -Nru kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/patches/bullseye-freeze/0003-If-open_mode-is-default-make-sure-the-right-protocol.patch kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/patches/bullseye-freeze/0003-If-open_mode-is-default-make-sure-the-right-protocol.patch
--- kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/patches/bullseye-freeze/0003-If-open_mode-is-default-make-sure-the-right-protocol.patch	1970-01-01 00:00:00.000000000 +0000
+++ kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/patches/bullseye-freeze/0003-If-open_mode-is-default-make-sure-the-right-protocol.patch	2021-06-07 06:45:39.000000000 +0000
@@ -0,0 +1,41 @@
+From fc723f6b7e09f114bb2b9381db25cec997ef6870 Mon Sep 17 00:00:00 2001
+From: phunkyfish <phunkyfish@gmail.com>
+Date: Fri, 2 Apr 2021 22:12:18 +0100
+Subject: [PATCH 06/19] If open_mode is default make sure the right protocols
+ default to open with ffmpeg
+
+---
+ src/StreamManager.cpp | 17 ++++++++++++++++-
+ 1 file changed, 16 insertions(+), 1 deletion(-)
+
+diff --git a/src/StreamManager.cpp b/src/StreamManager.cpp
+index c8adb58..935627b 100644
+--- a/src/StreamManager.cpp
++++ b/src/StreamManager.cpp
+@@ -170,7 +170,22 @@ bool InputStreamFFmpegDirect::Open(const kodi::addon::InputstreamProperty& props
+         m_mimeType == "application/xml+dash" ||
+         manifestType == "hls" || // HLS
+         manifestType == "mpd" || // DASH
+-        manifestType == "ism") //Smooth Streaming
++        manifestType == "ism" || //Smooth Streaming
++        StringUtils::StartsWithNoCase(m_streamUrl, "rtp://") ||
++        StringUtils::StartsWithNoCase(m_streamUrl, "rtsp://") ||
++        StringUtils::StartsWithNoCase(m_streamUrl, "rtsps://") ||
++        StringUtils::StartsWithNoCase(m_streamUrl, "satip://") ||
++        StringUtils::StartsWithNoCase(m_streamUrl, "sdp://") ||
++        StringUtils::StartsWithNoCase(m_streamUrl, "udp://") ||
++        StringUtils::StartsWithNoCase(m_streamUrl, "tcp://") ||
++        StringUtils::StartsWithNoCase(m_streamUrl, "mms://") ||
++        StringUtils::StartsWithNoCase(m_streamUrl, "mmst://") ||
++        StringUtils::StartsWithNoCase(m_streamUrl, "mmsh://") ||
++        StringUtils::StartsWithNoCase(m_streamUrl, "rtmp://") ||
++        StringUtils::StartsWithNoCase(m_streamUrl, "rtmpt://") ||
++        StringUtils::StartsWithNoCase(m_streamUrl, "rtmpe://") ||
++        StringUtils::StartsWithNoCase(m_streamUrl, "rtmpte://") ||
++        StringUtils::StartsWithNoCase(m_streamUrl, "rtmps://"))
+       properties.m_openMode = OpenMode::FFMPEG;
+     else
+       properties.m_openMode = OpenMode::CURL;
+-- 
+2.32.0.rc0
+
diff -Nru kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/patches/bullseye-freeze/0004-Allow-timezone-shift-when-live-URLs-have-placeholder.patch kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/patches/bullseye-freeze/0004-Allow-timezone-shift-when-live-URLs-have-placeholder.patch
--- kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/patches/bullseye-freeze/0004-Allow-timezone-shift-when-live-URLs-have-placeholder.patch	1970-01-01 00:00:00.000000000 +0000
+++ kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/patches/bullseye-freeze/0004-Allow-timezone-shift-when-live-URLs-have-placeholder.patch	2021-06-07 06:45:39.000000000 +0000
@@ -0,0 +1,36 @@
+From e08fd384bbec0745f8111204c3069f0583bdf16d Mon Sep 17 00:00:00 2001
+From: phunkyfish <phunkyfish@gmail.com>
+Date: Thu, 15 Apr 2021 18:58:35 +0100
+Subject: [PATCH 14/19] Allow timezone shift when live URLs have placeholders
+
+---
+ src/stream/FFmpegCatchupStream.cpp | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/stream/FFmpegCatchupStream.cpp b/src/stream/FFmpegCatchupStream.cpp
+index 2065bc2..0bb4c10 100644
+--- a/src/stream/FFmpegCatchupStream.cpp
++++ b/src/stream/FFmpegCatchupStream.cpp
+@@ -503,10 +503,10 @@ std::string FormatDateTime(time_t timeStart, time_t duration, const std::string
+   return formattedUrl;
+ }
+ 
+-std::string FormatDateTimeNowOnly(const std::string &urlFormatString)
++std::string FormatDateTimeNowOnly(const std::string &urlFormatString, int timezoneShiftSecs)
+ {
+   std::string formattedUrl = urlFormatString;
+-  const time_t timeNow = std::time(0);
++  const time_t timeNow = std::time(0) - timezoneShiftSecs;
+   std::tm dateTimeNow = SafeLocaltime(timeNow);
+ 
+   FormatUtc("{lutc}", timeNow, formattedUrl);
+@@ -562,5 +562,5 @@ std::string FFmpegCatchupStream::GetUpdatedCatchupUrl() const
+   }
+ 
+   Log(LOGLEVEL_DEBUG, "%s - Default URL: %s", __FUNCTION__, CURL::GetRedacted(m_defaultUrl).c_str());
+-  return FormatDateTimeNowOnly(m_defaultUrl);
++  return FormatDateTimeNowOnly(m_defaultUrl, m_timezoneShift);
+ }
+-- 
+2.32.0.rc0
+
diff -Nru kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/patches/bullseye-freeze/0005-fix-hls-bitrate-selection.patch kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/patches/bullseye-freeze/0005-fix-hls-bitrate-selection.patch
--- kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/patches/bullseye-freeze/0005-fix-hls-bitrate-selection.patch	1970-01-01 00:00:00.000000000 +0000
+++ kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/patches/bullseye-freeze/0005-fix-hls-bitrate-selection.patch	2021-06-07 06:45:39.000000000 +0000
@@ -0,0 +1,34 @@
+From 9780c141162ef7f5a50445a794beb1df44ade3d4 Mon Sep 17 00:00:00 2001
+From: phunkyfish <phunkyfish@gmail.com>
+Date: Sat, 8 May 2021 22:17:29 +0100
+Subject: [PATCH 16/19] fix hls bitrate selection
+
+---
+ src/stream/FFmpegStream.cpp | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/src/stream/FFmpegStream.cpp b/src/stream/FFmpegStream.cpp
+index 2972a8a..39ae50a 100644
+--- a/src/stream/FFmpegStream.cpp
++++ b/src/stream/FFmpegStream.cpp
+@@ -792,9 +792,14 @@ bool FFmpegStream::Open(bool fileinfo)
+ 
+   // select the correct program if requested
+   m_initialProgramNumber = UINT_MAX;
+-  CVariant programProp(m_programProperty);
+-  if (!programProp.isNull())
+-    m_initialProgramNumber = static_cast<int>(programProp.asInteger());
++  CVariant programProp;
++  if (!m_programProperty.empty())
++  {
++    CVariant programProp(m_programProperty);
++
++    if (!programProp.isNull() && programProp.isInteger())
++      m_initialProgramNumber = static_cast<int>(programProp.asInteger());
++  }
+ 
+   // in case of mpegts and we have not seen pat/pmt, defer creation of streams
+   if (!skipCreateStreams || m_pFormatContext->nb_programs > 0)
+-- 
+2.32.0.rc0
+
diff -Nru kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/patches/bullseye-freeze/0006-refactoring.patch kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/patches/bullseye-freeze/0006-refactoring.patch
--- kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/patches/bullseye-freeze/0006-refactoring.patch	1970-01-01 00:00:00.000000000 +0000
+++ kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/patches/bullseye-freeze/0006-refactoring.patch	2021-06-07 06:45:39.000000000 +0000
@@ -0,0 +1,183 @@
+From 40defba2bed7045790312af3f82f8add5a84bea8 Mon Sep 17 00:00:00 2001
+From: phunkyfish <phunkyfish@gmail.com>
+Date: Sat, 8 May 2021 22:24:15 +0100
+Subject: [PATCH 17/19] refactoring
+
+---
+ src/StreamManager.cpp | 62 +++++++++++++++++++++----------------------
+ src/StreamManager.h   |  2 +-
+ 2 files changed, 32 insertions(+), 32 deletions(-)
+
+diff --git a/src/StreamManager.cpp b/src/StreamManager.cpp
+index 935627b..c415bb4 100644
+--- a/src/StreamManager.cpp
++++ b/src/StreamManager.cpp
+@@ -75,85 +75,85 @@ bool InputStreamFFmpegDirect::Open(const kodi::addon::InputstreamProperty& props
+ 
+     if (PROGRAM_NUMBER == prop.first)
+     {
+-      properties.m_programProperty = prop.second;
++      m_properties.m_programProperty = prop.second;
+     }
+     else if (IS_REALTIME_STREAM == prop.first)
+     {
+-      properties.m_isRealTimeStream = StringUtils::EqualsNoCase(prop.second, "true");
++      m_properties.m_isRealTimeStream = StringUtils::EqualsNoCase(prop.second, "true");
+     }
+     else if (STREAM_MODE == prop.first)
+     {
+       if (StringUtils::EqualsNoCase(prop.second, "catchup"))
+-        properties.m_streamMode = StreamMode::CATCHUP;
++        m_properties.m_streamMode = StreamMode::CATCHUP;
+       else if (StringUtils::EqualsNoCase(prop.second, "timeshift"))
+-        properties.m_streamMode = StreamMode::TIMESHIFT;
++        m_properties.m_streamMode = StreamMode::TIMESHIFT;
+     }
+     else if (OPEN_MODE == prop.first)
+     {
+       if (StringUtils::EqualsNoCase(prop.second, "ffmpeg"))
+-        properties.m_openMode = OpenMode::FFMPEG;
++        m_properties.m_openMode = OpenMode::FFMPEG;
+       else if (StringUtils::EqualsNoCase(prop.second, "curl"))
+-        properties.m_openMode = OpenMode::CURL;
++        m_properties.m_openMode = OpenMode::CURL;
+     }
+     else if (MANIFEST_TYPE == prop.first)
+     {
+-      properties.m_manifestType = prop.second;
++      m_properties.m_manifestType = prop.second;
+     }
+     else if (DEFAULT_URL == prop.first)
+     {
+-      properties.m_defaultUrl = prop.second;
++      m_properties.m_defaultUrl = prop.second;
+     }
+     else if (PLAYBACK_AS_LIVE == prop.first)
+     {
+-      properties.m_playbackAsLive = StringUtils::EqualsNoCase(prop.second, "true");
++      m_properties.m_playbackAsLive = StringUtils::EqualsNoCase(prop.second, "true");
+     }
+     else if (PROGRAMME_START_TIME == prop.first)
+     {
+-      properties.m_programmeStartTime = static_cast<time_t>(std::stoll(prop.second));
++      m_properties.m_programmeStartTime = static_cast<time_t>(std::stoll(prop.second));
+     }
+     else if (PROGRAMME_END_TIME == prop.first)
+     {
+-      properties.m_programmeEndTime = static_cast<time_t>(std::stoll(prop.second));
++      m_properties.m_programmeEndTime = static_cast<time_t>(std::stoll(prop.second));
+     }
+     else if (CATCHUP_URL_FORMAT_STRING == prop.first)
+     {
+-      properties.m_catchupUrlFormatString = prop.second;
++      m_properties.m_catchupUrlFormatString = prop.second;
+     }
+     else if (CATCHUP_URL_NEAR_LIVE_FORMAT_STRING == prop.first)
+     {
+-      properties.m_catchupUrlNearLiveFormatString = prop.second;
++      m_properties.m_catchupUrlNearLiveFormatString = prop.second;
+     }
+     else if (CATCHUP_BUFFER_START_TIME == prop.first)
+     {
+-      properties.m_catchupBufferStartTime = static_cast<time_t>(std::stoll(prop.second));
++      m_properties.m_catchupBufferStartTime = static_cast<time_t>(std::stoll(prop.second));
+     }
+     else if (CATCHUP_BUFFER_END_TIME == prop.first)
+     {
+-      properties.m_catchupBufferEndTime = static_cast<time_t>(std::stoll(prop.second));
++      m_properties.m_catchupBufferEndTime = static_cast<time_t>(std::stoll(prop.second));
+     }
+     else if (CATCHUP_BUFFER_OFFSET == prop.first)
+     {
+-      properties.m_catchupBufferOffset = std::stoll(prop.second);
++      m_properties.m_catchupBufferOffset = std::stoll(prop.second);
+     }
+     else if (CATCHUP_TERMINATES == prop.first)
+     {
+-      properties.m_catchupTerminates = StringUtils::EqualsNoCase(prop.second, "true");
++      m_properties.m_catchupTerminates = StringUtils::EqualsNoCase(prop.second, "true");
+     }
+     else if (CATCHUP_GRANULARITY == prop.first)
+     {
+-      properties.m_catchupGranularity = std::stoi(prop.second);
++      m_properties.m_catchupGranularity = std::stoi(prop.second);
+     }
+     else if (TIMEZONE_SHIFT == prop.first)
+     {
+-      properties.m_timezoneShiftSecs = std::stoi(prop.second);
++      m_properties.m_timezoneShiftSecs = std::stoi(prop.second);
+     }
+     else if (DEFAULT_PROGRAMME_DURATION == prop.first)
+     {
+-      properties.m_defaultProgrammeDurationSecs = std::stoi(prop.second);
++      m_properties.m_defaultProgrammeDurationSecs = std::stoi(prop.second);
+     }
+     else if (PROGRAMME_CATCHUP_ID == prop.first)
+     {
+-      properties.m_programmeCatchupId = prop.second;
++      m_properties.m_programmeCatchupId = prop.second;
+     }
+   }
+ 
+@@ -162,8 +162,8 @@ bool InputStreamFFmpegDirect::Open(const kodi::addon::InputstreamProperty& props
+ 
+   Log(LOGLEVEL_INFO, "Stream mimetype: %s", m_mimeType.c_str());
+ 
+-  const std::string& manifestType = properties.m_manifestType;
+-  if (properties.m_openMode == OpenMode::DEFAULT)
++  const std::string& manifestType = m_properties.m_manifestType;
++  if (m_properties.m_openMode == OpenMode::DEFAULT)
+   {
+     if (m_mimeType == "application/x-mpegURL" || // HLS
+         m_mimeType == "application/vnd.apple.mpegurl" || //HLS
+@@ -186,9 +186,9 @@ bool InputStreamFFmpegDirect::Open(const kodi::addon::InputstreamProperty& props
+         StringUtils::StartsWithNoCase(m_streamUrl, "rtmpe://") ||
+         StringUtils::StartsWithNoCase(m_streamUrl, "rtmpte://") ||
+         StringUtils::StartsWithNoCase(m_streamUrl, "rtmps://"))
+-      properties.m_openMode = OpenMode::FFMPEG;
++      m_properties.m_openMode = OpenMode::FFMPEG;
+     else
+-      properties.m_openMode = OpenMode::CURL;
++      m_properties.m_openMode = OpenMode::CURL;
+   }
+ 
+   HttpProxy httpProxy;
+@@ -208,16 +208,16 @@ bool InputStreamFFmpegDirect::Open(const kodi::addon::InputstreamProperty& props
+     httpProxy.SetProxyPassword(kodi::GetSettingString("httpProxyPassword"));
+   }
+ 
+-  if (properties.m_streamMode == StreamMode::CATCHUP)
+-    m_stream = std::make_shared<FFmpegCatchupStream>(static_cast<IManageDemuxPacket*>(this), properties, httpProxy);
+-  else if (properties.m_streamMode == StreamMode::TIMESHIFT)
+-    m_stream = std::make_shared<TimeshiftStream>(static_cast<IManageDemuxPacket*>(this), properties, httpProxy);
++  if (m_properties.m_streamMode == StreamMode::CATCHUP)
++    m_stream = std::make_shared<FFmpegCatchupStream>(static_cast<IManageDemuxPacket*>(this), m_properties, httpProxy);
++  else if (m_properties.m_streamMode == StreamMode::TIMESHIFT)
++    m_stream = std::make_shared<TimeshiftStream>(static_cast<IManageDemuxPacket*>(this), m_properties, httpProxy);
+   else
+-    m_stream = std::make_shared<FFmpegStream>(static_cast<IManageDemuxPacket*>(this), properties, httpProxy);
++    m_stream = std::make_shared<FFmpegStream>(static_cast<IManageDemuxPacket*>(this), m_properties, httpProxy);
+ 
+   m_stream->SetVideoResolution(m_videoWidth, m_videoHeight);
+ 
+-  m_opened = m_stream->Open(m_streamUrl, m_mimeType, properties.m_isRealTimeStream, properties.m_programProperty);
++  m_opened = m_stream->Open(m_streamUrl, m_mimeType, m_properties.m_isRealTimeStream, m_properties.m_programProperty);
+ 
+   return m_opened;
+ }
+diff --git a/src/StreamManager.h b/src/StreamManager.h
+index e2be1c1..a67c8c4 100644
+--- a/src/StreamManager.h
++++ b/src/StreamManager.h
+@@ -89,7 +89,7 @@ private:
+   std::string m_streamUrl;
+   std::string m_mimeType;
+ 
+-  ffmpegdirect::Properties properties;
++  ffmpegdirect::Properties m_properties;
+ 
+   int m_videoWidth;
+   int m_videoHeight;
+-- 
+2.32.0.rc0
+
diff -Nru kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/patches/series kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/patches/series
--- kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/patches/series	1970-01-01 00:00:00.000000000 +0000
+++ kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/patches/series	2021-06-07 06:45:39.000000000 +0000
@@ -0,0 +1,7 @@
+bullseye-freeze/0000-move-verbose-playback-timeshift-logging-to-debug-lev.patch
+bullseye-freeze/0001-Update-cmakelists-to-reference-FFMPEGDIRECT-at-build.patch
+bullseye-freeze/0002-Fix-locking-on-EOF-detection-of-terminating-catchup-.patch
+bullseye-freeze/0003-If-open_mode-is-default-make-sure-the-right-protocol.patch
+bullseye-freeze/0004-Allow-timezone-shift-when-live-URLs-have-placeholder.patch
+bullseye-freeze/0005-fix-hls-bitrate-selection.patch
+bullseye-freeze/0006-refactoring.patch
diff -Nru kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/watch kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/watch
--- kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/watch	2021-02-18 23:38:47.000000000 +0000
+++ kodi-inputstream-ffmpegdirect-1.19.2+ds1/debian/watch	2021-06-07 06:45:39.000000000 +0000
@@ -5,4 +5,4 @@
       repacksuffix=+ds1, \
       dversionmangle=auto" \
 https://github.com/xbmc/inputstream.ffmpegdirect/releases \
-/xbmc/inputstream.ffmpegdirect/archive/?(\d\S*)-[A-Z].*\.tar\.gz
+/xbmc/inputstream.ffmpegdirect/archive/refs/tags/?(\d\S*)-[A-Z].*\.tar\.gz

Reply to: