winlin

remove lseek and size of fs stream

@@ -129,17 +129,6 @@ int SrsFileStream::write(void* buf, size_t count, ssize_t* pnwrite) @@ -129,17 +129,6 @@ int SrsFileStream::write(void* buf, size_t count, ssize_t* pnwrite)
129 return ret; 129 return ret;
130 } 130 }
131 131
132 -int64_t SrsFileStream::size()  
133 -{  
134 - ::lseek(fd, 0, SEEK_SET);  
135 - return ::lseek(fd, 0, SEEK_END);  
136 -}  
137 -  
138 -off_t SrsFileStream::lseek(off_t offset)  
139 -{  
140 - return ::lseek(fd, offset, SEEK_SET);  
141 -}  
142 -  
143 SrsFlvEncoder::SrsFlvEncoder() 132 SrsFlvEncoder::SrsFlvEncoder()
144 { 133 {
145 _fs = NULL; 134 _fs = NULL;
@@ -164,9 +153,6 @@ int SrsFlvEncoder::write_header() @@ -164,9 +153,6 @@ int SrsFlvEncoder::write_header()
164 { 153 {
165 int ret = ERROR_SUCCESS; 154 int ret = ERROR_SUCCESS;
166 155
167 - // seek to header.  
168 - _fs->lseek(0);  
169 -  
170 static char flv_header[] = { 156 static char flv_header[] = {
171 'F', 'L', 'V', // Signatures "FLV" 157 'F', 'L', 'V', // Signatures "FLV"
172 (char)0x01, // File version (for example, 0x01 for FLV version 1) 158 (char)0x01, // File version (for example, 0x01 for FLV version 1)
@@ -60,15 +60,6 @@ public: @@ -60,15 +60,6 @@ public:
60 * @param pnwrite, return the write size. NULL to ignore. 60 * @param pnwrite, return the write size. NULL to ignore.
61 */ 61 */
62 virtual int write(void* buf, size_t count, ssize_t* pnwrite); 62 virtual int write(void* buf, size_t count, ssize_t* pnwrite);
63 -public:  
64 - /**  
65 - * get size of file.  
66 - */  
67 - virtual int64_t size();  
68 - /**  
69 - * wrapper for system lseek where whence always use SEEK_SET  
70 - */  
71 - virtual off_t lseek(off_t offset);  
72 }; 63 };
73 64
74 /** 65 /**