~ppsspp/ppsspp/ffmpeg

« back to all changes in this revision

Viewing changes to libavcodec/wavpack.c

  • Committer: Henrik Rydgård
  • Date: 2014-01-03 10:44:32 UTC
  • Revision ID: git-v1:87c6c126784b1718bfa448ecf2e6a9fef781eb4e
Update our ffmpeg snapshot to a clone of the official repository.

This is because Maxim's at3plus support has been officially merged!

Show diffs side-by-side

added added

removed removed

Lines of Context:
487
487
    } while (!last && count < s->samples);
488
488
 
489
489
    wv_reset_saved_context(s);
 
490
 
 
491
    if (last && count < s->samples) {
 
492
        int size = av_get_bytes_per_sample(type);
 
493
        memset((uint8_t*)dst_l + count*size, 0, (s->samples-count)*size);
 
494
        memset((uint8_t*)dst_r + count*size, 0, (s->samples-count)*size);
 
495
    }
 
496
 
490
497
    if ((s->avctx->err_recognition & AV_EF_CRCCHECK) &&
491
498
        wv_check_crc(s, crc, crc_extra_bits))
492
499
        return AVERROR_INVALIDDATA;
548
555
    } while (!last && count < s->samples);
549
556
 
550
557
    wv_reset_saved_context(s);
551
 
    if ((s->avctx->err_recognition & AV_EF_CRCCHECK) &&
552
 
        wv_check_crc(s, crc, crc_extra_bits))
553
 
        return AVERROR_INVALIDDATA;
 
558
 
 
559
    if (last && count < s->samples) {
 
560
        int size = av_get_bytes_per_sample(type);
 
561
        memset((uint8_t*)dst + count*size, 0, (s->samples-count)*size);
 
562
    }
 
563
 
 
564
    if (s->avctx->err_recognition & AV_EF_CRCCHECK) {
 
565
        int ret = wv_check_crc(s, crc, crc_extra_bits);
 
566
        if (ret < 0 && s->avctx->err_recognition & AV_EF_EXPLODE)
 
567
            return ret;
 
568
    }
554
569
 
555
570
    return 0;
556
571
}
845
860
        case WP_ID_DATA:
846
861
            s->sc.offset = bytestream2_tell(&gb);
847
862
            s->sc.size   = size * 8;
848
 
            init_get_bits(&s->gb, gb.buffer, size * 8);
 
863
            if ((ret = init_get_bits8(&s->gb, gb.buffer, size)) < 0)
 
864
                return ret;
849
865
            s->data_size = size * 8;
850
866
            bytestream2_skip(&gb, size);
851
867
            got_bs       = 1;
859
875
            }
860
876
            s->extra_sc.offset = bytestream2_tell(&gb);
861
877
            s->extra_sc.size   = size * 8;
862
 
            init_get_bits(&s->gb_extra_bits, gb.buffer, size * 8);
 
878
            if ((ret = init_get_bits8(&s->gb_extra_bits, gb.buffer, size)) < 0)
 
879
                return ret;
863
880
            s->crc_extra_bits  = get_bits_long(&s->gb_extra_bits, 32);
864
881
            bytestream2_skip(&gb, size);
865
882
            s->got_extra_bits  = 1;