[vlc-commits] Revert "flac packetizer: use the largest possible frame size"

Rafaël Carré git at videolan.org
Sun Nov 17 16:18:58 CET 2013


vlc/vlc-2.1 | branch: master | Rafaël Carré <funman at videolan.org> | Fri Nov 15 15:25:48 2013 +0100| [78cb619963134753cbfa655d135e811db2166d03] | committer: Jean-Baptiste Kempf

Revert "flac packetizer: use the largest possible frame size"

This reverts commit 03e0644c82bf1dea96f8ade8829c2e1f360bd1ee.

Decoder needs single frames

Closes #9863

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

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

 modules/packetizer/flac.c |   25 ++++---------------------
 1 file changed, 4 insertions(+), 21 deletions(-)

diff --git a/modules/packetizer/flac.c b/modules/packetizer/flac.c
index 16d3c46..090b601 100644
--- a/modules/packetizer/flac.c
+++ b/modules/packetizer/flac.c
@@ -248,7 +248,6 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
 
     while( 1 )
     {
-        int previous_size;
         switch( p_sys->i_state )
         {
         case STATE_NOSYNC:
@@ -316,8 +315,6 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
             /* TODO: If pp_block == NULL, flush the buffer without checking the
              * next sync word */
 
-            previous_size = 0; /* Try to return the biggest frame */
-
             /* Check if next expected frame contains the sync word */
             while( block_PeekOffsetBytes( &p_sys->bytestream,
                                           p_sys->i_frame_size, p_header,
@@ -333,27 +330,13 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
                                   &p_sys->i_rate,
                                   &p_sys->i_bits_per_sample );
 
-                    if( i_frame_length ) {
-                        if( !p_sys->b_stream_info || p_sys->stream_info.max_framesize <= 0 ) {
-                            /* Stop immediately if we don't know the maximum framesize */
-                            p_sys->i_state = STATE_SEND_DATA;
-                            break;
-                        }
-                        previous_size = p_sys->i_frame_size;
+                    if( i_frame_length )
+                    {
+                        p_sys->i_state = STATE_SEND_DATA;
+                        break;
                     }
                 }
                 p_sys->i_frame_size++;
-
-                if( p_sys->b_stream_info && p_sys->stream_info.max_framesize > 0 &&
-                    p_sys->i_frame_size > p_sys->stream_info.max_framesize )
-                    break;
-            }
-
-            if (previous_size)
-            {
-                /* Use the largest frame size */
-                p_sys->i_frame_size = previous_size;
-                p_sys->i_state = STATE_SEND_DATA;
             }
 
             if( p_sys->i_state != STATE_SEND_DATA )



More information about the vlc-commits mailing list