Revision 56a10009 libavformat/utils.c

View differences:

libavformat/utils.c
371 371
{
372 372
    AVProbeData lpd = *pd;
373 373
    AVInputFormat *fmt1 = NULL, *fmt;
374
    int score;
374
    int score, id3 = 0;
375 375

  
376 376
    if (lpd.buf_size > 10 && ff_id3v2_match(lpd.buf, ID3v2_DEFAULT_MAGIC)) {
377 377
        int id3len = ff_id3v2_tag_len(lpd.buf);
......
379 379
            lpd.buf += id3len;
380 380
            lpd.buf_size -= id3len;
381 381
        }
382
        id3 = 1;
382 383
    }
383 384

  
384 385
    fmt = NULL;
......
399 400
        }else if (score == *score_max)
400 401
            fmt = NULL;
401 402
    }
403

  
404
    /* a hack for files with huge id3v2 tags -- try to guess by file extension. */
405
    if (!fmt && id3 && *score_max < AVPROBE_SCORE_MAX/4) {
406
        while ((fmt = av_iformat_next(fmt)))
407
            if (fmt->extensions && av_match_ext(lpd.filename, fmt->extensions)) {
408
                *score_max = AVPROBE_SCORE_MAX/4;
409
                break;
410
            }
411
    }
412

  
402 413
    return fmt;
403 414
}
404 415

  

Also available in: Unified diff