[vlc-commits] demux: mkv: fix single track opus playback

Francois Cartegnie git at videolan.org
Fri Mar 14 23:04:49 CET 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Mar 14 22:56:38 2014 +0100| [d6daa5e5f3926af978f5b0917c0255e273e85463] | committer: Francois Cartegnie

demux: mkv: fix single track opus playback

Only first frame in a block has timestamp, then (0) last_dts is never valid,
(1) PCR never sent, (2) track never selected by core, goto 1;

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d6daa5e5f3926af978f5b0917c0255e273e85463
---

 modules/demux/mkv/mkv.cpp |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
index ec4ebfa..8dfe5f1 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -656,8 +656,11 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
                     p_block->i_dts = min( i_pts, tk->i_last_dts + ( mtime_t )( tk->i_default_duration / 1000 ) );
             }
         }
-        if( tk->fmt.i_cat == VIDEO_ES || tk->fmt.i_cat == AUDIO_ES )
+        if( p_block->i_dts > VLC_TS_INVALID &&
+            ( tk->fmt.i_cat == VIDEO_ES || tk->fmt.i_cat == AUDIO_ES ) )
+        {
             tk->i_last_dts = p_block->i_dts;
+        }
 
 #if 0
 msg_Dbg( p_demux, "block i_dts: %"PRId64" / i_pts: %"PRId64, p_block->i_dts, p_block->i_pts);



More information about the vlc-commits mailing list