]> git.sesse.net Git - vlc/blobdiff - modules/access/cdda/access.c
signed/unsigned mismatch fix.
[vlc] / modules / access / cdda / access.c
index 49555c54bfd33fbcfd2fa4d3870904cb40270f51..84f81a6cb26fb1f79c1860a1e4a2f3e5819d244c 100644 (file)
@@ -2,7 +2,7 @@
  * cddax.c : CD digital audio input module for vlc using libcdio
  *****************************************************************************
  * Copyright (C) 2000,2003 VideoLAN
- * $Id: access.c,v 1.13 2003/12/05 02:33:49 rocky Exp $
+ * $Id: access.c,v 1.16 2003/12/14 23:40:36 rocky Exp $
  *
  * Authors: Rocky Bernstein <rocky@panix.com> 
  *          Laurent Aimar <fenrir@via.ecp.fr>
@@ -625,11 +625,12 @@ CDDACreatePlayListItem(const input_thread_t *p_input, cdda_data_t *p_cdda,
                       playlist_t *p_playlist, unsigned int i_track, 
                       char *psz_mrl, int psz_mrl_max, 
                       const char *psz_source, int playlist_operation, 
-                      unsigned int i_pos)
+                      int i_pos)
 {
   mtime_t i_duration = 
     (p_cdda->p_sectors[i_track] - p_cdda->p_sectors[i_track-1]) 
     / CDIO_CD_FRAMES_PER_SEC;
+  char *p_author;
   char *p_title;
   char *config_varname = MODULE_STRING "-title-format";
 
@@ -642,14 +643,28 @@ CDDACreatePlayListItem(const input_thread_t *p_input, cdda_data_t *p_cdda,
   snprintf(psz_mrl, psz_mrl_max, "%s%s@T%u", 
           CDDA_MRL_PREFIX, psz_source, i_track);
 
-  p_title = CDDAFormatStr(p_input, p_cdda, 
+  p_title = CDDAFormatStr(p_input, p_cdda,
                          config_GetPsz( p_input, config_varname ), 
                          psz_mrl, i_track);
 
   dbg_print( INPUT_DBG_META, "mrl: %s, title: %s, duration, %ld, pos %d",
             psz_mrl, p_title, (long int) i_duration, i_pos );
+
   playlist_AddExt( p_playlist, psz_mrl, p_title, i_duration * 1000000, 
                   0, 0, playlist_operation, i_pos );
+
+  p_author = 
+    CDDAFormatStr( p_input, p_cdda,
+                  config_GetPsz( p_input, MODULE_STRING "-author-format" ),
+                  psz_mrl, i_track );
+
+  /* FIXME: This is horrible, but until the playlist interface is fixed up
+     something like this has to be done for the "Author" field.
+   */
+  if( i_pos == PLAYLIST_END ) i_pos = p_playlist->i_size - 1;
+  free(p_playlist->pp_items[i_pos]->psz_author);
+  p_playlist->pp_items[i_pos]->psz_author = strdup(p_author);
+
 }
 
 static int
@@ -836,7 +851,7 @@ E_(Open)( vlc_object_t *p_this )
         free( psz_orig );
         return -1;
       }
-      psz_source = config_GetPsz( p_input, MODULE_STRING "-device" );
+      psz_source = config_GetPsz( p_input, "cd-audio" );
       
       if( !psz_source || 0==strlen(psz_source) ) {
         /* Scan for a CD-ROM drive with a CD-DA in it. */