[vlc-commits] packetizer: dts: fix endless loop (again)

Thomas Guillem git at videolan.org
Fri Jan 13 11:57:26 CET 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Jan 13 11:33:46 2017 +0100| [ce72ce94443d3389cca58b755be93f7146e3cd9b] | committer: Thomas Guillem

packetizer: dts: fix endless loop (again)

The "(Not useful if we went through NEXT_SYNC)" assumption is false.  If the
input is not packetized (like from demux/mpeg/es.c), nothing assure that we
have enough data.

see 1151319

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

 modules/packetizer/dts.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/modules/packetizer/dts.c b/modules/packetizer/dts.c
index 1bd9350..71ee2f9 100644
--- a/modules/packetizer/dts.c
+++ b/modules/packetizer/dts.c
@@ -240,13 +240,12 @@ static block_t *PacketizeBlock( decoder_t *p_dec, block_t **pp_block )
                     block_SkipByte( &p_sys->bytestream );
                     break;
                 }
-                p_sys->i_state = STATE_SEND_DATA;
+                p_sys->i_state = STATE_GET_DATA;
             }
             break;
 
         case STATE_GET_DATA:
-            /* Make sure we have enough data.
-             * (Not useful if we went through NEXT_SYNC) */
+            /* Make sure we have enough data. */
             if( block_WaitBytes( &p_sys->bytestream,
                                  p_sys->dts.i_frame_size ) != VLC_SUCCESS )
             {
@@ -259,8 +258,10 @@ static block_t *PacketizeBlock( decoder_t *p_dec, block_t **pp_block )
             if( p_sys->dts.b_substream  )
             {
                 /* FIXME: DTSHD is ignored for now */
-                block_SkipBytes( &p_sys->bytestream, p_sys->dts.i_frame_size );
                 p_sys->i_state = STATE_NOSYNC;
+                if( block_SkipBytes( &p_sys->bytestream,
+                                     p_sys->dts.i_frame_size ) != VLC_SUCCESS )
+                    return NULL;
                 break;
             }
 



More information about the vlc-commits mailing list