[vlc-commits] flac: reset decoder on end of stream (fixes #9298)

Tristan Matthews git at videolan.org
Wed Oct 1 13:31:49 CEST 2014


vlc/vlc-2.2 | branch: master | Tristan Matthews <tmatth at videolan.org> | Mon Sep 29 21:05:23 2014 -0400| [f0476f08b105e259bc22449cb3067a7e4fbbe418] | committer: Felix Paul Kühne

flac: reset decoder on end of stream (fixes #9298)

(cherry picked from commit 033cdd9009df398c3fedffd8b5c31655f60256e4)
Signed-off-by: Felix Paul Kühne <fkuehne at videolan.org>

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

 modules/codec/flac.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/modules/codec/flac.c b/modules/codec/flac.c
index f2e3cda..32ae7fb 100644
--- a/modules/codec/flac.c
+++ b/modules/codec/flac.c
@@ -526,10 +526,16 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
 
     /* If the decoder is in the "aborted" state,
      * FLAC__stream_decoder_process_single() won't return an error. */
-    if( FLAC__stream_decoder_get_state(p_dec->p_sys->p_flac)
-        == FLAC__STREAM_DECODER_ABORTED )
+    switch ( FLAC__stream_decoder_get_state(p_dec->p_sys->p_flac) )
     {
-        FLAC__stream_decoder_flush( p_dec->p_sys->p_flac );
+        case FLAC__STREAM_DECODER_ABORTED:
+            FLAC__stream_decoder_flush( p_dec->p_sys->p_flac );
+            break;
+        case FLAC__STREAM_DECODER_END_OF_STREAM:
+            FLAC__stream_decoder_reset( p_dec->p_sys->p_flac );
+            break;
+        default:
+            break;
     }
 
     block_Release( p_sys->p_block );



More information about the vlc-commits mailing list