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

remove lseek and size of fs stream

This commit is contained in:
winlin 2014-04-17 16:10:05 +08:00
parent 271b969d0b
commit 56ff70cdf8
2 changed files with 0 additions and 23 deletions

View file

@ -129,17 +129,6 @@ int SrsFileStream::write(void* buf, size_t count, ssize_t* pnwrite)
return ret; return ret;
} }
int64_t SrsFileStream::size()
{
::lseek(fd, 0, SEEK_SET);
return ::lseek(fd, 0, SEEK_END);
}
off_t SrsFileStream::lseek(off_t offset)
{
return ::lseek(fd, offset, SEEK_SET);
}
SrsFlvEncoder::SrsFlvEncoder() SrsFlvEncoder::SrsFlvEncoder()
{ {
_fs = NULL; _fs = NULL;
@ -164,9 +153,6 @@ int SrsFlvEncoder::write_header()
{ {
int ret = ERROR_SUCCESS; int ret = ERROR_SUCCESS;
// seek to header.
_fs->lseek(0);
static char flv_header[] = { static char flv_header[] = {
'F', 'L', 'V', // Signatures "FLV" 'F', 'L', 'V', // Signatures "FLV"
(char)0x01, // File version (for example, 0x01 for FLV version 1) (char)0x01, // File version (for example, 0x01 for FLV version 1)

View file

@ -60,15 +60,6 @@ public:
* @param pnwrite, return the write size. NULL to ignore. * @param pnwrite, return the write size. NULL to ignore.
*/ */
virtual int write(void* buf, size_t count, ssize_t* pnwrite); virtual int write(void* buf, size_t count, ssize_t* pnwrite);
public:
/**
* get size of file.
*/
virtual int64_t size();
/**
* wrapper for system lseek where whence always use SEEK_SET
*/
virtual off_t lseek(off_t offset);
}; };
/** /**