From d77a9244346adadd283a48ee55adebd5f8e37478 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 7 Sep 2013 19:59:39 +0200 Subject: command: remove some unneeded code chapter_display_name() always returns something. The "chapter < -1" check is not needed, because this is done at the start of the function. --- mpvcore/command.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'mpvcore') diff --git a/mpvcore/command.c b/mpvcore/command.c index 3834f4ed30..fa2bbf963c 100644 --- a/mpvcore/command.c +++ b/mpvcore/command.c @@ -389,10 +389,7 @@ static int mp_property_chapter(m_option_t *prop, int action, void *arg, *(int *) arg = chapter; return M_PROPERTY_OK; case M_PROPERTY_PRINT: { - char *chapter_name = chapter_display_name(mpctx, chapter); - if (!chapter_name) - return M_PROPERTY_UNAVAILABLE; - *(char **) arg = chapter_name; + *(char **) arg = chapter_display_name(mpctx, chapter); return M_PROPERTY_OK; } case M_PROPERTY_SWITCH: @@ -403,8 +400,6 @@ static int mp_property_chapter(m_option_t *prop, int action, void *arg, step_all = ROUND(sarg->inc); // Check threshold for relative backward seeks if (mpctx->opts->chapter_seek_threshold >= 0 && step_all < 0) { - if (chapter < -1) - return M_PROPERTY_UNAVAILABLE; double current_chapter_start = chapter_start_time(mpctx, chapter); // If we are far enough into a chapter, seek back to the -- cgit v1.2.3