mirror of
https://github.com/ossrs/srs.git
synced 2025-02-15 04:42:04 +00:00
parent
0fe17c3e34
commit
01ed485cf3
4 changed files with 6 additions and 2 deletions
|
@ -690,6 +690,7 @@ int SrsServer::acquire_pid_file()
|
||||||
if(errno == EACCES || errno == EAGAIN) {
|
if(errno == EACCES || errno == EAGAIN) {
|
||||||
ret = ERROR_SYSTEM_PID_ALREADY_RUNNING;
|
ret = ERROR_SYSTEM_PID_ALREADY_RUNNING;
|
||||||
srs_error("srs is already running! ret=%#x", ret);
|
srs_error("srs is already running! ret=%#x", ret);
|
||||||
|
::close(fd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,6 +71,7 @@ int srs_socket_connect(string server, int port, int64_t timeout, st_netfd_t* pst
|
||||||
if(stfd == NULL){
|
if(stfd == NULL){
|
||||||
ret = ERROR_ST_OPEN_SOCKET;
|
ret = ERROR_ST_OPEN_SOCKET;
|
||||||
srs_error("st_netfd_open_socket failed. ret=%d", ret);
|
srs_error("st_netfd_open_socket failed. ret=%d", ret);
|
||||||
|
::close(sock);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,12 +95,14 @@ int srs_socket_connect(string server, int port, int64_t timeout, st_netfd_t* pst
|
||||||
srs_info("connect ok. server=%s, ip=%s, port=%d", server.c_str(), ip.c_str(), port);
|
srs_info("connect ok. server=%s, ip=%s, port=%d", server.c_str(), ip.c_str(), port);
|
||||||
|
|
||||||
*pstfd = stfd;
|
*pstfd = stfd;
|
||||||
|
::close(sock);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
failed:
|
failed:
|
||||||
if (stfd) {
|
if (stfd) {
|
||||||
srs_close_stfd(stfd);
|
srs_close_stfd(stfd);
|
||||||
}
|
}
|
||||||
|
::close(sock);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -169,7 +169,7 @@ string srs_codec_avc_level2str(SrsAvcLevel level)
|
||||||
// 1 = 11 kHz = 11025 Hz
|
// 1 = 11 kHz = 11025 Hz
|
||||||
// 2 = 22 kHz = 22050 Hz
|
// 2 = 22 kHz = 22050 Hz
|
||||||
// 3 = 44 kHz = 44100 Hz
|
// 3 = 44 kHz = 44100 Hz
|
||||||
int flv_sample_rates[] = {5512, 11025, 22050, 44100};
|
int flv_sample_rates[] = {5512, 11025, 22050, 44100, 0};
|
||||||
|
|
||||||
// the sample rates in the codec,
|
// the sample rates in the codec,
|
||||||
// in the sequence header.
|
// in the sequence header.
|
||||||
|
|
|
@ -652,7 +652,7 @@ int srs_av_base64_decode(u_int8_t* out, const char* in_str, int out_size)
|
||||||
// no sign extension
|
// no sign extension
|
||||||
const u_int8_t *in = (const u_int8_t*)in_str;
|
const u_int8_t *in = (const u_int8_t*)in_str;
|
||||||
unsigned bits = 0xff;
|
unsigned bits = 0xff;
|
||||||
unsigned v;
|
unsigned v = 0;
|
||||||
|
|
||||||
while (end - dst > 3) {
|
while (end - dst > 3) {
|
||||||
BASE64_DEC_STEP(0);
|
BASE64_DEC_STEP(0);
|
||||||
|
|
Loading…
Reference in a new issue