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

Support build srs-librtmp by VS2015. 2.0.267

This commit is contained in:
winlin 2019-12-23 18:12:45 +08:00
parent 08bbbc5414
commit 01a4503ceb
7 changed files with 39 additions and 21 deletions

View file

@ -133,7 +133,11 @@ int SrsFileWriter::write(void* buf, size_t count, ssize_t* pnwrite)
ssize_t nwrite;
// TODO: FIXME: use st_write.
if ((nwrite = ::write(fd, buf, count)) < 0) {
#ifdef _WIN32
if ((nwrite = ::_write(fd, buf, (unsigned int)count)) < 0) {
#else
if ((nwrite = ::write(fd, buf, (size_t)count)) < 0) {
#endif
ret = ERROR_SYSTEM_FILE_WRITE;
srs_error("write to file %s failed. ret=%d", path.c_str(), ret);
return ret;
@ -250,7 +254,11 @@ int 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 = ::read(fd, buf, count)) < 0) {
#endif
ret = ERROR_SYSTEM_FILE_READ;
srs_error("read from file %s failed. ret=%d", path.c_str(), ret);
return ret;

View file

@ -430,7 +430,7 @@ bool srs_avc_startswith_annexb(SrsStream* stream, int* pnb_start_code)
char* p = bytes;
for (;;) {
if (!stream->require(p - bytes + 3)) {
if (!stream->require((int)(p - bytes + 3))) {
return false;
}
@ -721,7 +721,7 @@ out2:
*dst++ = v >> 4;
out1:
out0:
return bits & 1 ? -1 : dst - out;
return (int)(bits & 1 ? -1 : dst - out);
}
/*****************************************************************************
@ -881,7 +881,7 @@ int srs_chunk_header_c0(
}
// always has header
return p - cache;
return (int)(p - cache);
}
int srs_chunk_header_c3(
@ -931,6 +931,6 @@ int srs_chunk_header_c3(
}
// always has header
return p - cache;
return (int)(p - cache);
}