Revision 6612d8cf libavformat/utils.c

View differences:

libavformat/utils.c
23 23
#include "libavcodec/internal.h"
24 24
#include "libavutil/opt.h"
25 25
#include "metadata.h"
26
#include "id3v2.h"
26 27
#include "libavutil/avstring.h"
27 28
#include "riff.h"
28 29
#include "audiointerleave.h"
......
343 344

  
344 345
AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max)
345 346
{
347
    AVProbeData lpd = *pd;
346 348
    AVInputFormat *fmt1, *fmt;
347 349
    int score;
348 350

  
351
    if (lpd.buf_size > 10 && ff_id3v2_match(lpd.buf, ID3v2_DEFAULT_MAGIC)) {
352
        int id3len = ff_id3v2_tag_len(lpd.buf);
353
        if (lpd.buf_size > id3len + 16) {
354
            lpd.buf += id3len;
355
            lpd.buf_size -= id3len;
356
        }
357
    }
358

  
349 359
    fmt = NULL;
350 360
    for(fmt1 = first_iformat; fmt1 != NULL; fmt1 = fmt1->next) {
351 361
        if (!is_opened == !(fmt1->flags & AVFMT_NOFILE))
352 362
            continue;
353 363
        score = 0;
354 364
        if (fmt1->read_probe) {
355
            score = fmt1->read_probe(pd);
365
            score = fmt1->read_probe(&lpd);
356 366
        } else if (fmt1->extensions) {
357
            if (av_match_ext(pd->filename, fmt1->extensions)) {
367
            if (av_match_ext(lpd.filename, fmt1->extensions)) {
358 368
                score = 50;
359 369
            }
360 370
        }
......
448 458
        ic->priv_data = NULL;
449 459
    }
450 460

  
461
    // e.g. AVFMT_NOFILE formats will not have a ByteIOContext
462
    if (ic->pb)
463
        ff_id3v2_read(ic, ID3v2_DEFAULT_MAGIC);
464

  
451 465
    if (ic->iformat->read_header) {
452 466
        err = ic->iformat->read_header(ic, ap);
453 467
        if (err < 0)

Also available in: Unified diff