[vlc-commits] opus: always sync i_buffer with i_nb_samples (fixes #10135)

Tristan Matthews git at videolan.org
Thu Jan 9 20:03:47 CET 2014


vlc/vlc-2.1 | branch: master | Tristan Matthews <le.businessman at gmail.com> | Thu Jan  9 01:28:47 2014 -0500| [e0127a91bbb39f2f451d4cee6db575909e571563] | committer: Jean-Baptiste Kempf

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.

(cherry picked from commit f88f91467700484a65d6c5abf0a71cfc4a209320)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=e0127a91bbb39f2f451d4cee6db575909e571563
---

 modules/codec/opus.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/modules/codec/opus.c b/modules/codec/opus.c
index cdf63b8..b97e114 100644
--- a/modules/codec/opus.c
+++ b/modules/codec/opus.c
@@ -395,6 +395,10 @@ 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 )
     {
         memmove(p_aout_buffer->p_buffer,



More information about the vlc-commits mailing list