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