Changeset b61170f5 in ffmpeg


Ignore:
Timestamp:
Feb 11, 2015, 12:59:14 AM (10 years ago)
Author:
Michael Niedermayer <michaelni@gmx.at>
Branches:
master
Children:
2924514
Parents:
702cf8d0 (diff), 1509c018 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge commit '1509c018bd5b054a2354e20021ccbac9c934d213'

Conflicts:

libavformat/mpegts.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libavformat/mpegts.c

    r702cf8d0 rb61170f5  
    519519}
    520520
    521 static int analyze(const uint8_t *buf, int size, int packet_size, int *index)
     521static int analyze(const uint8_t *buf, int size, int packet_size, int *index,
     522                   int probe)
    522523{
    523524    int stat[TS_MAX_PACKET_SIZE];
     
    529530
    530531    for (i = 0; i < size - 3; i++) {
    531         if (buf[i] == 0x47 && !(buf[i + 1] & 0x80) && buf[i + 3] != 0x47) {
     532        if (buf[i] == 0x47 &&
     533            (!probe || (!(buf[i + 1] & 0x80) && buf[i + 3] != 0x47))) {
    532534            int x = i % packet_size;
    533535            stat[x]++;
     
    552554        return AVERROR_INVALIDDATA;
    553555
    554     score      = analyze(buf, size, TS_PACKET_SIZE, NULL);
    555     dvhs_score = analyze(buf, size, TS_DVHS_PACKET_SIZE, NULL);
    556     fec_score  = analyze(buf, size, TS_FEC_PACKET_SIZE, NULL);
     556    score      = analyze(buf, size, TS_PACKET_SIZE,      NULL, 0);
     557    dvhs_score = analyze(buf, size, TS_DVHS_PACKET_SIZE, NULL, 0);
     558    fec_score  = analyze(buf, size, TS_FEC_PACKET_SIZE,  NULL, 0);
    557559    av_dlog(NULL, "score: %d, dvhs_score: %d, fec_score: %d \n",
    558560            score, dvhs_score, fec_score);
     
    23952397    for (i = 0; i<check_count; i+=CHECK_BLOCK) {
    23962398        int left = FFMIN(check_count - i, CHECK_BLOCK);
    2397         int score      = analyze(p->buf + TS_PACKET_SIZE     *i, TS_PACKET_SIZE     *left, TS_PACKET_SIZE     , NULL);
    2398         int dvhs_score = analyze(p->buf + TS_DVHS_PACKET_SIZE*i, TS_DVHS_PACKET_SIZE*left, TS_DVHS_PACKET_SIZE, NULL);
    2399         int fec_score  = analyze(p->buf + TS_FEC_PACKET_SIZE *i, TS_FEC_PACKET_SIZE *left, TS_FEC_PACKET_SIZE , NULL);
     2399        int score      = analyze(p->buf + TS_PACKET_SIZE     *i, TS_PACKET_SIZE     *left, TS_PACKET_SIZE     , NULL, 1);
     2400        int dvhs_score = analyze(p->buf + TS_DVHS_PACKET_SIZE*i, TS_DVHS_PACKET_SIZE*left, TS_DVHS_PACKET_SIZE, NULL, 1);
     2401        int fec_score  = analyze(p->buf + TS_FEC_PACKET_SIZE *i, TS_FEC_PACKET_SIZE *left, TS_FEC_PACKET_SIZE , NULL, 1);
    24002402        score = FFMAX3(score, dvhs_score, fec_score);
    24012403        sumscore += score;
Note: See TracChangeset for help on using the changeset viewer.