[vlc-commits] [Git][videolan/vlc][master] 3 commits: es_out: remove temporary variable
Hugo Beauzée-Luyssen (@chouquette)
gitlab at videolan.org
Tue May 17 13:17:07 UTC 2022
Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC
Commits:
34362712 by Alexandre Janniaux at 2022-05-17T12:46:44+00:00
es_out: remove temporary variable
`ret = ` is longer than `if ()` so is not needed to reduce the line
length, and the return value is not used except as early return.
- - - - -
1ed33a1a by Alexandre Janniaux at 2022-05-17T12:46:44+00:00
es_out: remove useless condition
The opposite condition is already tested with an early return.
- - - - -
4ffbbcd1 by Alexandre Janniaux at 2022-05-17T12:46:44+00:00
es_out: remove trailing character
- - - - -
1 changed file:
- src/input/es_out.c
Changes:
=====================================
src/input/es_out.c
=====================================
@@ -2071,8 +2071,7 @@ static char *EsOutCreateStrId( es_out_id_t *es, bool stable, const char *id,
es_out_id_t *p_master )
{
struct vlc_memstream ms;
- int ret = vlc_memstream_open( &ms );
- if( ret != 0 )
+ if( vlc_memstream_open( &ms ) != 0 )
return NULL;
if( p_master )
@@ -2102,9 +2101,10 @@ static char *EsOutCreateStrId( es_out_id_t *es, bool stable, const char *id,
vlc_memstream_puts( &ms, "/auto" );
vlc_memstream_printf( &ms, "/%d", es->fmt.i_id );
- ret = vlc_memstream_close( &ms );
+ if( vlc_memstream_close( &ms ) != 0 )
+ return NULL;
- return ret == 0 ? ms.ptr : NULL;
+ return ms.ptr;
}
static es_out_id_t *EsOutAddLocked( es_out_t *out, input_source_t *source,
@@ -2171,8 +2171,7 @@ static es_out_id_t *EsOutAddLocked( es_out_t *out, input_source_t *source,
return NULL;
}
/* Increase ref count for program */
- if( p_pgrm )
- p_pgrm->i_es++;
+ p_pgrm->i_es++;
/* The group 0 is the default one and can be used by different contexts */
assert( fmt->i_group == 0 || p_pgrm->source == es->id.source );
@@ -2804,7 +2803,7 @@ static void EsOutSelectListFromProps( es_out_t *out, enum es_format_category_e c
/* EsOutIdMatchStrIds will modify str_ids */
strcpy( buffer, esprops->str_ids );
- if( !EsOutIdMatchStrIds( other, buffer ) && EsIsSelected( other ) )
+ if( !EsOutIdMatchStrIds( other, buffer ) && EsIsSelected( other ) )
EsOutUnselectEs( out, other, other->p_pgrm == p_sys->p_pgrm );
}
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/589c006ba99e4c3bf3f8f5ca8b86e345fa92b6e3...4ffbbcd1314722826f2afcad23d965af8407eb9e
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/589c006ba99e4c3bf3f8f5ca8b86e345fa92b6e3...4ffbbcd1314722826f2afcad23d965af8407eb9e
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list