... | ... |
@@ -102,6 +102,7 @@ typedef struct ShortenContext { |
102 | 102 |
int blocksize; |
103 | 103 |
int bitindex; |
104 | 104 |
int32_t lpcqoffset; |
105 |
+ int got_header; |
|
105 | 106 |
} ShortenContext; |
106 | 107 |
|
107 | 108 |
static av_cold int shorten_decode_init(AVCodecContext * avctx) |
... | ... |
@@ -386,6 +387,8 @@ static int read_header(ShortenContext *s) |
386 | 386 |
s->cur_chan = 0; |
387 | 387 |
s->bitshift = 0; |
388 | 388 |
|
389 |
+ s->got_header = 1; |
|
390 |
+ |
|
389 | 391 |
return 0; |
390 | 392 |
} |
391 | 393 |
|
... | ... |
@@ -438,8 +441,7 @@ static int shorten_decode_frame(AVCodecContext *avctx, |
438 | 438 |
skip_bits(&s->gb, s->bitindex); |
439 | 439 |
|
440 | 440 |
/* process header or next subblock */ |
441 |
- if (!s->blocksize) |
|
442 |
- { |
|
441 |
+ if (!s->got_header) { |
|
443 | 442 |
if ((ret = read_header(s)) < 0) |
444 | 443 |
return ret; |
445 | 444 |
*data_size = 0; |