changeset 14515:35a6c4db00ae

More support for AVC in Matroska.
author mosu
date Sun, 16 Jan 2005 14:59:19 +0000
parents 7c433bf88d1e
children b62300c8f194
files libmpdemux/demux_mkv.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_mkv.c	Sun Jan 16 14:22:37 2005 +0000
+++ b/libmpdemux/demux_mkv.c	Sun Jan 16 14:59:19 2005 +0000
@@ -98,6 +98,7 @@
   int reorder_timecodes;
   demux_packet_t **cached_dps;
   int num_cached_dps, num_allocated_dps;
+  float max_pts;
 
   /* generic content encoding support */
   mkv_content_encoding_t *encodings;
@@ -2865,6 +2866,8 @@
   memcpy(dp->buffer, buffer, size);
   dp->pos = demuxer->filepos;
   dp->pts = mkv_d->last_pts;
+  if ((track->num_cached_dps > 0) && (dp->pts < track->max_pts))
+    block_fref = 1;
   if (block_fref == 0)          /* I or P frame */
     flush_cached_dps (demuxer, track);
   if (block_bref != 0)          /* I frame, don't cache it */
@@ -2878,6 +2881,8 @@
     }
   track->cached_dps[track->num_cached_dps] = dp;
   track->num_cached_dps++;
+  if (dp->pts > track->max_pts)
+    track->max_pts = dp->pts;
 }
 
 static int