Mercurial > libavformat.hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
3588:f217917f4433 | 3589:f306b45cab7e |
---|---|
345 int x=0; | 345 int x=0; |
346 int best_score=0; | 346 int best_score=0; |
347 | 347 |
348 memset(stat, 0, packet_size*sizeof(int)); | 348 memset(stat, 0, packet_size*sizeof(int)); |
349 | 349 |
350 for(x=i=0; i<size; i++){ | 350 for(x=i=0; i<size-3; i++){ |
351 if(buf[i] == 0x47){ | 351 if(buf[i] == 0x47 && !(buf[i+1] & 0x80) && (buf[i+3] & 0x30)){ |
352 stat[x]++; | 352 stat[x]++; |
353 if(stat[x] > best_score){ | 353 if(stat[x] > best_score){ |
354 best_score= stat[x]; | 354 best_score= stat[x]; |
355 if(index) *index= x; | 355 if(index) *index= x; |
356 } | 356 } |