[vlc-commits] au: check ES just once
Rémi Denis-Courmont
git at videolan.org
Thu May 3 10:52:56 CEST 2018
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu May 3 11:52:13 2018 +0300| [4ad6e859c6cac4fc402eaa025412fa8b201d3b3c] | committer: Rémi Denis-Courmont
au: check ES just once
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4ad6e859c6cac4fc402eaa025412fa8b201d3b3c
---
modules/demux/au.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/modules/demux/au.c b/modules/demux/au.c
index ed34ee8ebe..fd6db8abe3 100644
--- a/modules/demux/au.c
+++ b/modules/demux/au.c
@@ -273,6 +273,8 @@ static int Open( vlc_object_t *p_this )
/* add the es */
p_sys->es = es_out_Add( p_demux->out, &p_sys->fmt );
+ if( unlikely(p_sys->es == NULL) )
+ return VLC_ENOMEM;
/* calculate 50ms frame size/time */
unsigned i_samples = __MAX( p_sys->fmt.audio.i_rate / 20, 1 );
@@ -318,11 +320,7 @@ static int Demux( demux_t *p_demux )
p_block->i_dts =
p_block->i_pts = VLC_TS_0 + p_sys->i_time;
-
- if( p_sys->es )
- es_out_Send( p_demux->out, p_sys->es, p_block );
- else
- block_Release( p_block );
+ es_out_Send( p_demux->out, p_sys->es, p_block );
p_sys->i_time += p_sys->i_frame_length;
More information about the vlc-commits
mailing list