[vlc-commits] demux: asf: ignore pts when no delta specified (fix #15090)
Francois Cartegnie
git at videolan.org
Wed Sep 23 15:54:24 CEST 2015
vlc/vlc-2.2 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Sep 22 15:31:52 2015 +0200| [8aafb5d01dcffdd4ba161c07bbb102f0a608951e] | committer: Jean-Baptiste Kempf
demux: asf: ignore pts when no delta specified (fix #15090)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=8aafb5d01dcffdd4ba161c07bbb102f0a608951e
---
modules/demux/asf/asf.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/modules/demux/asf/asf.c b/modules/demux/asf/asf.c
index f8406ed..9fbb4bf 100644
--- a/modules/demux/asf/asf.c
+++ b/modules/demux/asf/asf.c
@@ -606,7 +606,7 @@ static void SendPacket(demux_t *p_demux, asf_track_t *tk)
static int DemuxSubPayload(demux_t *p_demux, asf_track_t *tk,
uint32_t i_sub_payload_data_length, mtime_t i_pts, mtime_t i_dts,
- uint32_t i_media_object_offset, bool b_keyframe )
+ uint32_t i_media_object_offset, bool b_keyframe, bool b_pts_delta )
{
/* FIXME I don't use i_media_object_number, sould I ? */
if( tk->p_frame && i_media_object_offset == 0 )
@@ -618,7 +618,8 @@ static int DemuxSubPayload(demux_t *p_demux, asf_track_t *tk,
return -1;
}
- p_frag->i_pts = VLC_TS_0 + i_pts;
+ p_frag->i_pts = (tk->i_cat == VIDEO_ES && !b_pts_delta) ? VLC_TS_INVALID
+ : VLC_TS_0 + i_pts;
p_frag->i_dts = VLC_TS_0 + i_dts;
if ( b_keyframe )
p_frag->i_flags |= BLOCK_FLAG_TYPE_I;
@@ -759,6 +760,7 @@ static int DemuxPayload(demux_t *p_demux, struct asf_packet_t *pkt, int i_payloa
mtime_t i_base_pts;
uint8_t i_pts_delta = 0;
+ bool b_has_delta = false;
uint32_t i_payload_data_length = 0;
uint32_t i_temp_payload_length = 0;
p_sys->p_fp->i_preroll = __MIN( p_sys->p_fp->i_preroll, INT64_MAX );
@@ -794,6 +796,7 @@ static int DemuxPayload(demux_t *p_demux, struct asf_packet_t *pkt, int i_payloa
/* i_media_object_offset is presentation time */
/* Next byte is Presentation Time Delta */
i_pts_delta = pkt->p_peek[pkt->i_skip];
+ b_has_delta = true;
i_base_pts = (mtime_t)i_media_object_offset;
i_base_pts -= p_sys->p_fp->i_preroll;
pkt->i_skip++;
@@ -899,7 +902,7 @@ static int DemuxPayload(demux_t *p_demux, struct asf_packet_t *pkt, int i_payloa
if ( i_sub_payload_data_length &&
DemuxSubPayload(p_demux, tk, i_sub_payload_data_length,
i_payload_pts, i_payload_dts, i_media_object_offset,
- b_packet_keyframe ) < 0)
+ b_packet_keyframe, b_has_delta ) < 0)
return -1;
if ( pkt->left > pkt->i_skip + i_sub_payload_data_length )
More information about the vlc-commits
mailing list