[MPlayer-cvslog] CVS: main/libao2 ao_alsa.c,1.24,1.25
Clemens Ladisch CVS
syncmail at mplayerhq.hu
Fri Feb 10 10:18:29 CET 2006
- Previous message: [MPlayer-cvslog] CVS: main/libmpdemux demux_asf.c, 1.41, 1.42 demux_avi.c, 1.71, 1.72 demux_avs.c, 1.7, 1.8 demux_demuxers.c, 1.8, 1.9 demux_film.c, 1.15, 1.16 demux_fli.c, 1.12, 1.13 demux_lavf.c, 1.26, 1.27 demux_mf.c, 1.15, 1.16 demux_mov.c, 1.137, 1.138 demux_mpg.c, 1.70, 1.71 demux_nsv.c, 1.13, 1.14 demux_nuv.c, 1.17, 1.18 demux_pva.c, 1.8, 1.9 demux_rawdv.c, 1.13, 1.14 demux_real.c, 1.87, 1.88 demux_realaud.c, 1.12, 1.13 demux_ts.c, 1.43, 1.44 demux_ty.c, 1.14, 1.15 demux_vqf.c, 1.7, 1.8 demux_y4m.c, 1.11, 1.12 demuxer.c, 1.215, 1.216 demuxer.h, 1.86, 1.87
- Next message: [MPlayer-cvslog] CVS: main/libao2 ao_alsa.c,1.24,1.25
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
CVS change done by Clemens Ladisch CVS
Update of /cvsroot/mplayer/main/libao2
In directory mail:/var2/tmp/cvs-serv26428/libao2
Modified Files:
ao_alsa.c
Log Message:
This replaces the hardcoded numbers for the sample format widths with a
call to snd_pcm_format_physical_width().
Index: ao_alsa.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_alsa.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- ao_alsa.c 9 Feb 2006 14:07:54 -0000 1.24
+++ ao_alsa.c 10 Feb 2006 09:18:27 -0000 1.25
@@ -545,37 +545,9 @@
return(0);
}
- ao_data.bps = ao_data.channels * ao_data.samplerate;
-
- //setting bw according to the input-format. resolution seems to be always s16_le or
- //u16_le so 32bit is probably obsolet.
- switch(alsa_format)
- {
- case SND_PCM_FORMAT_S8:
- case SND_PCM_FORMAT_U8:
- ao_data.bps *= 1;
- break;
- case SND_PCM_FORMAT_S16_LE:
- case SND_PCM_FORMAT_U16_LE:
- case SND_PCM_FORMAT_S16_BE:
- case SND_PCM_FORMAT_U16_BE:
- ao_data.bps *= 2;
- break;
- case SND_PCM_FORMAT_S32_LE:
- case SND_PCM_FORMAT_S32_BE:
- case SND_PCM_FORMAT_FLOAT_LE:
- ao_data.bps *= 4;
- break;
- case -1:
- mp_msg(MSGT_AO,MSGL_ERR,"alsa-init: invalid format (%s) requested - output disabled\n",af_fmt2str_short(format));
- return(0);
- break;
- default:
- ao_data.bps *= 2;
- mp_msg(MSGT_AO,MSGL_WARN,"alsa-init: couldn't convert to right format. setting bps to: %d", ao_data.bps);
- }
-
- bytes_per_sample = ao_data.bps / ao_data.samplerate;
+ bytes_per_sample = snd_pcm_format_physical_width(alsa_format) / 8;
+ bytes_per_sample *= ao_data.channels;
+ ao_data.bps = ao_data.samplerate * bytes_per_sample;
#ifdef BUFFERTIME
{
- Previous message: [MPlayer-cvslog] CVS: main/libmpdemux demux_asf.c, 1.41, 1.42 demux_avi.c, 1.71, 1.72 demux_avs.c, 1.7, 1.8 demux_demuxers.c, 1.8, 1.9 demux_film.c, 1.15, 1.16 demux_fli.c, 1.12, 1.13 demux_lavf.c, 1.26, 1.27 demux_mf.c, 1.15, 1.16 demux_mov.c, 1.137, 1.138 demux_mpg.c, 1.70, 1.71 demux_nsv.c, 1.13, 1.14 demux_nuv.c, 1.17, 1.18 demux_pva.c, 1.8, 1.9 demux_rawdv.c, 1.13, 1.14 demux_real.c, 1.87, 1.88 demux_realaud.c, 1.12, 1.13 demux_ts.c, 1.43, 1.44 demux_ty.c, 1.14, 1.15 demux_vqf.c, 1.7, 1.8 demux_y4m.c, 1.11, 1.12 demuxer.c, 1.215, 1.216 demuxer.h, 1.86, 1.87
- Next message: [MPlayer-cvslog] CVS: main/libao2 ao_alsa.c,1.24,1.25
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the MPlayer-cvslog
mailing list