[vlc-commits] demux: nsv: check es
Francois Cartegnie
git at videolan.org
Thu May 3 10:14:03 CEST 2018
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed May 2 19:01:53 2018 +0200| [3a8926f4a826825742c03f8236313c70a79c6f98] | committer: Francois Cartegnie
demux: nsv: check es
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3a8926f4a826825742c03f8236313c70a79c6f98
---
modules/demux/nsv.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/modules/demux/nsv.c b/modules/demux/nsv.c
index 6be73fdacc..e312674fef 100644
--- a/modules/demux/nsv.c
+++ b/modules/demux/nsv.c
@@ -236,7 +236,8 @@ static int Demux( demux_t *p_demux )
{
p_sys->fmt_sub.i_codec = VLC_FOURCC( 's', 'u', 'b', 't' );
p_sys->p_sub = es_out_Add( p_demux->out, &p_sys->fmt_sub );
- es_out_Control( p_demux->out, ES_OUT_SET_ES, p_sys->p_sub );
+ if( p_sys->p_sub )
+ es_out_Control( p_demux->out, ES_OUT_SET_ES, p_sys->p_sub );
}
if( vlc_stream_Read( p_demux->s, NULL, 2 ) < 2 )
return VLC_DEMUXER_EOF;
@@ -259,7 +260,10 @@ static int Demux( demux_t *p_demux )
p_frame->i_pts = VLC_TS_0 + p_sys->i_pcr;
p_frame->i_dts = VLC_TS_0 + p_sys->i_pcr + 4000000; /* 4s */
- es_out_Send( p_demux->out, p_sys->p_sub, p_frame );
+ if( p_sys->p_sub )
+ es_out_Send( p_demux->out, p_sys->p_sub, p_frame );
+ else
+ block_Release( p_frame );
}
}
else
More information about the vlc-commits
mailing list