[vlc-devel] [PATCH 2/9] demux: mkv: use vlc_demux.h return codes

Steve Lhomme robux4 at ycbcr.xyz
Mon Jul 16 11:46:58 CEST 2018


I would prefer this patch to come first with all replacements and then 
1/9 explaining why the change in behaviour.


On 2018-07-16 5:19, Filip Roséen wrote:
> ---
>   modules/demux/mkv/mkv.cpp | 14 +++++++-------
>   1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
> index 7e1b49a28d..407bc50013 100644
> --- a/modules/demux/mkv/mkv.cpp
> +++ b/modules/demux/mkv/mkv.cpp
> @@ -711,13 +711,13 @@ static int Demux( demux_t *p_demux)
>       if( p_sys->i_pts >= p_sys->i_start_pts )
>       {
>           if ( p_vsegment->UpdateCurrentToChapter( *p_demux ) )
> -            return 1;
> +            return VLC_DEMUXER_SUCCESS;
>           p_vsegment = p_sys->p_current_vsegment;
>       }
>   
>       matroska_segment_c *p_segment = p_vsegment->CurrentSegment();
>       if ( p_segment == NULL )
> -        return 0;
> +        return VLC_DEMUXER_EOF;
>   
>       KaxBlock *block;
>       KaxSimpleBlock *simpleblock;
> @@ -738,12 +738,12 @@ static int Demux( demux_t *p_demux)
>                   p_sys->i_pts = p_chap->i_mk_virtual_stop_time + VLC_TICK_0;
>                   p_sys->i_pts++; // trick to avoid staying on segments with no duration and no content
>   
> -                return 1;
> +                return VLC_DEMUXER_SUCCESS;
>               }
>           }
>   
>           msg_Warn( p_demux, "cannot get block EOF?" );
> -        return 0;
> +        return VLC_DEMUXER_EOF;
>       }
>   
>       {
> @@ -769,7 +769,7 @@ static int Demux( demux_t *p_demux)
>               if ( track.i_skip_until_fpos > block_fpos )
>               {
>                   delete block;
> -                return 1; // this block shall be ignored
> +                return VLC_DEMUXER_SUCCESS; // this block shall be ignored
>               }
>           }
>       }
> @@ -822,14 +822,14 @@ static int Demux( demux_t *p_demux)
>       {
>           /* nothing left to read in this ordered edition */
>           delete block;
> -        return 0;
> +        return VLC_DEMUXER_EOF;
>       }
>   
>       BlockDecode( p_demux, block, simpleblock, p_sys->i_pts, i_block_duration, b_key_picture, b_discardable_picture );
>   
>       delete block;
>   
> -    return 1;
> +    return VLC_DEMUXER_SUCCESS;
>   }
>   
>   mkv_track_t::mkv_track_t(enum es_format_category_e es_cat) :
> -- 
> 2.18.0
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel



More information about the vlc-devel mailing list