diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-10-06 04:28:59 +0300 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-10-06 04:48:00 +0300 |
commit | 7fd3eb0f74e7986e07556077ed654bad7869add8 (patch) | |
tree | 8d293145c0ef2bc31ca63f79dccb4e3b57294c82 /libao2 | |
parent | ef438b3a6b5bc714d521dd46d3ccb798ecd31eed (diff) | |
parent | cbbc886820e981f488660708678f528e1d243121 (diff) |
Merge svn changes up to r29752
As part of merging subtitle-in-terminal changes make
update_subtitles() only clear existing subtitles if called with the
reset argument, and not try to set new ones. Later calls should set
the needed new subtitles, and this change avoids some problems with
trying to set subtitles when mp_property_sub() in command.c gets
called from initialization code before full initialization.
Diffstat (limited to 'libao2')
-rw-r--r-- | libao2/ao_alsa.c | 5 | ||||
-rw-r--r-- | libao2/ao_oss.c | 13 |
2 files changed, 16 insertions, 2 deletions
diff --git a/libao2/ao_alsa.c b/libao2/ao_alsa.c index d6b9175f52..f47b4fbf3d 100644 --- a/libao2/ao_alsa.c +++ b/libao2/ao_alsa.c @@ -783,8 +783,11 @@ static void reset(void) static int play(void* data, int len, int flags) { - int num_frames = len / bytes_per_sample; + int num_frames; snd_pcm_sframes_t res = 0; + if (!(flags & AOPLAY_FINAL_CHUNK)) + len = len / ao_data.outburst * ao_data.outburst; + num_frames = len / bytes_per_sample; //mp_msg(MSGT_AO,MSGL_ERR,"alsa-play: frames=%i, len=%i\n",num_frames,len); diff --git a/libao2/ao_oss.c b/libao2/ao_oss.c index 0ff87efadd..b4e5ab49b8 100644 --- a/libao2/ao_oss.c +++ b/libao2/ao_oss.c @@ -425,8 +425,19 @@ ac3_retry: } ao_data.bps=ao_data.channels; - if(ao_data.format != AF_FORMAT_U8 && ao_data.format != AF_FORMAT_S8) + switch (ao_data.format & AF_FORMAT_BITS_MASK) { + case AF_FORMAT_8BIT: + break; + case AF_FORMAT_16BIT: ao_data.bps*=2; + break; + case AF_FORMAT_24BIT: + ao_data.bps*=3; + break; + case AF_FORMAT_32BIT: + ao_data.bps*=4; + break; + } ao_data.outburst-=ao_data.outburst % ao_data.bps; // round down ao_data.bps*=ao_data.samplerate; |