OpusEncoderPlugin: initialise granulepos so we end up with sane values

Not initialising granulepos leads to it having arbitrary values in the
encoded stream including possibly negative values which are not valid
and confuse opusdec.  Explicitly initialise opus_encoder::granulepos
to avoid that problem.
This commit is contained in:
Michal Nazarewicz 2015-03-23 19:14:54 +01:00 committed by Max Kellermann
parent 2f5fd91bd8
commit 0d7ee2b014
2 changed files with 3 additions and 1 deletions

2
NEWS
View File

@ -1,4 +1,6 @@
ver 0.19.10 (not yet released)
* encoder
- opus: fix bogus granulepos
ver 0.19.9 (2015/02/06)
* decoder

View File

@ -66,7 +66,7 @@ struct opus_encoder {
ogg_int64_t granulepos;
opus_encoder():encoder(opus_encoder_plugin) {}
opus_encoder():encoder(opus_encoder_plugin), granulepos(0) {}
};
static constexpr Domain opus_encoder_domain("opus_encoder");