Commit f88f9146 authored by Tristan Matthews's avatar Tristan Matthews

opus: always sync i_buffer with i_nb_samples (fixes #10135)

Specifically, the crash at the end of playback was happening when end trim was
not being subtracted from i_buffer.
parent d1ee4337
......@@ -408,10 +408,12 @@ static block_t *DecodePacket( decoder_t *p_dec, ogg_packet *p_oggpacket,
msg_Err( p_dec, "Error: corrupted stream?" );
return NULL;
}
p_aout_buffer->i_buffer = (i_nb_samples - i_end_trim) *
p_sys->header.channels * sizeof(float);
if( spp > i_nb_samples )
{
p_aout_buffer->i_buffer = (i_nb_samples - i_end_trim) *
p_sys->header.channels * sizeof(float);
memmove(p_aout_buffer->p_buffer,
p_aout_buffer->p_buffer
+ (spp - i_nb_samples)*p_sys->header.channels*sizeof(float),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment