static int mpegvideo_probe(AVProbeData *p)
{
    uint32_t code= -1;
    int pic=0, seq=0, slice=0, pspack=0, pes=0;
    int i;
    for(i=0; i<p->buf_size; i++){
        code = (code<<8) + p->buf[i];
        if ((code & 0xffffff00) == 0x100) {
            switch(code){
            case     SEQ_START_CODE:   seq++; break;
            case PICTURE_START_CODE:   pic++; break;
            case   SLICE_START_CODE: slice++; break;
            case    PACK_START_CODE: pspack++; break;
            }
            if     ((code & 0x1f0) == VIDEO_ID)   pes++;
            else if((code & 0x1e0) == AUDIO_ID)   pes++;
        }
    }
    if(seq && seq*9<=pic*10 && pic*9<=slice*10 && !pspack && !pes)
        return AVPROBE_SCORE_MAX/2+1;
    return 0;
}
['static int mpegvideo_probe(AVProbeData *p)\n{\n    uint32_t code= -1;\n    int pic=0, seq=0, slice=0, pspack=0, pes=0;\n    int i;\n    for(i=0; i<p->buf_size; i++){\n        code = (code<<8) + p->buf[i];\n        if ((code & 0xffffff00) == 0x100) {\n            switch(code){\n            case     SEQ_START_CODE:   seq++; break;\n            case PICTURE_START_CODE:   pic++; break;\n            case   SLICE_START_CODE: slice++; break;\n            case    PACK_START_CODE: pspack++; break;\n            }\n            if     ((code & 0x1f0) == VIDEO_ID)   pes++;\n            else if((code & 0x1e0) == AUDIO_ID)   pes++;\n        }\n    }\n    if(seq && seq*9<=pic*10 && pic*9<=slice*10 && !pspack && !pes)\n        return AVPROBE_SCORE_MAX/2+1;\n    return 0;\n}']