-
Notifications
You must be signed in to change notification settings - Fork 160
Description
I'm decoding individual H.264 GOPs and I'm finding that sometimes the decoder will not emit the last frame, and I'm not sure what I'm doing wrong. It's not a problem with the source data as the same GOP will work and then fail. I'm assuming it's something wrong with the way I'm using flush.
The GOPs are 25 frames long, and are closed.
I'm calling decode() for each sample in the GOP (so 25 times), then calling flush(). On each callback, I generate an imagebitmap from the videoframe, then call destroy on the videoframe.
Most of the time it all works OK, and my output callback is called 25 times. Occasionally, My callback is only called 24 times and the final frame is not emitted.
Can anyone think what I might be doing wrong? Or could this be a genuine issue?
I have found that I can apparently fix the issue by calling flush() every time my frame callback is called, which seems to add weight to my thought that this is a flush problem. The solution seems a bit expensive though.