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());
}