aboutsummaryrefslogtreecommitdiffstats
path: root/community/omxplayer/issue-297.patch
blob: 4a2cf1d50a14a909126b1e22d3c47b8257e59eaf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
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 (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();
+
   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);