winlin

remove lseek and size of fs stream

... ... @@ -129,17 +129,6 @@ int SrsFileStream::write(void* buf, size_t count, ssize_t* pnwrite)
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()
{
_fs = NULL;
... ... @@ -164,9 +153,6 @@ int SrsFlvEncoder::write_header()
{
int ret = ERROR_SUCCESS;
// seek to header.
_fs->lseek(0);
static char flv_header[] = {
'F', 'L', 'V', // Signatures "FLV"
(char)0x01, // File version (for example, 0x01 for FLV version 1)
... ...
... ... @@ -60,15 +60,6 @@ public:
* @param pnwrite, return the write size. NULL to ignore.
*/
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);
};
/**
... ...