Revision 25c533a2

View differences:

libavformat/mpeg.c
1269 1269
    for(i=0; i<p->buf_size; i++){
1270 1270
        code = (code<<8) + p->buf[i];
1271 1271
        if ((code & 0xffffff00) == 0x100) {
1272
            switch(code){
1273
            case SYSTEM_HEADER_START_CODE:    sys++; break;
1274
            case         PRIVATE_STREAM_1:  priv1++; break;
1275
            case          PACK_START_CODE: pspack++; break;
1276
            case       (VIDEO_ID + 0x100):    vid++; break;
1277
            case       (AUDIO_ID + 0x100):  audio++; break;
1278
            }
1272
            if(code == SYSTEM_HEADER_START_CODE) sys++;
1273
            else if(code == PRIVATE_STREAM_1)    priv1++;
1274
            else if(code == PACK_START_CODE)     pspack++;
1275
            else if((code & 0xf0) == VIDEO_ID)   vid++;
1276
            else if((code & 0xe0) == AUDIO_ID)   audio++;
1279 1277
        }
1280 1278
    }
1281 1279
    if(sys && sys*9 <= pspack*10)
1282 1280
        return AVPROBE_SCORE_MAX/2+2; // +1 for .mpg
1283
    if((priv1 || vid) && (priv1+vid)*9 <= pspack*10)
1281
    if((priv1 || vid || audio) && (priv1+vid+audio)*9 <= pspack*10)
1284 1282
        return AVPROBE_SCORE_MAX/2+2; // +1 for .mpg
1285 1283
    if((!!vid ^ !!audio) && !sys && !pspack) /* PES stream */
1286
        return AVPROBE_SCORE_MAX/2;
1284
        return AVPROBE_SCORE_MAX/2+2;
1285
    if(vid || audio)            /* invalid VDR files */
1286
        return AVPROBE_SCORE_MAX/2+2;
1287 1287
    return 0;
1288 1288
}
1289 1289

  

Also available in: Unified diff