diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-05-01 16:47:54 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-05-01 16:47:54 +0000 |
commit | e1e2527cd4a91488079a05a86f50433c89e5ce87 (patch) | |
tree | ad30ba57d06e6206fa8c9801f7814c7d9892e50c /libao2 | |
parent | a7b11f39278555db59704d86d26ec7f3954b967c (diff) |
Make ao_pulse fall back to s16le format instead of just failing.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26634 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libao2')
-rw-r--r-- | libao2/ao_pulse.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libao2/ao_pulse.c b/libao2/ao_pulse.c index a2440609c8..ddf4cabf63 100644 --- a/libao2/ao_pulse.c +++ b/libao2/ao_pulse.c @@ -114,11 +114,11 @@ static const struct format_map_s { int mp_format; pa_sample_format_t pa_format; } format_maps[] = { - {AF_FORMAT_U8, PA_SAMPLE_U8}, {AF_FORMAT_S16_LE, PA_SAMPLE_S16LE}, {AF_FORMAT_S16_BE, PA_SAMPLE_S16BE}, {AF_FORMAT_FLOAT_LE, PA_SAMPLE_FLOAT32LE}, {AF_FORMAT_FLOAT_BE, PA_SAMPLE_FLOAT32BE}, + {AF_FORMAT_U8, PA_SAMPLE_U8}, {AF_FORMAT_MU_LAW, PA_SAMPLE_ULAW}, {AF_FORMAT_A_LAW, PA_SAMPLE_ALAW}, {AF_FORMAT_UNKNOWN, 0} @@ -143,17 +143,18 @@ static int init(int rate_hz, int channels, int format, int flags) { ss.rate = rate_hz; ao_data.samplerate = rate_hz; - ao_data.format = format; ao_data.channels = channels; fmt_map = format_maps; while (fmt_map->mp_format != format) { if (fmt_map->mp_format == AF_FORMAT_UNKNOWN) { - mp_msg(MSGT_AO, MSGL_ERR, "AO: [pulse] Unsupported sample spec\n"); - goto fail; + mp_msg(MSGT_AO, MSGL_V, "AO: [pulse] Unsupported format, using default\n"); + fmt_map = format_maps; + break; } fmt_map++; } + ao_data.format = fmt_map->mp_format; ss.format = fmt_map->pa_format; if (!pa_sample_spec_valid(&ss)) { |