Hopefully fix crash when the same frame is encoded twice.