diff --git a/doc/mkvmerge.1 b/doc/mkvmerge.1 index 0f042d13f..91b665bb4 100644 --- a/doc/mkvmerge.1 +++ b/doc/mkvmerge.1 @@ -66,9 +66,12 @@ for this name can be set. The following meta characters are supported: .br \fB%p\fR is replaced by the current entry's \fIPERFORMER\fR string, .br -\fB%t\fR is replaced by the current entry's \fITITLE\fR string and +\fB%t\fR is replaced by the current entry's \fITITLE\fR string, .br -\fB%n\fR is replaced by the current track number. +\fB%n\fR is replaced by the current track number and +.br +\fB%N\fR is replaced by the current track number padded with a leading zero if +it is < 10. .br Everything else is copied as-is. .br diff --git a/src/common/chapters.cpp b/src/common/chapters.cpp index c402930d3..1da3f9c27 100644 --- a/src/common/chapters.cpp +++ b/src/common/chapters.cpp @@ -283,7 +283,11 @@ static void cue_entries_to_chapter_name(string &performer, string &title, name += title; else if (*next_char == 'n') name += to_string(num); - else { + else if (*next_char == 'N') { + if (num < 10) + name += '0'; + name += to_string(num); + } else { name += *this_char; this_char--; }