Updated for changes to the return code of EncodeFrame.