[vlc-commits] demux: ogg: avoid negative pts due to prepcr roundings (fix #14348)

Francois Cartegnie git at videolan.org
Fri Apr 10 10:18:13 CEST 2015


vlc/vlc-2.2 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Apr 10 02:57:30 2015 +0200| [31b93ae2d9915c02a73b6aabebc6ec26982b2681] | committer: Jean-Baptiste Kempf

demux: ogg: avoid negative pts due to prepcr roundings (fix #14348)

(cherry picked from commit 624a2a4c1d53731126f4c1c41682d8d9649870d4)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/demux/ogg.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/demux/ogg.c b/modules/demux/ogg.c
index cf0f16d..2e77c42 100644
--- a/modules/demux/ogg.c
+++ b/modules/demux/ogg.c
@@ -574,7 +574,9 @@ static int Demux( demux_t * p_demux )
                     if ( p_stream->fmt.i_cat == VIDEO_ES )
                     {
                         pagestamp = pagestamp - ( CLOCK_FREQ / p_stream->f_rate );
-                        p_block->i_pts = p_sys->i_nzpcr_offset + pagestamp;
+                        if( pagestamp < 0 )
+                            pagestamp = 0;
+                        p_block->i_pts = VLC_TS_0 + p_sys->i_nzpcr_offset + pagestamp;
                         b_fixed = true;
                     }
                 }



More information about the vlc-commits mailing list