[MPlayer-dev-eng] [PATCH] Updated JACK audio output driver

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Tue Jun 22 21:57:31 CEST 2004


Hi,

>>This is wrong! You can't just cast to (unsigned long *)! When int!=long, 
>>this will overwrite the data behinde rate_hz and won't work at all on 
>>big-endian! Don't make rate a pointer!
> 
> Is it ok now?

Looks good. Just a minor thing I noticed:

> +	err = JACK_Open(&driver, bits_per_sample, &rate, channels);
> +	
> +	/* if sample rates doesn't match try to open device with jack's rate and
> +	 * let mplayer convert it (rate now contains that which jackd use) */
> +	if(err == ERR_RATE_MISMATCH) {
> +		mp_msg(MSGT_AO, MSGL_INFO, 
> +				"AO: [Jack] Sample rate mismatch, trying to resample.\n");
> +		
> +		if((err = JACK_Open(&driver, bits_per_sample, &rate, channels))) {
> +			mp_msg(MSGT_AO, MSGL_ERR,
> +					"AO: [Jack] JACK_Open() failed, error %d\n", err);
> +			return 0;
> +		}
> +	}
> +	/* any other error */
> +	else if(err != ERR_SUCCESS) {
> +		mp_msg(MSGT_AO, MSGL_ERR, 
> +				"AO: [Jack] JACK_Open() failed, error %d\n", err);
> +		return 0;
> +	}

if you remove the "else" in "else if(err != ERR_SUCCESS) {", you can 
remove the if-block above. Duplicate code is evil ;-)

Greetings,
Reimar Döffinger




More information about the MPlayer-dev-eng mailing list