Fix error in handle_reset_event
Ported x264 encoder