-//av_log(NULL, AV_LOG_ERROR, "%d %d %d %d %d len:%d\n", sys, priv1, pspack,vid, audio, p->buf_size);
- if(sys && sys*9 <= pspack*10)
- return AVPROBE_SCORE_MAX/2+2; // +1 for .mpg
- if((priv1 || vid || audio) && (priv1+vid+audio)*9 <= pspack*10)
- return AVPROBE_SCORE_MAX/2+2; // +1 for .mpg
- if((!!vid ^ !!audio) && (audio+vid > 1) && !sys && !pspack && p->buf_size>2048) /* PES stream */
- return AVPROBE_SCORE_MAX/2+2;
+//av_log(NULL, AV_LOG_ERROR, "%d %d %d %d %d %d len:%d\n", sys, priv1, pspack,vid, audio, invalid, p->buf_size);
+ if(sys>invalid && sys*9 <= pspack*10)
+ return pspack > 2 ? AVPROBE_SCORE_MAX/2+2 : AVPROBE_SCORE_MAX/4; // +1 for .mpg
+ if(pspack > invalid && (priv1+vid+audio)*10 >= pspack*9)
+ return pspack > 2 ? AVPROBE_SCORE_MAX/2+2 : AVPROBE_SCORE_MAX/4; // +1 for .mpg
+ if((!!vid ^ !!audio) && (audio > 4 || vid > 1) && !sys && !pspack && p->buf_size>2048 && vid + audio > invalid) /* PES stream */
+ return (audio > 12 || vid > 3) ? AVPROBE_SCORE_MAX/2+2 : AVPROBE_SCORE_MAX/4;