• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

hardware/libaudio


Commit MetaInfo

Révision1c2c376341d016f7d7da43aa9909043a6738bd5d (tree)
l'heure2013-09-11 00:42:53
AuteurTueidj <tueidj@hotm...>
CommiterChih-Wei Huang

Message de Log

Fix bad sleep time

The bad sleep time occurs when pcm_get_htimestamp() fails, leaving
kernel_frames uninitialized and causing out->cur_write_threshold to be
set to a very large value. The following patch ensures kernel_frames is
initialized to a sane value, it should fix most of the "limiting sleep
time" warnings and stuttering audio caused by sleeping too much.

Change Summary

Modification

--- a/audio_hw.c
+++ b/audio_hw.c
@@ -715,8 +715,10 @@ static ssize_t out_write(struct audio_stream_out *stream, const void* buffer,
715715 struct timespec time_stamp;
716716 if (pcm_get_htimestamp(out->pcm,
717717 (unsigned int *)&kernel_frames,
718- &time_stamp) < 0)
718+ &time_stamp) < 0) {
719+ kernel_frames = 0; /* assume no space is available */
719720 break;
721+ }
720722 kernel_frames = pcm_get_buffer_size(out->pcm) - kernel_frames;
721723
722724 if (kernel_frames > out->cur_write_threshold) {