]> git.sesse.net Git - vlc/commitdiff
Set CDDA track duration when creating the track items.
authorLaurent Aimar <fenrir@videolan.org>
Sat, 22 Nov 2008 10:15:21 +0000 (11:15 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Sat, 22 Nov 2008 15:29:54 +0000 (16:29 +0100)
modules/access/cdda.c

index b877185d27686284ced2b65d118ba59d8f7dac50..a26c844848a0aef58abdf622f27354e38c28d4fc 100644 (file)
@@ -443,6 +443,9 @@ static int GetTracks( access_t *p_access, input_item_t *p_current )
         input_item_AddOption( p_input_item, psz_first );
         input_item_AddOption( p_input_item, psz_last );
         input_item_AddOption( p_input_item, psz_opt );
+        const mtime_t i_duration = (int64_t)( p_sys->p_sectors[i+1] - p_sys->p_sectors[i] ) *
+                                   CDDA_DATA_SIZE * 1000000 / 44100 / 2 / 2;
+        input_item_SetDuration( p_input_item, i_duration );
 
 #ifdef HAVE_LIBCDDB
         /* If we have CDDB info, change the name */