Improved detection of missing audio frames, and missing video frames. Also improved logic for giving up on missing frames in general. Also removed some deadlocks related to Seeking (Close() and Open() were deadlocking). The end result is much improved compatability with reading video files.

This commit is contained in:
Jonathan Thomas
2016-06-29 02:42:00 -05:00
parent 4808be25ff
commit 92a9db2aa3
5 changed files with 164 additions and 60 deletions

View File

@@ -430,8 +430,10 @@ int64 Frame::GetBytes()
int64 total_bytes = 0;
if (image)
total_bytes += (width * height * sizeof(char) * 4);
if (audio)
total_bytes += (audio->getNumSamples() * audio->getNumChannels() * sizeof(float));
if (audio) {
// approximate audio size (sample rate / 24 fps)
total_bytes += (sample_rate / 24.0) * sizeof(float);
}
// return size of this frame
return total_bytes;