[vlc-commits] tospdif: fix samples count

Thomas Guillem git at videolan.org
Wed Sep 14 15:32:03 CEST 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Sep 13 14:48:23 2016 +0200| [49807ea19e7d62d27f96a8d440a879ac83aa8c54] | committer: Thomas Guillem

tospdif: fix samples count

Include padded samples too.

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

 modules/audio_filter/converter/tospdif.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/modules/audio_filter/converter/tospdif.c b/modules/audio_filter/converter/tospdif.c
index 8f3ad4d..a0b3572 100644
--- a/modules/audio_filter/converter/tospdif.c
+++ b/modules/audio_filter/converter/tospdif.c
@@ -204,7 +204,6 @@ static void Flush( filter_t *p_filter )
 static block_t *fill_output_buffer( filter_t *p_filter, struct hdr_res *p_res )
 {
     filter_sys_t *p_sys = p_filter->p_sys;
-    unsigned i_nb_samples = 0;
     size_t i_out_size = 0;
     block_t *p_list = p_sys->p_chain_first;
 
@@ -213,7 +212,6 @@ static block_t *fill_output_buffer( filter_t *p_filter, struct hdr_res *p_res )
     while( p_list )
     {
         i_out_size += p_list->i_buffer;
-        i_nb_samples += p_list->i_nb_samples;
         p_list = p_list->p_next;
     }
 
@@ -274,8 +272,8 @@ static block_t *fill_output_buffer( filter_t *p_filter, struct hdr_res *p_res )
 
     p_out_buf->i_dts = p_sys->p_chain_first->i_dts;
     p_out_buf->i_pts = p_sys->p_chain_first->i_pts;
-    p_out_buf->i_nb_samples = i_nb_samples;
     p_out_buf->i_buffer = p_res->i_out_size_padded;
+    p_out_buf->i_nb_samples = p_out_buf->i_buffer / 4;
 
     return p_out_buf;
 }



More information about the vlc-commits mailing list