1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-22 19:34:14 +00:00

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.
This commit is contained in:
wm4 2013-09-07 19:59:39 +02:00
parent 494d408583
commit d77a924434

View File

@ -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