]> git.sesse.net Git - vlc/blobdiff - modules/access/cdda/access.c
Fix indentation.
[vlc] / modules / access / cdda / access.c
index 942b8e7879feaec592f7b61bec8aef2b9c7b697f..f89482ca93dc139e1a8813291be435f8f5f9aeb2 100644 (file)
@@ -30,8 +30,8 @@
 #include "cdda.h"          /* private structures. Also #includes vlc things */
 #include "info.h"          /* headers for meta info retrieval */
 #include "access.h"
-#include "vlc_keys.h"
-#include <vlc_interface.h>
+#include <vlc_keys.h>
+#include <vlc_dialog.h>
 
 #include <cdio/cdio.h>
 #include <cdio/logging.h>
@@ -282,7 +282,7 @@ static block_t * CDDAReadBlocks( access_t * p_access )
     {
         msg_Err( p_access, "cannot get a new block of size: %i",
                 i_blocks * CDIO_CD_FRAMESIZE_RAW );
-        intf_UserFatal( p_access, false, _("CD reading failed"),
+        dialog_Fatal( p_access, _("CD reading failed"),
                         _("VLC could not get a new block of size: %i."),
                         i_blocks * CDIO_CD_FRAMESIZE_RAW );
         return NULL;
@@ -302,14 +302,14 @@ static block_t * CDDAReadBlocks( access_t * p_access )
                 char *psz_mes = cdio_cddap_messages( p_cdda->paranoia_cd );
 
                 if( psz_mes || psz_err )
-                    msg_Err( p_access, "%s%s\n", psz_mes ? psz_mes: "",
+                    msg_Err( p_access, "%s%s", psz_mes ? psz_mes: "",
                              psz_err ? psz_err: "" );
 
                 free( psz_err );
                 free( psz_mes );
                 if( !p_readbuf )
                 {
-                    msg_Err( p_access, "paranoia read error on frame %i\n",
+                    msg_Err( p_access, "paranoia read error on frame %i",
                     p_cdda->i_lsn+i );
                 }
                 else
@@ -318,16 +318,13 @@ static block_t * CDDAReadBlocks( access_t * p_access )
             }
         }
         else
-        {
             rc = cdio_read_audio_sectors( p_cdda->p_cdio, p_block->p_buffer,
                                           p_cdda->i_lsn, i_blocks );
 #else
 #define DRIVER_OP_SUCCESS 0
-            int rc;
-            rc = cdio_read_audio_sectors( p_cdda->p_cdio, p_block->p_buffer,
+        int rc = cdio_read_audio_sectors( p_cdda->p_cdio, p_block->p_buffer,
                                           p_cdda->i_lsn, i_blocks);
 #endif
-        }
         if( rc != DRIVER_OP_SUCCESS )
         {
             msg_Err( p_access, "could not read %d sectors starting from %lu",
@@ -644,15 +641,16 @@ int CDDAOpen( vlc_object_t *p_this )
     cddb_log_set_handler ( cddb_log_handler );
     p_cdda->cddb.disc = NULL;
     p_cdda->b_cddb_enabled =
-        config_GetInt( p_access, MODULE_STRING "-cddb-enabled" );
+        var_CreateGetInteger( p_access, "album-art" ) != ALBUM_ART_WHEN_ASKED
+     && var_InheritInteger( p_access, MODULE_STRING "-cddb-enabled" );
 #endif
     p_cdda->b_cdtext =
-        config_GetInt( p_access, MODULE_STRING "-cdtext-enabled" );
+        var_InheritInteger( p_access, MODULE_STRING "-cdtext-enabled" );
     p_cdda->b_cdtext_prefer =
-        config_GetInt( p_access, MODULE_STRING "-cdtext-prefer" );
+        var_InheritInteger( p_access, MODULE_STRING "-cdtext-prefer" );
 #if LIBCDIO_VERSION_NUM >= 73
     p_cdda->b_audio_ctl =
-        config_GetInt( p_access, MODULE_STRING "-analog-output" );
+        var_InheritInteger( p_access, MODULE_STRING "-analog-output" );
 #endif
 
     p_cdda->psz_source = strdup( psz_source );
@@ -660,14 +658,14 @@ int CDDAOpen( vlc_object_t *p_this )
     p_cdda->p_cdio     = p_cdio;
     p_cdda->i_tracks   = 0;
     p_cdda->i_titles   = 0;
-    p_cdda->i_debug    = config_GetInt( p_this, MODULE_STRING "-debug" );
-    p_cdda->b_nav_mode = config_GetInt(p_this, MODULE_STRING "-navigation-mode" );
+    p_cdda->i_debug    = var_InheritInteger( p_this, MODULE_STRING "-debug" );
+    p_cdda->b_nav_mode =
+            var_InheritInteger(p_this, MODULE_STRING "-navigation-mode" );
     p_cdda->i_blocks_per_read =
-            config_GetInt( p_this, MODULE_STRING "-blocks-per-read" );
+            var_InheritInteger( p_this, MODULE_STRING "-blocks-per-read" );
     p_cdda->last_disc_frame =
             cdio_get_track_lsn( p_cdio, CDIO_CDROM_LEADOUT_TRACK );
-    p_cdda->p_input = vlc_object_find( p_access, VLC_OBJECT_INPUT,
-                                       FIND_PARENT );
+    p_cdda->p_input = access_GetParentInput( p_access );
 
     if( 0 == p_cdda->i_blocks_per_read )
         p_cdda->i_blocks_per_read = DEFAULT_BLOCKS_PER_READ;
@@ -732,11 +730,11 @@ int CDDAOpen( vlc_object_t *p_this )
 
 #if LIBCDIO_VERSION_NUM >= 72
     {
-        char *psz_paranoia = config_GetPsz( p_access,
+        char *psz_paranoia = var_InheritString( p_access,
                                 MODULE_STRING "-paranoia" );
 
         p_cdda->e_paranoia = PARANOIA_MODE_DISABLE;
-        if( psz_paranoia && *psz_paranoia )
+        if( psz_paranoia )
         {
             if( !strncmp( psz_paranoia, "full", strlen("full") ) )
                 p_cdda->e_paranoia = PARANOIA_MODE_FULL;