mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 13:54:02 -07:00
Minor improvements (#1685)
* Minor improvements * Update ffprobe_info.php * Update ffprobe_info.php * Update CHANGELOG.md
This commit is contained in:
parent
0cabfb5294
commit
68ef591b82
2 changed files with 13 additions and 6 deletions
|
@ -63,11 +63,11 @@ if (isset($ffpInfo->streams)) {
|
|||
if (!empty($stream->codec_name)) {
|
||||
$result .= sprintf($lang['AUDIO_CODEC'], $stream->codec_long_name, mb_strtoupper($stream->codec_name, 'UTF-8')) . '<br>';
|
||||
}
|
||||
if (!empty($stream->bit_rate) && is_int($stream->bit_rate)) {
|
||||
$result .= sprintf($lang['BITRATE'], humn_bitrate($stream->bit_rate)) . '<br>';
|
||||
if (!empty($stream->bit_rate)) {
|
||||
$result .= sprintf($lang['BITRATE'], humn_bitrate((int)$stream->bit_rate)) . '<br>';
|
||||
}
|
||||
if (!empty($stream->sample_rate) && is_int($stream->sample_rate)) {
|
||||
$result .= sprintf($lang['SAMPLE_RATE'], humn_sample_rate($stream->sample_rate)) . '<br>';
|
||||
if (!empty($stream->sample_rate)) {
|
||||
$result .= sprintf($lang['SAMPLE_RATE'], humn_sample_rate((int)$stream->sample_rate)) . '<br>';
|
||||
}
|
||||
if (!empty($stream->channels)) {
|
||||
$result .= sprintf($lang['CHANNELS'], $stream->channels) . '<br>';
|
||||
|
@ -136,7 +136,14 @@ function humn_bitrate(int $bitrate, string $space = ' '): string
|
|||
*/
|
||||
function humn_sample_rate(int $sample_rate, string $space = ' '): string
|
||||
{
|
||||
$unit = '';
|
||||
if ($sample_rate >= 1000000) {
|
||||
$unit = 'Mhz';
|
||||
} elseif ($sample_rate >= 1000) {
|
||||
$unit = 'kHz';
|
||||
} else {
|
||||
$unit = 'Hz';
|
||||
}
|
||||
|
||||
return sprintf('%.1f', commify($sample_rate)) . $space . $unit;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue