From bb9695a2473b01da0f52ac92f5fc3a44d64d6956 Mon Sep 17 00:00:00 2001 From: Dw9 <36155473+Dw9@users.noreply.github.com> Date: Tue, 26 Oct 2021 20:35:55 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3win32=E4=B8=8B=E5=A4=A7?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=82=B9=E6=92=AD=E4=B8=8D=E4=BA=86=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20(#1188)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Record/MP4.cpp | 8 ++++---- src/Record/MP4.h | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Record/MP4.cpp b/src/Record/MP4.cpp index b4919222..3926e01a 100644 --- a/src/Record/MP4.cpp +++ b/src/Record/MP4.cpp @@ -200,11 +200,11 @@ int MP4FileDisk::onWrite(const void *data, size_t bytes) { return bytes == fwrite(data, 1, bytes, _file.get()) ? 0 : ferror(_file.get()); } -int MP4FileDisk::onSeek(size_t offset) { +int MP4FileDisk::onSeek(uint64_t offset) { return fseek64(_file.get(), offset, SEEK_SET); } -size_t MP4FileDisk::onTell() { +uint64_t MP4FileDisk::onTell() { return ftell64(_file.get()); } @@ -221,11 +221,11 @@ size_t MP4FileMemory::fileSize() const{ return _memory.size(); } -size_t MP4FileMemory::onTell(){ +uint64_t MP4FileMemory::onTell(){ return _offset; } -int MP4FileMemory::onSeek(size_t offset){ +int MP4FileMemory::onSeek(uint64_t offset){ if (offset > _memory.size()) { return -1; } diff --git a/src/Record/MP4.h b/src/Record/MP4.h index 3d01ce88..a17619c1 100644 --- a/src/Record/MP4.h +++ b/src/Record/MP4.h @@ -62,14 +62,14 @@ public: /** * 获取文件读写位置 */ - virtual size_t onTell() = 0; + virtual uint64_t onTell() = 0; /** * seek至文件某处 * @param offset 文件偏移量 * @return 是否成功(0成功) */ - virtual int onSeek(size_t offset) = 0; + virtual int onSeek(uint64_t offset) = 0; /** * 从文件读取一定数据 @@ -108,8 +108,8 @@ public: void closeFile(); protected: - size_t onTell() override; - int onSeek(size_t offset) override; + uint64_t onTell() override; + int onSeek(uint64_t offset) override; int onRead(void *data, size_t bytes) override; int onWrite(const void *data, size_t bytes) override; @@ -134,13 +134,13 @@ public: string getAndClearMemory(); protected: - size_t onTell() override; - int onSeek(size_t offset) override; + uint64_t onTell() override; + int onSeek(uint64_t offset) override; int onRead(void *data, size_t bytes) override; int onWrite(const void *data, size_t bytes) override; private: - size_t _offset = 0; + uint64_t _offset = 0; string _memory; };