diff src/hpplay.c @ 2:ac2d302a0011 r19-15b2

Import from CVS: tag r19-15b2
author cvs
date Mon, 13 Aug 2007 08:46:35 +0200
parents 376386a54a3c
children 0293115a14e9
line wrap: on
line diff
--- a/src/hpplay.c	Mon Aug 13 08:45:53 2007 +0200
+++ b/src/hpplay.c	Mon Aug 13 08:46:35 2007 +0200
@@ -106,17 +106,31 @@
 
     playParams.priority = APriorityNormal;          /* normal priority */
 
-    speaker = (char *) (string_data (XSYMBOL (Vhp_play_speaker)->name));
+    /*
+     * We can't signal an error, because all h*ll would break loose if
+     * we did.
+     */
+    if (SYMBOLP (Vhp_play_speaker))
+    {
+	speaker = (char *) (string_data (XSYMBOL (Vhp_play_speaker)->name));
     
-    /*
-     * setup the playback parameters
-     */
+	/*
+	 * setup the playback parameters
+	 */
 
-    /* speaker selection */
-    if ( strcmp(speaker,"external") == 0 ) {
-      gainEntry.u.o.out_dst = AODTMonoJack;
-    } else {
-      gainEntry.u.o.out_dst = AODTMonoIntSpeaker;
+	/* speaker selection */
+	if ( strcmp(speaker,"external") == 0 ) {
+	    gainEntry.u.o.out_dst = AODTMonoJack;
+	} else {
+	    gainEntry.u.o.out_dst = AODTMonoIntSpeaker;
+	}
+    }
+    else
+    {
+	/*
+	 * Quietly revert to the internal speaker
+	 */
+	gainEntry.u.o.out_dst = AODTMonoIntSpeaker;
     }
 
     gainEntry.u.o.out_ch = AOCTMono;