[MPlayer-dev-eng] [PATCH] disappearing subtitles at dvd chapter intervals

Tobias Diedrich ranma at gmx.at
Wed Aug 6 23:01:23 CEST 2003


Robert Henney wrote:

> Okay, I've now uploaded a segment to the incoming directory on mplayerhq.hu,
> by the filename of skipped_sub.tar.gz.  notes and console output included
> in tar.

Nice.
Here is your fix.

The problem is that mplayer.c calls spudec_assemble with timestamp as
pts100 value. Timestamp can go backwards, which is not good.
Using 90000*sh_video->timer instead should fix it AFAICS and is already
used for spudec_heartbeat.

-- 
Tobias						PGP: http://9ac7e0bc.2ya.com
This mail is made of 100% recycled bits
-------------- next part --------------
Index: spudec.c
===================================================================
RCS file: /cvsroot/mplayer/main/spudec.c,v
retrieving revision 1.41
diff -u -r1.41 spudec.c
--- spudec.c	23 Feb 2003 22:05:35 -0000	1.41
+++ spudec.c	6 Aug 2003 21:05:37 -0000
@@ -98,6 +98,8 @@
   else
     this->queue_tail->next = packet;
   this->queue_tail = packet;
+  mp_msg(MSGT_SPUDEC,MSGL_DBG2,"queue_packet: start_pts=%d end_pts=%d\n",
+		  packet->start_pts, packet->end_pts);
 }
 
 static packet_t *spudec_dequeue_packet(spudec_handle_t *this)
@@ -385,6 +387,7 @@
 	/* Stop display */
 	mp_msg(MSGT_SPUDEC,MSGL_DBG2,"Stop display!\n");
 	end_pts = pts100 + date;
+	display = 0;
 	break;
       case 0x03:
 	/* Palette */
@@ -447,9 +450,9 @@
       int i;
       packet->start_pts = start_pts;
       if (end_pts == UINT_MAX && start_off != next_off) {
-	start_pts = pts100 + get_be16(this->packet + next_off) * 1024;
-        packet->end_pts = start_pts - 1;
-      } else packet->end_pts = end_pts;
+	end_pts = pts100 - 1 + get_be16(this->packet + next_off) * 1024;
+      }
+      packet->end_pts = end_pts;
       packet->current_nibble[0] = current_nibble[0];
       packet->current_nibble[1] = current_nibble[1];
       packet->start_row = start_row;
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.708
diff -u -r1.708 mplayer.c
--- mplayer.c	22 Jul 2003 10:46:22 -0000	1.708
+++ mplayer.c	6 Aug 2003 21:06:01 -0000
@@ -3458,7 +3458,7 @@
     }
       if(len<=0 || !packet) break;
       if(timestamp < 0) timestamp = 0;
-      spudec_assemble(vo_spudec,packet,len,timestamp);
+      spudec_assemble(vo_spudec,packet,len,90000*sh_video->timer);
   }
   
   /* detect wether the sub has changed or not */
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20030806/50878233/attachment.pgp>


More information about the MPlayer-dev-eng mailing list