Skip to content
Snippets Groups Projects
Commit 67faec33 authored by Zhao Zhili's avatar Zhao Zhili Committed by Hugo Beauzée-Luyssen
Browse files

srt: initialize p_sys->sock to SRT_INVALID_SOCK


Otherwise the zero initialized p_sys->sock will be closed in
srt_schedule_reconnect().

(cherry picked from commit e452063d) (rebased)
rebased:
* 3.0 has vlc_mutex_destroy()

Signed-off-by: default avatarSteve Lhomme <robux4@ycbcr.xyz>
parent e010ae8e
No related branches found
No related tags found
No related merge requests found
......@@ -381,6 +381,7 @@ static int Open(vlc_object_t *p_this)
msg_Err( p_stream, "Failed to create poll id for SRT socket." );
goto failed;
}
p_sys->sock = SRT_INVALID_SOCK;
if ( !srt_schedule_reconnect( p_stream ) )
{
......@@ -397,7 +398,7 @@ static int Open(vlc_object_t *p_this)
failed:
vlc_mutex_destroy( &p_sys->lock );
if ( p_sys->sock != -1 ) srt_close( p_sys->sock );
if ( p_sys->sock != SRT_INVALID_SOCK ) srt_close( p_sys->sock );
if ( p_sys->i_poll_id != -1 ) srt_epoll_release( p_sys->i_poll_id );
srt_cleanup();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment