fixed the ffmpegsource indexing progress dialog to work with files larger than 4gb.

Originally committed to SVN as r2330.
This commit is contained in:
Karl Blomster 2008-09-07 19:15:12 +00:00
parent ff6876b412
commit e702d9edca

View file

@ -190,8 +190,9 @@ void FFmpegSourceVideoProvider::Close() {
if (VideoSource) if (VideoSource)
FFMS_DestroyVideoSource(VideoSource); FFMS_DestroyVideoSource(VideoSource);
VideoSource = NULL; VideoSource = NULL;
if (FrameAllocated) // this seems to cause a heap corruption in debug mode
avpicture_free(&FrameRGB); /* if (FrameAllocated)
avpicture_free(&FrameRGB); */
FrameAllocated = false; FrameAllocated = false;
if (BufferRGB) if (BufferRGB)
delete BufferRGB; delete BufferRGB;
@ -206,14 +207,14 @@ void FFmpegSourceVideoProvider::Close() {
// Update indexing progress // Update indexing progress
int __stdcall FFmpegSourceVideoProvider::UpdateIndexingProgress(int State, int64_t Current, int64_t Total, void *Private) { int __stdcall FFmpegSourceVideoProvider::UpdateIndexingProgress(int State, int64_t Current, int64_t Total, void *Private) {
IndexingProgressDialog *Progress = (IndexingProgressDialog *)Private; IndexingProgressDialog *Progress = (IndexingProgressDialog *)Private;
Progress->ProgressDialog->SetProgress(Current, Total);
if (Progress->IndexingCanceled) { if (Progress->IndexingCanceled)
// Close();
return 1; return 1;
} else {
return 0; // noone cares about a little bit of a rounding error here anyway
} Progress->ProgressDialog->SetProgress((1000*Current)/Total, 1000);
return 0;
} }
/////////////// ///////////////