1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Merge SRS2 for running srs-librtmp on Windows. 3.0.80

This commit is contained in:
winlin 2019-12-23 21:09:00 +08:00
commit 40f6ecaee2
13 changed files with 110 additions and 38 deletions

View file

@ -129,7 +129,11 @@ srs_error_t SrsFileWriter::write(void* buf, size_t count, ssize_t* pnwrite)
ssize_t nwrite;
// TODO: FIXME: use st_write.
#ifdef _WIN32
if ((nwrite = ::_write(fd, buf, (unsigned int)count)) < 0) {
#else
if ((nwrite = _srs_write_fn(fd, buf, count)) < 0) {
#endif
return srs_error_new(ERROR_SYSTEM_FILE_WRITE, "write to file %s failed", path.c_str());
}
@ -269,7 +273,11 @@ srs_error_t SrsFileReader::read(void* buf, size_t count, ssize_t* pnread)
ssize_t nread;
// TODO: FIXME: use st_read.
#ifdef _WIN32
if ((nread = _read(fd, buf, (unsigned int)count)) < 0) {
#else
if ((nread = _srs_read_fn(fd, buf, count)) < 0) {
#endif
return srs_error_new(ERROR_SYSTEM_FILE_READ, "read from file %s failed", path.c_str());
}

View file

@ -572,7 +572,7 @@ int srs_do_create_dir_recursively(string dir)
mode_t mode = S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IWGRP|S_IXGRP|S_IROTH|S_IXOTH;
if (::mkdir(dir.c_str(), mode) < 0) {
#else
if (::mkdir(dir.c_str()) < 0) {
if (::_mkdir(dir.c_str()) < 0) {
#endif
if (errno == EEXIST) {
return ERROR_SYSTEM_DIR_EXISTS;
@ -1102,9 +1102,9 @@ int srs_chunk_header_c0(int perfer_cid, uint32_t timestamp, int32_t payload_leng
*p++ = pp[1];
*p++ = pp[0];
} else {
*p++ = 0xFF;
*p++ = 0xFF;
*p++ = 0xFF;
*p++ = (char)0xFF;
*p++ = (char)0xFF;
*p++ = (char)0xFF;
}
// message_length, 3bytes, big-endian