]> git.sesse.net Git - vlc/commitdiff
Grmbl
authorClément Stenac <zorglub@videolan.org>
Fri, 16 Dec 2005 09:47:15 +0000 (09:47 +0000)
committerClément Stenac <zorglub@videolan.org>
Fri, 16 Dec 2005 09:47:15 +0000 (09:47 +0000)
modules/access/cdda.c
modules/access/file.c

index ebb27840b47e8b53994981f679f998aa5dd1a8e6..9c6a98ba03fb47c795806cda43af5a8ec731a15f 100644 (file)
@@ -100,10 +100,6 @@ static int Open( vlc_object_t *p_this )
     char *psz_name;
     int  i;
 
-    vlc_bool_t b_separate_requested;
-    vlc_bool_t b_play;
-    input_thread_t *p_input;
-
     if( !p_access->psz_path || !*p_access->psz_path )
     {
         /* Only when selected */
@@ -143,28 +139,36 @@ static int Open( vlc_object_t *p_this )
     p_sys->vcddev = vcddev;
     p_sys->b_header = VLC_FALSE;
 
-    b_separate_requested = var_CreateGetBool( p_access, "cdda-separate-tracks" );
-
-    /* We only do separate items if the whole disc is requested - Dirty hack we access
-     * some private data ! */
-    p_input = (input_thread_t *)( p_access->p_parent );
-    if( b_separate_requested && p_input->input.i_title_start == -1 )
+    /* We read the Table Of Content information */
+    p_sys->i_titles = ioctl_GetTracksMap( VLC_OBJECT(p_access),
+                                          p_sys->vcddev, &p_sys->p_sectors );
+    if( p_sys->i_titles < 0 )
     {
-        p_sys->b_separate_items = VLC_TRUE;
+        msg_Err( p_access, "unable to count tracks" );
+        goto error;
     }
-
-    if( p_sys->b_separate_items )
+    else if( p_sys->i_titles <= 0 )
     {
-        /* Let's check if we need to play */
+        msg_Err( p_access, "no audio tracks found" );
+        goto error;
     }
 
-    /* We read the Table Of Content information */
-    i_ret = GetTracks( p_access, p_sys->b_separate_items );
-    if( i_ret < 0 )
+    /* Build title table */
+    for( i = 0; i < p_sys->i_titles; i++ )
     {
-        goto error;
+        input_title_t *t = p_sys->title[i] = vlc_input_title_New();
+
+        msg_Dbg( p_access, "title[%d] start=%d", i, p_sys->p_sectors[i] );
+        msg_Dbg( p_access, "title[%d] end=%d", i, p_sys->p_sectors[i+1] );
+
+        asprintf( &t->psz_name, _("Track %i"), i + 1 );
+        t->i_size = ( p_sys->p_sectors[i+1] - p_sys->p_sectors[i] ) *
+                    (int64_t)CDDA_DATA_SIZE;
+
+        t->i_length = I64C(1000000) * t->i_size / 44100 / 4;
     }
 
+    p_sys->i_sector = p_sys->p_sectors[0];
     p_access->info.i_size = p_sys->title[0]->i_size;
 
     /* Build a WAV header for the output data */
@@ -393,48 +397,3 @@ static int Control( access_t *p_access, int i_query, va_list args )
     }
     return VLC_SUCCESS;
 }
-
-
-
-
-static int GetTracks( access_t *p_access, vlc_bool_t b_separate )
-{
-    p_sys->i_titles = ioctl_GetTracksMap( VLC_OBJECT(p_access),
-                                          p_sys->vcddev, &p_sys->p_sectors );
-    if( p_sys->i_titles < 0 )
-    {
-        msg_Err( p_access, "unable to count tracks" );
-        return VLC_EGENERIC;;
-    }
-    else if( p_sys->i_titles <= 0 )
-    {
-        msg_Err( p_access, "no audio tracks found" );
-        return VLC_EGENERIC;
-    }
-
-    /* Build title table */
-    for( i = 0; i < p_sys->i_titles; i++ )
-    {
-        if( !b_separate )
-        {
-            input_title_t *t = p_sys->title[i] = vlc_input_title_New();
-
-            msg_Dbg( p_access, "title[%d] start=%d", i, p_sys->p_sectors[i] );
-            msg_Dbg( p_access, "title[%d] end=%d", i, p_sys->p_sectors[i+1] );
-
-            asprintf( &t->psz_name, _("Track %i"), i + 1 );
-            t->i_size = ( p_sys->p_sectors[i+1] - p_sys->p_sectors[i] ) *
-                        (int64_t)CDDA_DATA_SIZE;
-
-            t->i_length = I64C(1000000) * t->i_size / 44100 / 4;
-        }
-        else
-        {
-            /* Create playlist items */
-        }
-    }
-
-    p_sys->i_sector = p_sys->p_sectors[0];
-
-   return VLC_SUCCESS;
-} 
index 55f81cbbf88d43c892c2dbbac4d4699f00a97544..ee593f8b4f99ba1e97885adc8d6808f522da6198 100644 (file)
@@ -160,8 +160,6 @@ static int Open( vlc_object_t *p_this )
 
     b_stdin = psz_name[0] == '-' && psz_name[1] == '\0';
 
-    fprintf( stderr, "---%s\n", p_access->psz_path );
-
     if( !b_stdin )
     {
         if( psz_name[0] == '~' && psz_name[1] == '/' )