summaryrefslogtreecommitdiffstats
path: root/libavformat/mpegts.c
diff options
context:
space:
mode:
authorMåns Rullgård <mans@mansr.com>2008-07-18 01:07:17 +0000
committerMåns Rullgård <mans@mansr.com>2008-07-18 01:07:17 +0000
commitc6002ea14d457de10340d1dc907643294a77d504 (patch)
tree2cf924d7e9a6502435fe637459cb877e44488ac4 /libavformat/mpegts.c
parent5469b788ea0dcdfcd368dade51bd15a76165ffd6 (diff)
downloadffmpeg-streaming-c6002ea14d457de10340d1dc907643294a77d504.zip
ffmpeg-streaming-c6002ea14d457de10340d1dc907643294a77d504.tar.gz
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). Originally committed as revision 14274 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mpegts.c')
-rw-r--r--libavformat/mpegts.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index a10f5dc..5067f77 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -347,8 +347,8 @@ static int analyze(const uint8_t *buf, int size, int packet_size, int *index){
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];
OpenPOWER on IntegriCloud