aboutsummaryrefslogtreecommitdiffstats
path: root/main/omxplayer/issue-297.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/omxplayer/issue-297.patch')
-rw-r--r--main/omxplayer/issue-297.patch91
1 files changed, 76 insertions, 15 deletions
diff --git a/main/omxplayer/issue-297.patch b/main/omxplayer/issue-297.patch
index fbae77afd5..4a2cf1d50a 100644
--- a/main/omxplayer/issue-297.patch
+++ b/main/omxplayer/issue-297.patch
@@ -1,17 +1,78 @@
-https://github.com/popcornmix/omxplayer/issues/297
-
-Not a proper fix, but works as an ugly hack to workaround the issue.
-
---- omxplayer-a4ee0743ecf49ffa1818510e8cc7872282ca66a8/omxplayer.cpp.orig
-+++ omxplayer-a4ee0743ecf49ffa1818510e8cc7872282ca66a8/omxplayer.cpp
-@@ -1683,6 +1683,10 @@
+diff --git a/OMXReader.cpp b/OMXReader.cpp
+index df15a01..97ed20f 100644
+--- a/OMXReader.cpp
++++ b/OMXReader.cpp
+@@ -261,9 +261,6 @@ bool OMXReader::Open(std::string filename, bool dump_format, bool live /* =false
+ if(/*m_bAVI || */m_bMatroska)
+ m_pFormatContext->max_analyze_duration = 0;
- if(m_omx_reader.IsEof() && !m_omx_pkt)
- {
-+ // EOF before playback started, stop.
-+ if (m_av_clock->OMXIsPaused())
-+ break;
+- if (live)
+- m_pFormatContext->flags |= AVFMT_FLAG_NOBUFFER;
+-
+ result = m_dllAvFormat.avformat_find_stream_info(m_pFormatContext, NULL);
+ if(result < 0)
+ {
+diff --git a/OMXVideo.cpp b/OMXVideo.cpp
+index acd055e..b69f451 100644
+--- a/OMXVideo.cpp
++++ b/OMXVideo.cpp
+@@ -670,6 +670,8 @@ bool COMXVideo::Open(OMXClock *clock, const OMXVideoConfig &config)
+ float fAspect = m_config.hints.aspect ? (float)m_config.hints.aspect / (float)m_config.hints.width * (float)m_config.hints.height : 1.0f;
+ m_pixel_aspect = fAspect / m_config.display_aspect;
+
++ PortSettingsChanged();
+
- // demuxer EOF, but may have not played out data yet
- if ( (m_has_video && m_player_video.GetCached()) ||
- (m_has_audio && m_player_audio.GetCached()) )
+ return true;
+ }
+
+diff --git a/omxplayer.cpp b/omxplayer.cpp
+index c03760b..071fb60 100644
+--- a/omxplayer.cpp
++++ b/omxplayer.cpp
+@@ -1642,30 +1642,33 @@ int main(int argc, char *argv[])
+ latency = audio_fifo;
+ else if (!m_has_audio && m_has_video && video_pts != DVD_NOPTS_VALUE)
+ latency = video_fifo;
+- if (!m_Pause && latency != DVD_NOPTS_VALUE)
++ if (!m_Pause && (m_omx_reader.IsEof() || latency != DVD_NOPTS_VALUE))
+ {
+ if (m_av_clock->OMXIsPaused())
+ {
+- if (latency > m_threshold)
++ if (m_omx_reader.IsEof() || latency > m_threshold)
+ {
+ CLog::Log(LOGDEBUG, "Resume %.2f,%.2f (%d,%d,%d,%d) EOF:%d PKT:%p\n", audio_fifo, video_fifo, audio_fifo_low, video_fifo_low, audio_fifo_high, video_fifo_high, m_omx_reader.IsEof(), m_omx_pkt);
+ m_av_clock->OMXResume();
+- m_latency = latency;
++ if (latency > 0)
++ m_latency = latency;
+ }
+ }
+ else
+ {
+- m_latency = m_latency*0.99f + latency*0.01f;
+ float speed = 1.0f;
+- if (m_latency < 0.5f*m_threshold)
+- speed = 0.990f;
+- else if (m_latency < 0.9f*m_threshold)
+- speed = 0.999f;
+- else if (m_latency > 2.0f*m_threshold)
+- speed = 1.010f;
+- else if (m_latency > 1.1f*m_threshold)
+- speed = 1.001f;
+-
++ if (latency != DVD_NOPTS_VALUE)
++ {
++ m_latency = m_latency*0.99f + latency*0.01f;
++ if (m_latency < 0.5f*m_threshold)
++ speed = 0.990f;
++ else if (m_latency < 0.9f*m_threshold)
++ speed = 0.999f;
++ else if (m_latency > 2.0f*m_threshold)
++ speed = 1.010f;
++ else if (m_latency > 1.1f*m_threshold)
++ speed = 1.001f;
++ }
+ m_av_clock->OMXSetSpeed(S(speed));
+ m_av_clock->OMXSetSpeed(S(speed), true, true);
+ CLog::Log(LOGDEBUG, "Live: %.2f (%.2f) S:%.3f T:%.2f\n", m_latency, latency, speed, m_threshold);