diff mpegts.c @ 3589:f306b45cab7e libavformat

MPEGTS: Improve probe function When a sync byte is found, check that transport_error_indicator is zero, and adaptation_field_control is valid (non-zero).
author mru
date Fri, 18 Jul 2008 01:07:17 +0000
parents c3b9334f46ae
children 8017c6d153a3
line wrap: on
line diff
--- a/mpegts.c	Fri Jul 18 00:24:31 2008 +0000
+++ b/mpegts.c	Fri Jul 18 01:07:17 2008 +0000
@@ -347,8 +347,8 @@
 
     memset(stat, 0, packet_size*sizeof(int));
 
-    for(x=i=0; i<size; i++){
-        if(buf[i] == 0x47){
+    for(x=i=0; i<size-3; i++){
+        if(buf[i] == 0x47 && !(buf[i+1] & 0x80) && (buf[i+3] & 0x30)){
             stat[x]++;
             if(stat[x] > best_score){
                 best_score= stat[x];