[MPlayer-cvslog] r26765 - trunk/vobsub.c

ulion subversion at mplayerhq.hu
Wed May 14 05:43:45 CEST 2008


Author: ulion
Date: Wed May 14 05:43:45 2008
New Revision: 26765

Log:
Add detection code for abnormal pts jump when seeking previous.
This patch make the vobsub works more accurately according to the requested pts.


Modified:
   trunk/vobsub.c

Modified: trunk/vobsub.c
==============================================================================
--- trunk/vobsub.c	(original)
+++ trunk/vobsub.c	Wed May 14 05:43:45 2008
@@ -1284,6 +1284,20 @@ vobsub_set_from_lang(void *vobhandle, un
 static void vobsub_queue_reseek(packet_queue_t *queue, unsigned int pts100) {
     int reseek_count = 0;
     unsigned int lastpts = 0;
+
+    if (queue->current_index > 0
+            && (queue->packets[queue->current_index].pts100 == UINT_MAX
+            || queue->packets[queue->current_index].pts100 > pts100)) {
+      // possible pts seek previous, try to check it.
+      int i = 1;
+      while (queue->current_index >= i
+              && queue->packets[queue->current_index-i].pts100 == UINT_MAX)
+          ++i;
+      if (queue->current_index >= i
+              && queue->packets[queue->current_index-i].pts100 > pts100)
+        // pts seek previous confirmed, reseek from beginning
+        queue->current_index = 0;
+    }
     while (queue->current_index < queue->packets_size
             && queue->packets[queue->current_index].pts100 <= pts100) {
       lastpts = queue->packets[queue->current_index].pts100;



More information about the MPlayer-cvslog mailing list