patch-2.4.20 linux-2.4.20/drivers/sound/emu10k1/cardwi.c

Next file: linux-2.4.20/drivers/sound/emu10k1/cardwo.c
Previous file: linux-2.4.20/drivers/sound/cs4232.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.19/drivers/sound/emu10k1/cardwi.c linux-2.4.20/drivers/sound/emu10k1/cardwi.c
@@ -121,7 +121,7 @@
 	struct emu10k1_card *card = wave_dev->card;
 	struct wiinst *wiinst = wave_dev->wiinst;
 	struct wiinst **wiinst_tmp = NULL;
-	u32 delay;
+	u16 delay;
 	unsigned long flags;
 
 	DPF(2, "emu10k1_wavein_open()\n");
@@ -170,6 +170,12 @@
 
 	emu10k1_set_record_src(card, wiinst);
 
+	emu10k1_reset_record(card, &wiinst->buffer);
+
+	wiinst->buffer.hw_pos = 0;
+	wiinst->buffer.pos = 0;
+	wiinst->buffer.bytestocopy = 0;
+
 	delay = (48000 * wiinst->buffer.fragment_size) / wiinst->format.bytespersec;
 
 	emu10k1_timer_install(card, &wiinst->timer, delay / 2);
@@ -223,10 +229,6 @@
 	emu10k1_start_record(card, &wiinst->buffer);
 	emu10k1_timer_enable(wave_dev->card, &wiinst->timer);
 
-	wiinst->buffer.hw_pos = 0;
-	wiinst->buffer.pos = 0;
-	wiinst->buffer.bytestocopy = 0;
-
 	wiinst->state |= WAVE_STATE_STARTED;
 }
 
@@ -250,7 +252,7 @@
 {
 	struct emu10k1_card *card = wave_dev->card;
 	struct wiinst *wiinst = wave_dev->wiinst;
-	u32 delay;
+	u16 delay;
 
 	DPF(2, "emu10k1_wavein_setformat()\n");
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)