FFMS2: Add a missing function the updated matroska parser expects

Originally committed to SVN as r2890.
This commit is contained in:
Fredrik Mellbin 2009-05-01 16:58:15 +00:00
parent 35cea05304
commit 94cf1e4c22
2 changed files with 19 additions and 7 deletions

View file

@ -98,6 +98,15 @@ int StdIoProgress(StdIoStream *st, ulonglong cur, ulonglong max) {
return 1;
}
longlong StdIoGetFileSize(StdIoStream *st) {
longlong epos = 0;
longlong cpos = _ftelli64(st->fp);
_fseeki64(st->fp, 0, SEEK_END);
epos = _ftelli64(st->fp);
_fseeki64(st->fp, cpos, SEEK_SET);
return epos;
}
void InitStdIoStream(StdIoStream *st) {
memset(st,0,sizeof(st));
st->base.read = StdIoRead;
@ -108,4 +117,5 @@ void InitStdIoStream(StdIoStream *st) {
st->base.memrealloc = StdIoRealloc;
st->base.memfree = StdIoFree;
st->base.progress = StdIoProgress;
st->base.getfilesize = StdIoGetFileSize;
}

View file

@ -75,6 +75,8 @@ void StdIoFree(StdIoStream *st, void *mem);
*/
int StdIoProgress(StdIoStream *st, ulonglong cur, ulonglong max);
longlong StdIoGetFileSize(StdIoStream *st);
void InitStdIoStream(StdIoStream *st);
#endif /* #ifndef STDIOSTREAM_H */