[vlc-devel] [PATCH] mkv: revert 8317c24270d45b4938acaf58104e18f5039eade0

Steve Lhomme robux4 at videolabs.io
Mon Mar 7 13:53:27 CET 2016


This reverts commit 8317c24270d45b4938acaf58104e18f5039eade0.

it introduced issues with CPU intensive files dropping a lot of frames

--
#13575 needs to be reopened
#11847 is a broken file anyway so it may not be reopened
---
 modules/demux/mkv/mkv.cpp  | 12 ++++++++++++
 modules/demux/mkv/util.cpp | 29 -----------------------------
 2 files changed, 12 insertions(+), 29 deletions(-)

diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
index b8927a4..6ba3895 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -761,6 +761,18 @@ static int Demux( demux_t *p_demux)
             p_sys->i_pts = (mtime_t)block->GlobalTimecode() / INT64_C(1000);
         p_sys->i_pts += p_sys->i_mk_chapter_time + VLC_TS_0;
 
+        mtime_t i_pcr = VLC_TS_INVALID;
+        for( size_t i = 0; i < p_segment->tracks.size(); i++)
+            if( p_segment->tracks[i]->i_last_dts > VLC_TS_INVALID &&
+                ( p_segment->tracks[i]->i_last_dts < i_pcr || i_pcr == VLC_TS_INVALID ))
+                i_pcr = p_segment->tracks[i]->i_last_dts;
+
+        if( i_pcr > p_sys->i_pcr + 300000 )
+        {
+            es_out_Control( p_demux->out, ES_OUT_SET_PCR, VLC_TS_0 + p_sys->i_pcr );
+            p_sys->i_pcr = i_pcr;
+        }
+
         if( p_sys->i_pts >= p_sys->i_start_pts  )
         {
             if ( p_vsegment->UpdateCurrentToChapter( *p_demux ) )
diff --git a/modules/demux/mkv/util.cpp b/modules/demux/mkv/util.cpp
index acb2d29..a970b6a 100644
--- a/modules/demux/mkv/util.cpp
+++ b/modules/demux/mkv/util.cpp
@@ -270,35 +270,6 @@ void send_Block( demux_t * p_demux, mkv_track_t * p_tk, block_t * p_block, unsig
             (double) p_segment->i_timescale / ( 1000.0 * i_number_frames );
     }
 
-    // find the latest DTS for an active track
-    mtime_t i_ts_max = INT64_MIN;
-    for( size_t j = 0; j < p_segment->tracks.size(); j++ )
-    {
-        mkv_track_t *tk = p_segment->tracks[j];
-        if( tk->i_last_dts > VLC_TS_INVALID )
-            i_ts_max = __MAX( i_ts_max, tk->i_last_dts );
-    }
-
-    // find the earliest DTS less than 10 clock ticks away from the latest DTS
-    mtime_t i_ts_min = INT64_MAX;
-    for( size_t j = 0; j < p_segment->tracks.size(); j++ )
-    {
-        mkv_track_t *tk = p_segment->tracks[j];
-        if( tk->i_last_dts > VLC_TS_INVALID && tk->i_last_dts + 10 * CLOCK_FREQ >= i_ts_max )
-            i_ts_min = __MIN( i_ts_min, tk->i_last_dts );
-    }
-
-    // the PCR is the earliest active DTS if we found one
-    if( i_ts_min != INT64_MAX && ( i_ts_min > p_sys->i_pcr || p_sys->i_pcr == VLC_TS_INVALID ) )
-    {
-        p_sys->i_pcr = i_ts_min;
-        es_out_Control( p_demux->out, ES_OUT_SET_PCR, i_ts_min );
-    }
-
-#if 0
-msg_Dbg( p_demux, "block (track=%d) i_dts: %" PRId64" / i_pts: %" PRId64, p_tk->i_number, p_block->i_dts, p_block->i_pts);
-#endif
-
     es_out_Send( p_demux->out, p_tk->p_es, p_block);
 }
 
-- 
2.7.1



More information about the vlc-devel mailing list