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:
@@ -12,7 +12,7 @@ namespace BPrivate {
|
|||||||
|
|
||||||
|
|
||||||
const char* string_for_rate(double rate, char* string, size_t stringSize,
|
const char* string_for_rate(double rate, char* string, size_t stringSize,
|
||||||
double base = 1024.0f);
|
double base = 1000.0f);
|
||||||
|
|
||||||
|
|
||||||
} // namespace BPrivate
|
} // namespace BPrivate
|
||||||
|
|||||||
@@ -410,7 +410,7 @@ printf("InfoWin::Update(0x%08lx)\n", which);
|
|||||||
float br = format.u.encoded_audio.bit_rate;
|
float br = format.u.encoded_audio.bit_rate;
|
||||||
char string[20] = "";
|
char string[20] = "";
|
||||||
if (br > 0.0)
|
if (br > 0.0)
|
||||||
s << ", " << string_for_rate(br, string, 20, 1000.0);
|
s << ", " << string_for_rate(br, string, sizeof(string));
|
||||||
}
|
}
|
||||||
s << "\n\n";
|
s << "\n\n";
|
||||||
fContentsView->Insert(s.String());
|
fContentsView->Insert(s.String());
|
||||||
|
|||||||
Reference in New Issue
Block a user