Fix granulepos bug on empty streams
authorJean-Marc Valin <jmvalin@jmvalin.ca>
Fri, 12 May 2017 22:17:28 +0000 (18:17 -0400)
committerJean-Marc Valin <jmvalin@jmvalin.ca>
Fri, 12 May 2017 22:17:28 +0000 (18:17 -0400)
src/opusenc.c

index 404d44c..7efbe4a 100644 (file)
@@ -654,6 +654,7 @@ int ope_encoder_continue_new_callbacks(OggOpusEnc *enc, void *user_data, const O
   new_stream = stream_create(comments);
   if (!new_stream) return OPE_ALLOC_FAIL;
   new_stream->user_data = user_data;
+  new_stream->end_granule = enc->write_granule;
   enc->last_stream->next = new_stream;
   enc->last_stream = new_stream;
   return OPE_OK;