]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Skip MPEG Padding start codes
authorAndreas Öman <andreas@lonelycoder.com>
Wed, 10 Mar 2010 22:45:29 +0000 (22:45 +0000)
committerAndreas Öman <andreas@lonelycoder.com>
Wed, 10 Mar 2010 22:45:29 +0000 (22:45 +0000)
src/parsers.c

index 2c8a629d11f8610bef78cf4f99f63d97c43dbf67..5d9e83e1f92c43b3a9b08d29f4af206253ba4b5d 100644 (file)
@@ -878,6 +878,17 @@ parse_subtitles(th_transport_t *t, th_stream_t *st, const uint8_t *data,
   if(st->st_buffer_ptr < 6)
     return;
 
+  uint32_t startcode =
+    (st->st_buffer[0] << 24) |
+    (st->st_buffer[1] << 16) |
+    (st->st_buffer[2] << 8) |
+    (st->st_buffer[3]);
+
+  if(startcode == 0x1be) {
+    st->st_parser_state = 0;
+    return;
+  }
+
   psize = st->st_buffer[4] << 8 | st->st_buffer[5];
 
   if(st->st_buffer_ptr != psize + 6)