Fixes ticket #6096.
Carl Eugen Hoyos authored on 2017/01/30 19:03:21... | ... |
@@ -76,6 +76,7 @@ typedef struct ALACContext { |
76 | 76 |
uint8_t rice_history_mult; |
77 | 77 |
uint8_t rice_initial_history; |
78 | 78 |
uint8_t rice_limit; |
79 |
+ int sample_rate; |
|
79 | 80 |
|
80 | 81 |
int extra_bits; /**< number of extra bits beyond 16-bit */ |
81 | 82 |
int nb_samples; /**< number of samples in the current frame */ |
... | ... |
@@ -538,7 +539,7 @@ static int alac_set_info(ALACContext *alac) |
538 | 538 |
bytestream2_get_be16u(&gb); // maxRun |
539 | 539 |
bytestream2_get_be32u(&gb); // max coded frame size |
540 | 540 |
bytestream2_get_be32u(&gb); // average bitrate |
541 |
- bytestream2_get_be32u(&gb); // samplerate |
|
541 |
+ alac->sample_rate = bytestream2_get_be32u(&gb); |
|
542 | 542 |
|
543 | 543 |
return 0; |
544 | 544 |
} |
... | ... |
@@ -570,6 +571,7 @@ static av_cold int alac_decode_init(AVCodecContext * avctx) |
570 | 570 |
return AVERROR_PATCHWELCOME; |
571 | 571 |
} |
572 | 572 |
avctx->bits_per_raw_sample = alac->sample_size; |
573 |
+ avctx->sample_rate = alac->sample_rate; |
|
573 | 574 |
|
574 | 575 |
if (alac->channels < 1) { |
575 | 576 |
av_log(avctx, AV_LOG_WARNING, "Invalid channel count\n"); |