[Mplayer-cvslog] CVS: main/libmpdemux audio_in.c,1.5,1.6

Arpi of Ize arpi at mplayerhq.hu
Tue Oct 22 17:14:38 CEST 2002


Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var/tmp.root/cvs-serv15731

Modified Files:
	audio_in.c 
Log Message:
OSS is optional (fixes case when "tv" enabled, and "ossaudio" disabled)
patch by Chad Netzer <cnetzer at sonic.net>


Index: audio_in.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/audio_in.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- audio_in.c	2 Oct 2002 16:56:54 -0000	1.5
+++ audio_in.c	22 Oct 2002 15:14:30 -0000	1.6
@@ -31,10 +31,12 @@
 	ai->alsa.device = strdup("default");
 	return 0;
 #endif
+#ifdef USE_OSS_AUDIO
     case AUDIO_IN_OSS:
 	ai->oss.audio_fd = -1;
 	ai->oss.device = strdup("/dev/dsp");
 	return 0;
+#endif
     default:
 	return -1;
     }
@@ -50,10 +52,12 @@
 	ai->setup = 1;
 	return 0;
 #endif
+#ifdef USE_OSS_AUDIO
     case AUDIO_IN_OSS:
 	if (ai_oss_init(ai) < 0) return -1;
 	ai->setup = 1;
 	return 0;
+#endif
     default:
 	return -1;
     }
@@ -69,11 +73,13 @@
 	if (ai_alsa_setup(ai) < 0) return -1;
 	return ai->samplerate;
 #endif
+#ifdef USE_OSS_AUDIO
     case AUDIO_IN_OSS:
 	ai->req_samplerate = rate;
 	if (!ai->setup) return 0;
 	if (ai_oss_set_samplerate(ai) < 0) return -1;
 	return ai->samplerate;
+#endif
     default:
 	return -1;
     }
@@ -89,11 +95,13 @@
 	if (ai_alsa_setup(ai) < 0) return -1;
 	return ai->channels;
 #endif
+#ifdef USE_OSS_AUDIO
     case AUDIO_IN_OSS:
 	ai->req_channels = channels;
 	if (!ai->setup) return 0;
 	if (ai_oss_set_channels(ai) < 0) return -1;
 	return ai->channels;
+#endif
     default:
 	return -1;
     }
@@ -114,10 +122,12 @@
 	}
 	return 0;
 #endif
+#ifdef USE_OSS_AUDIO
     case AUDIO_IN_OSS:
 	if (ai->oss.device) free(ai->oss.device);
 	ai->oss.device = strdup(device);
 	return 0;
+#endif
     default:
 	return -1;
     }
@@ -137,10 +147,12 @@
 	    ai->setup = 0;
 	    return 0;
 #endif
+#ifdef USE_OSS_AUDIO
 	case AUDIO_IN_OSS:
 	    close(ai->oss.audio_fd);
 	    ai->setup = 0;
 	    return 0;
+#endif
 	}
     }
     return -1;
@@ -153,8 +165,10 @@
     case AUDIO_IN_ALSA:
 	return snd_pcm_start(ai->alsa.handle);
 #endif
+#ifdef USE_OSS_AUDIO
     case AUDIO_IN_OSS:
 	return 0;
+#endif
     default:
 	return -1;
     }
@@ -185,6 +199,7 @@
 	}
 	return ret;
 #endif
+#ifdef USE_OSS_AUDIO
     case AUDIO_IN_OSS:
 	ret = read(ai->oss.audio_fd, buffer, ai->blocksize);
 	if (ret != ai->blocksize) {
@@ -196,6 +211,7 @@
 	    return -1;
 	}
 	return ret;
+#endif
     default:
 	return -1;
     }




More information about the MPlayer-cvslog mailing list