Signed-off-by: Mans Rullgard <mans@mansr.com> (cherry picked from commit 646739a0a8368bd234ff077c093bbf01e9e7f44a)