[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xine-cvslog
Subject:    [xine-cvs] HG: xine-lib: Signedness bug in Matroska PTS calculation
From:       Dirk Leber <tiqq2 () gmx ! de>
Date:       2009-01-17 14:39:25
Message-ID: 9e3b252816833a578ed9.1200333215 () hg ! debian ! org
[Download RAW message or body]

# HG changeset patch
# User Dirk Leber <tiqq2@gmx.de>
# Date 1200333215 -3600
# Node ID 9e3b252816833a578ed9a6eb12ecf05b3a933f6b
# Parent  5df277a7eec373d9c9dffbf586f6a6a8e69b7d4c
Signedness bug in Matroska PTS calculation
With some mkv files I had many discontinuity events. I found out that if
changing the timecode_diff in demux_matroska.c from int to int16_t fixes
this problem. Using int will never produce negative values if int is not
16-bit...

diff -r 9e3b252816833a578ed9a6eb12ecf05b3a933f6b -r \
                5df277a7eec373d9c9dffbf586f6a6a8e69b7d4c ChangeLog
--- a/ChangeLog	Mon Jan 14 18:53:35 2008 +0100
+++ b/ChangeLog	Fri Jan 16 18:16:17 2009 +0000
@@ -1,5 +1,6 @@ xine-lib (1.1.17) 2009-??-??
 xine-lib (1.1.17) 2009-??-??
   * Build fixes related to ImageMagick 6.4 & later.
+  * Fix an error in Matroska PTS calculation.
   * Enable libmpeg2new. This is not yet production code; the old mpeg2
     decoder remains the default.
   * Fix a broken size check in the pvr input plugin (ref. CVE-2008-5239).
diff -r 9e3b252816833a578ed9a6eb12ecf05b3a933f6b -r \
                5df277a7eec373d9c9dffbf586f6a6a8e69b7d4c \
                src/demuxers/demux_matroska.c
--- a/src/demuxers/demux_matroska.c	Mon Jan 14 18:53:35 2008 +0100
+++ b/src/demuxers/demux_matroska.c	Fri Jan 16 18:16:17 2009 +0000
@@ -1867,7 +1867,7 @@ static int parse_block (demux_matroska_t
   uint8_t          *data;
   uint8_t           flags;
   int               gap, lacing, num_len;
-  int               timecode_diff;
+  int16_t           timecode_diff;
   int64_t           pts, xduration;
   int               decoder_flags = 0;
 
@@ -1877,7 +1877,7 @@ static int parse_block (demux_matroska_t
   data += num_len;
 
   /* timecode_diff is signed */
-  timecode_diff = parse_int16(data);
+  timecode_diff = (int16_t)parse_int16(data);
   data += 2;
 
   flags = *data;

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Xine-cvslog mailing list
Xine-cvslog@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xine-cvslog


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic