StringForRate(): adjustments

* Make 1000.0f the default base
* Also use sizeof() in MediaPlayer to get the string size rather than hardcode.

Thanks Marcus
This commit is contained in:
Philippe Saint-Pierre
2012-06-25 13:43:53 -04:00
parent 8d87f2b43a
commit 36784bbc2c
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ namespace BPrivate {
const char* string_for_rate(double rate, char* string, size_t stringSize,
double base = 1024.0f);
double base = 1000.0f);
} // namespace BPrivate
+1 -1
View File
@@ -410,7 +410,7 @@ printf("InfoWin::Update(0x%08lx)\n", which);
float br = format.u.encoded_audio.bit_rate;
char string[20] = "";
if (br > 0.0)
s << ", " << string_for_rate(br, string, 20, 1000.0);
s << ", " << string_for_rate(br, string, sizeof(string));
}
s << "\n\n";
fContentsView->Insert(s.String());