[vlc-devel] commit: Set CDDA track duration when creating the track items. ( Laurent Aimar )

git version control git at videolan.org
Sat Nov 22 16:38:00 CET 2008


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sat Nov 22 11:15:21 2008 +0100| [ca94f2108f14e043da34cd0542eb49fef281bb87] | committer: Laurent Aimar 

Set CDDA track duration when creating the track items.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ca94f2108f14e043da34cd0542eb49fef281bb87
---

 modules/access/cdda.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/modules/access/cdda.c b/modules/access/cdda.c
index b877185..a26c844 100644
--- a/modules/access/cdda.c
+++ b/modules/access/cdda.c
@@ -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 */




More information about the vlc-devel mailing list