Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support reading mp4 container structure from file offset #6

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update mp4file_io.cpp
grundman authored Apr 25, 2017
commit 17a39e6d82d453c324fb4fe0673a4a043a9eea99
6 changes: 3 additions & 3 deletions src/mp4file_io.cpp
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@ uint64_t MP4File::GetPosition( File* file )
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 @@ void MP4File::SetPosition( uint64_t pos, File* file )
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 @@ uint64_t MP4File::GetSize( File* file )
file = m_file;

ASSERT( file );
return file->size;
return file->size - m_initialSeekOffset;
}

void MP4File::ReadBytes( uint8_t* buf, uint32_t bufsiz, File* file )