summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-07 19:03:19 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-07 19:03:19 +0000
commitffbdb354dc57a938943478fd391a7cc49b4f8649 (patch)
treefc55eab45538dd79b9215241ffa9502b6ad5c895 /chrome/common
parente202c44a3e224dfd090d80a01648db1d07093418 (diff)
downloadchromium_src-ffbdb354dc57a938943478fd391a7cc49b4f8649.zip
chromium_src-ffbdb354dc57a938943478fd391a7cc49b4f8649.tar.gz
chromium_src-ffbdb354dc57a938943478fd391a7cc49b4f8649.tar.bz2
Fix audio "clicking" for strongbad demo
The strongbad demo plays an audio file of 11kHz. However we hardcoded in the AudioRendererHost to always open an audio device of 8k samples which happens to be too big for streams of 11khz. This makes the IPC transport packet size much smaller than the hardware buffer size and hardware packet is always partially filled. This change allow the AudioRendererHost to designate the transport packet size based on the hardware packet size. The hardware packet size is now adjusted based on the sample rate. BUG=46007 TEST=http://smokescreen.us/demos/sb45demo.html The above audio plays fine. Review URL: http://codereview.chromium.org/2651001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49078 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/render_messages.h12
1 files changed, 3 insertions, 9 deletions
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h
index 0f6419c..f5e4d72 100644
--- a/chrome/common/render_messages.h
+++ b/chrome/common/render_messages.h
@@ -466,11 +466,9 @@ struct ViewHostMsg_Audio_CreateStream_Params {
// Number of bytes per packet. Determines the maximum number of bytes
// transported for each audio packet request.
+ // A value of 0 means that the audio packet size is selected automatically
+ // by the browser process.
uint32 packet_size;
-
- // Maximum number of bytes of audio packets that should be kept in the browser
- // process.
- uint32 buffer_capacity;
};
// This message is used for supporting popup menus on Mac OS X using native
@@ -1791,7 +1789,6 @@ struct ParamTraits<ViewHostMsg_Audio_CreateStream_Params> {
WriteParam(m, p.sample_rate);
WriteParam(m, p.bits_per_sample);
WriteParam(m, p.packet_size);
- WriteParam(m, p.buffer_capacity);
}
static bool Read(const Message* m, void** iter, param_type* p) {
return
@@ -1799,8 +1796,7 @@ struct ParamTraits<ViewHostMsg_Audio_CreateStream_Params> {
ReadParam(m, iter, &p->channels) &&
ReadParam(m, iter, &p->sample_rate) &&
ReadParam(m, iter, &p->bits_per_sample) &&
- ReadParam(m, iter, &p->packet_size) &&
- ReadParam(m, iter, &p->buffer_capacity);
+ ReadParam(m, iter, &p->packet_size);
}
static void Log(const param_type& p, std::wstring* l) {
l->append(L"<ViewHostMsg_Audio_CreateStream_Params>(");
@@ -1814,8 +1810,6 @@ struct ParamTraits<ViewHostMsg_Audio_CreateStream_Params> {
l->append(L", ");
LogParam(p.packet_size, l);
l->append(L")");
- LogParam(p.buffer_capacity, l);
- l->append(L")");
}
};