[vlc-commits] opus: update i_buffer when memmoving decoder output

Tristan Matthews git at videolan.org
Tue Nov 12 21:44:52 CET 2013


vlc | branch: master | Tristan Matthews <le.businessman at gmail.com> | Tue Nov 12 10:01:39 2013 -0500| [7163c4b94a441b3bba7355a9bb117d048a33747b] | committer: Rémi Denis-Courmont

opus: update i_buffer when memmoving decoder output

Fixes #9343

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

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

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

diff --git a/modules/codec/opus.c b/modules/codec/opus.c
index 60edb5f..d4e5f88 100644
--- a/modules/codec/opus.c
+++ b/modules/codec/opus.c
@@ -404,10 +404,12 @@ static block_t *DecodePacket( decoder_t *p_dec, ogg_packet *p_oggpacket,
     }
     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),
-            (i_nb_samples - i_end_trim)*p_sys->header.channels*sizeof(float));
+            p_aout_buffer->i_buffer);
     }
     i_nb_samples -= i_end_trim;
 



More information about the vlc-commits mailing list