diff --git a/playback_m3u.php b/playback_m3u.php index 3a13cb497..3443d0f19 100644 --- a/playback_m3u.php +++ b/playback_m3u.php @@ -111,24 +111,31 @@ foreach ($m3uData as $entry) { $audioDub = array_map(function ($stream) { global $lang; - if (!isset($stream->tags)) { - return null; + $result = '' . sprintf($lang['AUDIO_TRACK'], ($stream->index === 0) ? 1 : $stream->index) . '
'; + if (isset($stream->tags->language)) { + if (isset($stream->tags->title)) { + $result .= '' . mb_strtoupper($stream->tags->language, 'UTF-8') . ' (' . $stream->tags->title . ')' . ''; + } else { + $result .= '' . mb_strtoupper($stream->tags->language, 'UTF-8') . ''; + } + $result .= '
'; } - $result = '' . sprintf($lang['AUDIO_TRACK'], $stream->index) . '
'; - - if (isset($stream->tags->title)) { - $result .= '' . mb_strtoupper($stream->tags->language, 'UTF-8') . ' (' . $stream->tags->title . ')' . ''; - } else { - $result .= '' . mb_strtoupper($stream->tags->language, 'UTF-8') . ''; + if (!empty($stream->codec_name)) { + $result .= sprintf($lang['AUDIO_CODEC'], mb_strtoupper($stream->codec_name, 'UTF-8')) . '
'; + } + if (!empty($stream->bit_rate)) { + $result .= sprintf($lang['BITRATE'], humn_bitrate($stream->bit_rate)) . '
'; + } + if (!empty($stream->sample_rate)) { + $result .= sprintf($lang['SAMPLE_RATE'], $stream->sample_rate) . '
'; + } + if (!empty($stream->channels)) { + $result .= sprintf($lang['CHANNELS'], $stream->channels) . '
'; + } + if (!empty($stream->channel_layout)) { + $result .= sprintf($lang['CHANNELS_LAYOUT'], $stream->channel_layout); } - - $result .= '
'; - $result .= sprintf($lang['AUDIO_CODEC'], mb_strtoupper($stream->codec_name, 'UTF-8')) . '
'; - $result .= sprintf($lang['BITRATE'], humn_bitrate($stream->bit_rate)) . '
'; - $result .= sprintf($lang['SAMPLE_RATE'], $stream->sample_rate) . '
'; - $result .= sprintf($lang['CHANNELS'], $stream->channels) . '
'; - $result .= sprintf($lang['CHANNELS_LAYOUT'], $stream->channel_layout); return $result; }, $audioTracks);