summaryrefslogtreecommitdiffstats
path: root/dom/media/CubebUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dom/media/CubebUtils.cpp')
-rw-r--r--dom/media/CubebUtils.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/dom/media/CubebUtils.cpp b/dom/media/CubebUtils.cpp
index 0f0167d9c..6bb846afe 100644
--- a/dom/media/CubebUtils.cpp
+++ b/dom/media/CubebUtils.cpp
@@ -203,11 +203,10 @@ void InitBrandName()
NS_SUCCEEDED(rv), "Could not get the program name for a cubeb stream.");
}
}
- /* cubeb expects a c-string. */
- const char* ascii = NS_LossyConvertUTF16toASCII(brandName).get();
- sBrandName = new char[brandName.Length() + 1];
- PodCopy(sBrandName.get(), ascii, brandName.Length());
- sBrandName[brandName.Length()] = 0;
+ NS_LossyConvertUTF16toASCII ascii(brandName);
+ sBrandName = new char[ascii.Length() + 1];
+ PodCopy(sBrandName.get(), ascii.get(), ascii.Length());
+ sBrandName[ascii.Length()] = 0;
}
cubeb* GetCubebContextUnlocked()