[vlc-commits] codec: faad: flush buffer on decoder flush

Francois Cartegnie git at videolan.org
Thu Feb 23 20:51:27 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Feb 23 18:32:15 2017 +0100| [662b0e8eedd5a38b2a62ee79fabba88c8d4d2ee6] | committer: Francois Cartegnie

codec: faad: flush buffer on decoder flush

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

 modules/codec/faad.c | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/modules/codec/faad.c b/modules/codec/faad.c
index c0d27ee..c68c501 100644
--- a/modules/codec/faad.c
+++ b/modules/codec/faad.c
@@ -198,16 +198,6 @@ static int Open( vlc_object_t *p_this )
 }
 
 /*****************************************************************************
- * Flush:
- *****************************************************************************/
-static void Flush( decoder_t *p_dec )
-{
-    decoder_sys_t *p_sys = p_dec->p_sys;
-
-    date_Set( &p_sys->date, 0 );
-}
-
-/*****************************************************************************
  * FlushBuffer:
  *****************************************************************************/
 static void FlushBuffer( decoder_sys_t *p_sys, size_t i_used )
@@ -235,6 +225,17 @@ static void FlushBuffer( decoder_sys_t *p_sys, size_t i_used )
 }
 
 /*****************************************************************************
+ * Flush:
+ *****************************************************************************/
+static void Flush( decoder_t *p_dec )
+{
+    decoder_sys_t *p_sys = p_dec->p_sys;
+
+    date_Set( &p_sys->date, VLC_TS_INVALID );
+    FlushBuffer( p_sys, SIZE_MAX );
+}
+
+/*****************************************************************************
  * DecodeBlock:
  *****************************************************************************/
 static int DecodeBlock( decoder_t *p_dec, block_t *p_block )
@@ -400,8 +401,8 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block )
                 }
             }
 
-            /* Flush the buffer */
-            FlushBuffer( p_sys, SIZE_MAX );
+            Flush( p_dec );
+
             return VLCDEC_SUCCESS;
         }
 



More information about the vlc-commits mailing list