[vlc-devel] [PATCH 1/9] avcodec: map VLC_TS_INVALID to AV_NOPTS_VALUE
ileoo at videolan.org
ileoo at videolan.org
Sun Sep 4 14:34:01 CEST 2016
From: Ilkka Ollakka <ileoo at videolan.org>
---
modules/codec/avcodec/video.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index c58583a..74024d4 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -813,8 +813,8 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
{
pkt.data = p_block->p_buffer;
pkt.size = p_block->i_buffer;
- pkt.pts = p_block->i_pts;
- pkt.dts = p_block->i_dts;
+ pkt.pts = p_block->i_pts > VLC_TS_INVALID ? p_block->i_pts : AV_NOPTS_VALUE;
+ pkt.dts = p_block->i_dts > VLC_TS_INVALID ? p_block->i_dts : AV_NOPTS_VALUE;
}
else
{
@@ -882,10 +882,10 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
/* Compute the PTS */
mtime_t i_pts = frame->pkt_pts;
- if (i_pts <= VLC_TS_INVALID)
+ if (i_pts == AV_NOPTS_VALUE )
i_pts = frame->pkt_dts;
- if( i_pts <= VLC_TS_INVALID )
+ if( i_pts == AV_NOPTS_VALUE )
i_pts = p_sys->i_pts;
/* Interpolate the next PTS */
--
2.6.6
More information about the vlc-devel
mailing list