Revision a1c69e0b

View differences:

libavformat/mpeg.c
1265 1265
    uint32_t code= -1;
1266 1266
    int sys=0, pspack=0, priv1=0, vid=0, audio=0;
1267 1267
    int i;
1268
    int score=0;
1268 1269

  
1269 1270
    for(i=0; i<p->buf_size; i++){
1270 1271
        code = (code<<8) + p->buf[i];
......
1276 1277
            else if((code & 0xe0) == AUDIO_ID)   audio++;
1277 1278
        }
1278 1279
    }
1280

  
1281
    if(vid || audio)            /* invalid VDR files nd short PES streams */
1282
        score= AVPROBE_SCORE_MAX/4;
1283

  
1284
//av_log(NULL, AV_LOG_ERROR, "%d %d %d %d %d\n", sys, priv1, pspack,vid, audio);
1279 1285
    if(sys && sys*9 <= pspack*10)
1280 1286
        return AVPROBE_SCORE_MAX/2+2; // +1 for .mpg
1281 1287
    if((priv1 || vid || audio) && (priv1+vid+audio)*9 <= pspack*10)
1282 1288
        return AVPROBE_SCORE_MAX/2+2; // +1 for .mpg
1283
    if((!!vid ^ !!audio) && !sys && !pspack) /* PES stream */
1284
        return AVPROBE_SCORE_MAX/2+2;
1285
    if(vid || audio)            /* invalid VDR files */
1289
    if((!!vid ^ !!audio) && (audio+vid > 1) && !sys && !pspack) /* PES stream */
1286 1290
        return AVPROBE_SCORE_MAX/2+2;
1287
    return 0;
1291

  
1292
    //02-Penguin.flac has sys:0 priv1:0 pspack:0 vid:0 audio:1
1293
    return score;
1288 1294
}
1289 1295

  
1290 1296

  

Also available in: Unified diff