vorbis_encoder: reinitialize vorbis_dsp_state after flush
libvorbis goes into a very long loop if we try to add data after a flush was invoked by vorbis_analysis_wrote(0). This seems to be a problem with the internal end-of-stream marker. Thus, we cannot reuse the vorbis_dsp_state object.
This commit is contained in:
parent
3888ef2f55
commit
ecb7f24b01
@ -262,6 +262,13 @@ vorbis_encoder_flush(struct encoder *_encoder, G_GNUC_UNUSED GError **error)
|
|||||||
vorbis_analysis_wrote(&encoder->vd, 0);
|
vorbis_analysis_wrote(&encoder->vd, 0);
|
||||||
vorbis_encoder_blockout(encoder);
|
vorbis_encoder_blockout(encoder);
|
||||||
|
|
||||||
|
/* reinitialize vorbis_dsp_state and vorbis_block to reset the
|
||||||
|
end-of-stream marker */
|
||||||
|
vorbis_block_clear(&encoder->vb);
|
||||||
|
vorbis_dsp_clear(&encoder->vd);
|
||||||
|
vorbis_analysis_init(&encoder->vd, &encoder->vi);
|
||||||
|
vorbis_block_init(&encoder->vd, &encoder->vb);
|
||||||
|
|
||||||
encoder->flush = true;
|
encoder->flush = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user