Revision 19e0e403 libavformat/mpeg.c

View differences:

libavformat/mpeg.c
1263 1263
static int mpegps_probe(AVProbeData *p)
1264 1264
{
1265 1265
    uint32_t code= -1;
1266
    int sys=0, pspack=0, priv1=0, vid=0;
1266
    int sys=0, pspack=0, priv1=0, vid=0, audio=0;
1267 1267
    int i;
1268 1268

  
1269 1269
    for(i=0; i<p->buf_size; i++){
......
1274 1274
            case         PRIVATE_STREAM_1:  priv1++; break;
1275 1275
            case          PACK_START_CODE: pspack++; break;
1276 1276
            case       (VIDEO_ID + 0x100):    vid++; break;
1277
            case       (AUDIO_ID + 0x100):  audio++; break;
1277 1278
            }
1278 1279
        }
1279 1280
    }
......
1281 1282
        return AVPROBE_SCORE_MAX/2+2; // +1 for .mpg
1282 1283
    if((priv1 || vid) && (priv1+vid)*9 <= pspack*10)
1283 1284
        return AVPROBE_SCORE_MAX/2+2; // +1 for .mpg
1285
    if((!!vid ^ !!audio) && !sys && !pspack) /* PES stream */
1286
        return AVPROBE_SCORE_MAX/2;
1284 1287
    return 0;
1285 1288
}
1286 1289

  

Also available in: Unified diff