From ce01d1fc4db418d39880bbb6300eeb5bbcd7ba65 Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Wed, 14 Dec 2011 14:14:12 +0100 Subject: [PATCH] Add title time in playback menus for MP4 Ref #4030 Signed-off-by: Jean-Baptiste Kempf --- modules/demux/mp4/mp4.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c index ee26870356..e9acee30c0 100644 --- a/modules/demux/mp4/mp4.c +++ b/modules/demux/mp4/mp4.c @@ -1161,6 +1161,13 @@ static void LoadChapter( demux_t *p_demux ) } } } + + /* Add duration if titles are enabled */ + if( p_sys->p_title ) + { + p_sys->p_title->i_length = (uint64_t)1000000 * + (uint64_t)p_sys->i_duration / (uint64_t)p_sys->i_timescale; + } } /* now create basic chunk data, the rest will be filled by MP4_CreateSamplesIndex */