mirror of
https://github.com/mpv-player/mpv
synced 2025-01-11 17:39:38 +00:00
player: simplify chapter display name code
The display name is always recomputed, so we can always toss the input name.
This commit is contained in:
parent
e023524481
commit
9780ff9642
@ -434,7 +434,7 @@ int get_current_chapter(struct MPContext *mpctx)
|
||||
char *chapter_display_name(struct MPContext *mpctx, int chapter)
|
||||
{
|
||||
char *name = chapter_name(mpctx, chapter);
|
||||
char *dname = name;
|
||||
char *dname = NULL;
|
||||
if (name) {
|
||||
dname = talloc_asprintf(NULL, "(%d) %s", chapter + 1, name);
|
||||
} else if (chapter < -1) {
|
||||
@ -447,7 +447,6 @@ char *chapter_display_name(struct MPContext *mpctx, int chapter)
|
||||
dname = talloc_asprintf(NULL, "(%d) of %d", chapter + 1,
|
||||
chapter_count);
|
||||
}
|
||||
if (dname != name)
|
||||
talloc_free(name);
|
||||
return dname;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user