wang-bin / mdk-braw

blackmagic raw plugin for libmdk https://github.com/wang-bin/mdk-sdk used by gyroflow
MIT License
1 stars 0 forks source link

corrupted file error handling #2

Open wang-bin opened 11 months ago

wang-bin commented 11 months ago

when the BRAW SDK returns an error, MDK doesn't seem to handle it well, it hangs instead of returning an empty frame or something recoverable

AdrianEddy commented 11 months ago

the issue is in MS_ENSURE(result); in ReadComplete. I was able to make it work correctly by replacing it with

if (FAILED(result)) {
    thread([=]{ frameAvailable(VideoFrame().setTimestamp(TimestampEOS)); }).detach();
    return;
}

but this doesn't seem right. Doing just frameAvailable without a thread makes it hang as well