[MPlayer-dev-eng] Psuedopatch to alsa9.c

Patrick Shirkey pshirkey at boosthardware.com
Tue Dec 9 21:11:37 CET 2003


I wanted to use the dmix plugin and was having difficulties.

I found that there is a couple of simple errors in the alsa9.c fixing 
these allows me to play multiple instances of mplayer while also looping 
  with alsaplayer on the same device. Pretty useful.

----
line 617
#ifdef SET_CHUNKSIZE
       {
	//set chunksize
-	if ((err = snd_pcm_hw_params_set_period_size_near(alsa_handler, 
alsa_hwparams, chunk_size, 0)) < 0)
+	if ((err = snd_pcm_hw_params_set_period_size_near(alsa_handler, 
alsa_hwparams, chunk_size, 0)) < 0)
	  {
	    printf("alsa-init: unable to set periodsize: %s\n", snd_strerror(err));
	    return(0);
	  }
	else if (verbose>0) {
	  printf("alsa-init: chunksize set to %i\n", chunk_size);
	}

	//set period_count
	if ((period_val = snd_pcm_hw_params_get_periods_max(alsa_hwparams, 0)) 
< alsa_fragcount) {
	  alsa_fragcount = period_val;			
	}

	if (verbose>0)
	  printf("alsa-init: current val=%i, fragcount=%i\n", period_val, 
alsa_fragcount);


-	if ((err = snd_pcm_hw_params_set_periods_near(alsa_handler, 
alsa_hwparams, alsa_fragcount, 0)) < 0) {
+	if ((err = snd_pcm_hw_params_set_periods_near(alsa_handler, 
alsa_hwparams, alsa_fragcount, 0)) < 0) {
	  printf("alsa-init: unable to set periods: %s\n", snd_strerror(err));
	}
       }
#endif
----

-- 
Patrick Shirkey - Boost Hardware Ltd.
Http://www.boosthardware.com
Http://www.djcj.org - The Linux Audio Users guide
========================================


  Apparently upon the beginning of the barrage, the donkey broke 
discipline and panicked, toppling the cart. At that point, the rockets 
disconnected from the timer, leaving them strewn around the street. 
Tethered to the now toppled cart, the donkey was unable to escape before 
the arrival of U.S. troops.

United Press International
Rockets on donkeys hit major Baghdad sites

By P. MITCHELL PROTHERO
Published 11/21/2003 11:13 AM



More information about the MPlayer-dev-eng mailing list