Ticket #6096: patchalac.diff

File patchalac.diff, 1.1 KB (added by Carl Eugen Hoyos, 10 years ago)
  • libavcodec/alac.c

    diff --git a/libavcodec/alac.c b/libavcodec/alac.c
    index b9c3400..8d234ed 100644
    a b typedef struct ALACContext {  
    7676    uint8_t  rice_history_mult;
    7777    uint8_t  rice_initial_history;
    7878    uint8_t  rice_limit;
     79    int      sample_rate;
    7980
    8081    int extra_bits;     /**< number of extra bits beyond 16-bit */
    8182    int nb_samples;     /**< number of samples in the current frame */
    static int alac_set_info(ALACContext *alac)  
    538539    bytestream2_get_be16u(&gb); // maxRun
    539540    bytestream2_get_be32u(&gb); // max coded frame size
    540541    bytestream2_get_be32u(&gb); // average bitrate
    541     bytestream2_get_be32u(&gb); // samplerate
     542    alac->sample_rate          = bytestream2_get_be32u(&gb);
    542543
    543544    return 0;
    544545}
    static av_cold int alac_decode_init(AVCodecContext * avctx)  
    570571             return AVERROR_PATCHWELCOME;
    571572    }
    572573    avctx->bits_per_raw_sample = alac->sample_size;
     574    avctx->sample_rate         = alac->sample_rate;
    573575
    574576    if (alac->channels < 1) {
    575577        av_log(avctx, AV_LOG_WARNING, "Invalid channel count\n");