Commit cabc6567 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

RTP: use vlc_strerror_c()

parent cfc2e718
......@@ -30,6 +30,7 @@
#include <vlc_network.h>
#include <limits.h>
#include <errno.h>
#include <unistd.h>
#ifdef HAVE_POLL
# include <poll.h>
......@@ -136,7 +137,8 @@ void *rtp_dgram_thread (void *opaque)
}
else
{
msg_Warn (demux, "RTP network error: %m");
msg_Warn (demux, "RTP network error: %s",
vlc_strerror_c(errno));
block_Release (block);
}
}
......
......@@ -26,7 +26,6 @@
#endif
#include <stdarg.h>
#include <assert.h>
#include <errno.h>
#include <vlc_common.h>
#include <vlc_demux.h>
......@@ -290,12 +289,13 @@ static int Open (vlc_object_t *obj)
}
char *salt = var_CreateGetNonEmptyString (demux, "srtp-salt");
errno = srtp_setkeystring (p_sys->srtp, key, salt ? salt : "");
int val = srtp_setkeystring (p_sys->srtp, key, salt ? salt : "");
free (salt);
free (key);
if (errno)
if (val)
{
msg_Err (obj, "bad SRTP key/salt combination (%m)");
msg_Err (obj, "bad SRTP key/salt combination (%s)",
vlc_strerror_c(val));
goto error;
}
}
......
......@@ -1039,12 +1039,13 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
}
char *salt = var_GetNonEmptyString (p_stream, SOUT_CFG_PREFIX"salt");
errno = srtp_setkeystring (id->srtp, key, salt ? salt : "");
int val = srtp_setkeystring (id->srtp, key, salt ? salt : "");
free (salt);
free (key);
if (errno)
if (val)
{
msg_Err (p_stream, "bad SRTP key/salt combination (%m)");
msg_Err (p_stream, "bad SRTP key/salt combination (%s)",
vlc_strerror_c(val));
goto error;
}
id->i_sequence = 0; /* FIXME: awful hack for libvlc_srtp */
......@@ -1329,8 +1330,8 @@ static int FileSetup( sout_stream_t *p_stream )
if( ( f = vlc_fopen( p_sys->psz_sdp_file, "wt" ) ) == NULL )
{
msg_Err( p_stream, "cannot open file '%s' (%m)",
p_sys->psz_sdp_file );
msg_Err( p_stream, "cannot open file '%s' (%s)",
p_sys->psz_sdp_file, vlc_strerror_c(errno) );
return VLC_EGENERIC;
}
......@@ -1421,8 +1422,8 @@ static void* ThreadSend( void *data )
vlc_restorecancel (canc);
if( val )
{
errno = val;
msg_Dbg( id->p_stream, "SRTP sending error: %m" );
msg_Dbg( id->p_stream, "SRTP sending error: %s",
vlc_strerror_c(val) );
block_Release( out );
out = NULL;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment