From 014e758361b699577f5ce13bcfac1974c8596ef2 Mon Sep 17 00:00:00 2001 From: Mahyar Koshkouei Date: Mon, 8 Jan 2018 10:50:37 +0000 Subject: [PATCH] Don't stop on hwdec failure Some platforms may not support harware decoding, unsure if this would mean that the hwdec option string would no longer work but falling back to software decode shouldn't be an issue. Signed-off-by: Mahyar Koshkouei --- mpv-libretro.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/mpv-libretro.c b/mpv-libretro.c index 57ecaa5..48b8549 100644 --- a/mpv-libretro.c +++ b/mpv-libretro.c @@ -210,10 +210,7 @@ static void context_reset(void) } if(mpv_set_option_string(mpv, "hwdec", "auto") < 0) - { - log_cb(RETRO_LOG_ERROR, "failed to enable hwdec"); - return; - } + log_cb(RETRO_LOG_ERROR, "failed to set hwdec option"); if(mpv_command(mpv, cmd) != 0) { @@ -221,14 +218,14 @@ static void context_reset(void) return; } - /* Keep trying until mpv accepts the property. - * This is done to seek to the point in the file after the previous context - * was destroyed. If now context was destroyed previously, the file seeks - * to 0. + /* Keep trying until mpv accepts the property. This is done to seek to the + * point in the file after the previous context was destroyed. If no + * context was destroyed previously, the file seeks to 0. * * This also seems to fix some black screen issues. */ - while(mpv_set_property(mpv, "playback-time", MPV_FORMAT_INT64, &playback_time) < 0) + while(mpv_set_property(mpv, + "playback-time", MPV_FORMAT_INT64, &playback_time) < 0) {} log_cb(RETRO_LOG_INFO, "Context reset.\n");