[vlc-commits] demux: mjpeg: use VLC_DEMUXER_

Francois Cartegnie git at videolan.org
Thu May 3 10:13:56 CEST 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed May  2 17:49:51 2018 +0200| [bc0f72013d2f48337ef36452579a3cd304b071ba] | committer: Francois Cartegnie

demux: mjpeg: use VLC_DEMUXER_

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

 modules/demux/mjpeg.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/modules/demux/mjpeg.c b/modules/demux/mjpeg.c
index cb7096356e..8b0ef8283f 100644
--- a/modules/demux/mjpeg.c
+++ b/modules/demux/mjpeg.c
@@ -265,7 +265,7 @@ static int SendBlock( demux_t *p_demux, int i )
     if( ( p_block = vlc_stream_Block( p_demux->s, i ) ) == NULL )
     {
         msg_Warn( p_demux, "cannot read data" );
-        return 0;
+        return VLC_DEMUXER_EOF;
     }
 
     if( p_sys->i_frame_length )
@@ -286,7 +286,7 @@ static int SendBlock( demux_t *p_demux, int i )
     if( p_sys->b_still )
         p_sys->i_still_end = mdate() + p_sys->i_frame_length;
 
-    return 1;
+    return VLC_DEMUXER_SUCCESS;
 }
 
 /*****************************************************************************
@@ -409,18 +409,18 @@ static int MjpgDemux( demux_t *p_demux )
         /* Still frame, wait until the pause delay is gone */
         mwait( p_sys->i_still_end );
         p_sys->i_still_end = 0;
-        return 1;
+        return VLC_DEMUXER_SUCCESS;
     }
 
     if( !Peek( p_demux, true ) )
     {
         msg_Warn( p_demux, "cannot peek data" );
-        return 0;
+        return VLC_DEMUXER_EOF;
     }
     if( p_sys->i_data_peeked < 4 )
     {
         msg_Warn( p_demux, "data shortage" );
-        return 0;
+        return VLC_DEMUXER_EOF;
     }
     i = 3;
 FIND_NEXT_EOI:
@@ -439,7 +439,7 @@ FIND_NEXT_EOI:
             if( !Peek( p_demux, false ) )
             {
                 msg_Warn( p_demux, "no more data is available at the moment" );
-                return 0;
+                return VLC_DEMUXER_EOF;
             }
         }
     }
@@ -463,11 +463,11 @@ static int MimeDemux( demux_t *p_demux )
     if( i_size > 0 )
     {
         if( vlc_stream_Read( p_demux->s, NULL, i_size ) != i_size )
-            return 0;
+            return VLC_DEMUXER_EOF;
     }
     else if( i_size < 0 )
     {
-        return 0;
+        return VLC_DEMUXER_EOF;
     }
     else
     {
@@ -478,7 +478,7 @@ static int MimeDemux( demux_t *p_demux )
     if( !Peek( p_demux, true ) )
     {
         msg_Warn( p_demux, "cannot peek data" );
-        return 0;
+        return VLC_DEMUXER_EOF;
     }
 
     i = 0;
@@ -486,7 +486,7 @@ static int MimeDemux( demux_t *p_demux )
     if( p_sys->i_data_peeked < i_size )
     {
         msg_Warn( p_demux, "data shortage" );
-        return 0;
+        return VLC_DEMUXER_EOF;
     }
 
     for( ;; )
@@ -504,7 +504,7 @@ static int MimeDemux( demux_t *p_demux )
                 {
                     msg_Warn( p_demux, "no more data is available at the "
                               "moment" );
-                    return 0;
+                    return VLC_DEMUXER_EOF;
                 }
             }
         }
@@ -527,7 +527,7 @@ static int MimeDemux( demux_t *p_demux )
     if( !b_match )
     {
         msg_Err( p_demux, "discard non-JPEG part" );
-        return 0;
+        return VLC_DEMUXER_EOF;
     }
 
     return SendBlock( p_demux, i );



More information about the vlc-commits mailing list