summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authorwm4 <wm4@mplayer2.org>2012-03-14 10:27:36 +0100
committerwm4 <wm4@mplayer2.org>2012-03-14 10:27:36 +0100
commit7608a0fac9b9c99cc2975be1667df9c8625713dc (patch)
treeee8f21195b8065133e224395b66c628b996b0e95 /mplayer.c
parent40300e3c0c41621bf0a73ff484c87603305ad7a1 (diff)
downloadmpv-7608a0fac9b9c99cc2975be1667df9c8625713dc.tar.bz2
mpv-7608a0fac9b9c99cc2975be1667df9c8625713dc.tar.xz
core: do not print garbage with -identify when chapter times are unknown
The current code tried to print -1000 as unsigned integer if the chapter time was unknown. Print -1 instead. This affects only the -identify output used for slave mode, such as ID_CHAPTER_0_START.
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mplayer.c b/mplayer.c
index d20998fe78..79f5719339 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -540,9 +540,10 @@ static void print_file_properties(struct MPContext *mpctx, const char *filename)
mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_CHAPTERS=%d\n", chapter_count);
for (int i = 0; i < chapter_count; i++) {
mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_CHAPTER_ID=%d\n", i);
- // in milliseconds
- mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_CHAPTER_%d_START=%"PRIu64"\n",
- i, (int64_t)(chapter_start_time(mpctx, i) * 1000.0));
+ // print in milliseconds
+ double time = chapter_start_time(mpctx, i) * 1000.0;
+ mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_CHAPTER_%d_START=%"PRId64"\n",
+ i, (int64_t)(time < 0 ? -1 : time));
char *name = chapter_name(mpctx, i);
if (name) {
mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_CHAPTER_%d_NAME=%s\n", i,