Commit 7cdc4e6d authored by Laurent Aimar's avatar Laurent Aimar

Matroska seems to stupidly store dts instead of pts for real video codec.

parent 092e8726
...@@ -664,6 +664,7 @@ bool matroska_segment_c::Select( mtime_t i_start_time ) ...@@ -664,6 +664,7 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
memcpy( tracks[i_track]->fmt.p_extra, &p_bih[1], tracks[i_track]->fmt.i_extra ); memcpy( tracks[i_track]->fmt.p_extra, &p_bih[1], tracks[i_track]->fmt.i_extra );
} }
} }
p_tk->b_dts_only = true;
} }
else if( !strcmp( tracks[i_track]->psz_codec, "V_MPEG1" ) || else if( !strcmp( tracks[i_track]->psz_codec, "V_MPEG1" ) ||
!strcmp( tracks[i_track]->psz_codec, "V_MPEG2" ) ) !strcmp( tracks[i_track]->psz_codec, "V_MPEG2" ) )
...@@ -760,6 +761,7 @@ bool matroska_segment_c::Select( mtime_t i_start_time ) ...@@ -760,6 +761,7 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
memcpy( p_fmt->p_extra, &p_tk->p_extra_data[26], p_fmt->i_extra ); memcpy( p_fmt->p_extra, &p_tk->p_extra_data[26], p_fmt->i_extra );
} }
} }
p_tk->b_dts_only = true;
} }
else if( !strncmp( tracks[i_track]->psz_codec, "V_DIRAC", 7 ) ) else if( !strncmp( tracks[i_track]->psz_codec, "V_DIRAC", 7 ) )
{ {
......
...@@ -184,6 +184,7 @@ void matroska_segment_c::ParseTrackEntry( KaxTrackEntry *m ) ...@@ -184,6 +184,7 @@ void matroska_segment_c::ParseTrackEntry( KaxTrackEntry *m )
tk->i_extra_data = 0; tk->i_extra_data = 0;
tk->p_extra_data = NULL; tk->p_extra_data = NULL;
tk->psz_codec = NULL; tk->psz_codec = NULL;
tk->b_dts_only = false;
tk->i_default_duration = 0; tk->i_default_duration = 0;
tk->f_timecodescale = 1.0; tk->f_timecodescale = 1.0;
......
...@@ -578,9 +578,8 @@ static void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simp ...@@ -578,9 +578,8 @@ static void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simp
} }
else else
{ {
if( !strcmp( tk->psz_codec, "V_MS/VFW/FOURCC" ) ) if( tk->b_dts_only )
{ {
// in VFW we have no idea about B frames
p_block->i_pts = 0; p_block->i_pts = 0;
p_block->i_dts = i_pts; p_block->i_dts = i_pts;
} }
......
...@@ -194,6 +194,7 @@ typedef struct ...@@ -194,6 +194,7 @@ typedef struct
uint8_t *p_extra_data; uint8_t *p_extra_data;
char *psz_codec; char *psz_codec;
bool b_dts_only;
uint64_t i_default_duration; uint64_t i_default_duration;
float f_timecodescale; float f_timecodescale;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment