summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-08 23:02:18 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-08 23:02:18 +0000
commitff83d3f27525da11d852d22db64533c8ec80d815 (patch)
tree16b5f16c6671e4309913542048afc00fe535e717 /media
parentd0a7e000193d0ac74c79671f953dcc704852be8e (diff)
downloadchromium_src-ff83d3f27525da11d852d22db64533c8ec80d815.zip
chromium_src-ff83d3f27525da11d852d22db64533c8ec80d815.tar.gz
chromium_src-ff83d3f27525da11d852d22db64533c8ec80d815.tar.bz2
linux: grab device name before closing it
PcmClose frees the handle regardless of whether there's an error while shutting down, so grab the PcmName result first in case we want to use it in an error message. BUG=20006 Review URL: http://codereview.chromium.org/538005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35837 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r--media/audio/linux/alsa_output.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/media/audio/linux/alsa_output.cc b/media/audio/linux/alsa_output.cc
index 1ee85e7..d878a74 100644
--- a/media/audio/linux/alsa_output.cc
+++ b/media/audio/linux/alsa_output.cc
@@ -756,10 +756,11 @@ snd_pcm_t* AlsaPcmOutputStream::OpenDevice(const std::string& device_name,
}
bool AlsaPcmOutputStream::CloseDevice(snd_pcm_t* handle) {
+ std::string name = wrapper_->PcmName(handle);
int error = wrapper_->PcmClose(handle);
if (error < 0) {
- LOG(ERROR) << "Cannot close audio device (" << wrapper_->PcmName(handle)
- << "): " << wrapper_->StrError(error);
+ LOG(ERROR) << "Error closing audio device (" << name << "): "
+ << wrapper_->StrError(error);
return false;
}