mirror of
https://github.com/mpv-player/mpv
synced 2025-04-09 19:22:05 +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:
parent
494d408583
commit
d77a924434
@ -389,10 +389,7 @@ static int mp_property_chapter(m_option_t *prop, int action, void *arg,
|
|||||||
*(int *) arg = chapter;
|
*(int *) arg = chapter;
|
||||||
return M_PROPERTY_OK;
|
return M_PROPERTY_OK;
|
||||||
case M_PROPERTY_PRINT: {
|
case M_PROPERTY_PRINT: {
|
||||||
char *chapter_name = chapter_display_name(mpctx, chapter);
|
*(char **) arg = chapter_display_name(mpctx, chapter);
|
||||||
if (!chapter_name)
|
|
||||||
return M_PROPERTY_UNAVAILABLE;
|
|
||||||
*(char **) arg = chapter_name;
|
|
||||||
return M_PROPERTY_OK;
|
return M_PROPERTY_OK;
|
||||||
}
|
}
|
||||||
case M_PROPERTY_SWITCH:
|
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);
|
step_all = ROUND(sarg->inc);
|
||||||
// Check threshold for relative backward seeks
|
// Check threshold for relative backward seeks
|
||||||
if (mpctx->opts->chapter_seek_threshold >= 0 && step_all < 0) {
|
if (mpctx->opts->chapter_seek_threshold >= 0 && step_all < 0) {
|
||||||
if (chapter < -1)
|
|
||||||
return M_PROPERTY_UNAVAILABLE;
|
|
||||||
double current_chapter_start =
|
double current_chapter_start =
|
||||||
chapter_start_time(mpctx, chapter);
|
chapter_start_time(mpctx, chapter);
|
||||||
// If we are far enough into a chapter, seek back to the
|
// If we are far enough into a chapter, seek back to the
|
||||||
|
Loading…
Reference in New Issue
Block a user