Internal change PiperOrigin-RevId: 154182244 Change-Id: If58ea713813fafc5396fdc70d85c55804e9fef97
diff --git a/src/mp4file.cpp b/src/mp4file.cpp index 73772a7..217e388 100644 --- a/src/mp4file.cpp +++ b/src/mp4file.cpp
@@ -417,8 +417,7 @@ void MP4File::ReadFromFile() { - // ensure we start at beginning of file or at specified seek offset. - SetPosition(m_initialSeekOffset); + SetPosition(0); // create a new root atom ASSERT(m_pRootAtom == NULL);
diff --git a/src/mp4file_io.cpp b/src/mp4file_io.cpp index d16d87f..acbc3d2 100644 --- a/src/mp4file_io.cpp +++ b/src/mp4file_io.cpp
@@ -37,7 +37,7 @@ file = m_file; ASSERT( file ); - return file->position; + return file->position - m_initialSeekOffset; } void MP4File::SetPosition( uint64_t pos, File* file ) @@ -53,7 +53,7 @@ file = m_file; ASSERT( file ); - if( file->seek( pos )) + if( file->seek( pos + m_initialSeekOffset)) throw new PlatformException( "seek failed", sys::getLastError(), __FILE__, __LINE__, __FUNCTION__ ); } @@ -66,7 +66,7 @@ file = m_file; ASSERT( file ); - return file->size; + return file->size - m_initialSeekOffset; } void MP4File::ReadBytes( uint8_t* buf, uint32_t bufsiz, File* file )