Unified · Split
| @@ -65,7 +65,7 @@ typedef struct HCAContext { · 64 unmodified lines | ||
| 65 | 65 | uint8_t stereo_band_count; |
| 66 | 66 | uint8_t bands_per_hfr_group; |
| 67 | 67 | |
| 68 | − // Set during init() and freed on close(). Untouched on flush() | |
| 68 | + // Set during init() and freed on close(). Untouched on init_flush() | |
| 69 | 69 | av_tx_fn tx_fn; |
| 70 | 70 | AVTXContext *tx_ctx; |
| 71 | 71 | AVFloatDSPContext *fdsp; |
| @@ -197,7 +197,7 @@ static inline unsigned ceil2(unsigned a, unsigned b) · 125 unmodified lines | ||
| 197 | 197 | return (b > 0) ? (a / b + ((a % b) ? 1 : 0)) : 0; |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | −static av_cold void decode_flush(AVCodecContext *avctx) | |
| 200 | +static av_cold void init_flush(AVCodecContext *avctx) | |
| 201 | 201 | { |
| 202 | 202 | HCAContext *c = avctx->priv_data; |
| 203 | 203 | |
| @@ -213,7 +213,7 @@ static int init_hca(AVCodecContext *avctx, const uint8_t *extradata, · 9 unmodified lines | ||
| 213 | 213 | unsigned b, chunk; |
| 214 | 214 | int version, ret; |
| 215 | 215 | |
| 216 | − decode_flush(avctx); | |
| 216 | + init_flush(avctx); | |
| 217 | 217 | |
| 218 | 218 | if (extradata_size < 36) |
| 219 | 219 | return AVERROR_INVALIDDATA; |
| @@ -609,6 +609,14 @@ static av_cold int decode_close(AVCodecContext *avctx) · 389 unmodified lines | ||
| 609 | 609 | return 0; |
| 610 | 610 | } |
| 611 | 611 | |
| 612 | +static av_cold void decode_flush(AVCodecContext *avctx) | |
| 613 | +{ | |
| 614 | + HCAContext *c = avctx->priv_data; | |
| 615 | + | |
| 616 | + for (int ch = 0; ch < MAX_CHANNELS; ch++) | |
| 617 | + memset(c->ch[ch].imdct_prev, 0, sizeof(c->ch[ch].imdct_prev)); | |
| 618 | +} | |
| 619 | + | |
| 612 | 620 | const FFCodec ff_hca_decoder = { |
| 613 | 621 | .p.name = "hca", |
| 614 | 622 | CODEC_LONG_NAME("CRI HCA"), |