changeset 32779:87504a38a666

Change SVB SPU stream format in TS demuxer so it can be decoded by libavcodec (as soon as lavc is fixed not to fail just because of an extra padding byte).
author reimar
date Sun, 06 Feb 2011 14:06:35 +0000
parents 9404cb19e08d
children b3782b0b1d92
files libmpdemux/demux_ts.c
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_ts.c	Sun Feb 06 14:03:10 2011 +0000
+++ b/libmpdemux/demux_ts.c	Sun Feb 06 14:06:35 2011 +0000
@@ -1483,10 +1483,11 @@
 		}
 		/* SPU SUBS */
 		else if(type_from_pmt == SPU_DVB ||
-		(packet_len >= 1 && (p[0] == 0x20) && pes_is_aligned)) // && p[1] == 0x00))
+		(packet_len >= 2 && (p[0] == 0x20) && pes_is_aligned)) // && p[1] == 0x00))
 		{
-			es->start = p;
-			es->size  = packet_len;
+			// offset/length fiddling to make decoding with lavc possible
+			es->start = p + 2;
+			es->size  = packet_len - 2;
 			es->type  = SPU_DVB;
 			es->payload_size -= packet_len;