mirror of https://github.com/mpv-player/mpv
laodfile: remove redunant track type check
The data within the checks is unavailable if the track isn't of that type, so there is no need to check the type.
This commit is contained in:
parent
c5561b8e09
commit
1bee15d5da
|
@ -284,20 +284,17 @@ static void print_stream(struct MPContext *mpctx, struct track *t, bool indent)
|
||||||
APPEND(b, " (%s", codec ? codec : "<unknown>");
|
APPEND(b, " (%s", codec ? codec : "<unknown>");
|
||||||
if (s && s->codec->codec_profile)
|
if (s && s->codec->codec_profile)
|
||||||
APPEND(b, " [%s]", s->codec->codec_profile);
|
APPEND(b, " [%s]", s->codec->codec_profile);
|
||||||
if (t->type == STREAM_VIDEO) {
|
if (s && s->codec->disp_w)
|
||||||
if (s && s->codec->disp_w)
|
APPEND(b, " %dx%d", s->codec->disp_w, s->codec->disp_h);
|
||||||
APPEND(b, " %dx%d", s->codec->disp_w, s->codec->disp_h);
|
if (s && s->codec->fps && !t->image) {
|
||||||
if (s && s->codec->fps && !t->image) {
|
char *fps = mp_format_double(NULL, s->codec->fps, 4, false, false, true);
|
||||||
char *fps = mp_format_double(NULL, s->codec->fps, 4, false, false, true);
|
APPEND(b, " %s fps", fps);
|
||||||
APPEND(b, " %s fps", fps);
|
talloc_free(fps);
|
||||||
talloc_free(fps);
|
|
||||||
}
|
|
||||||
} else if (t->type == STREAM_AUDIO) {
|
|
||||||
if (s && s->codec->channels.num)
|
|
||||||
APPEND(b, " %dch", s->codec->channels.num);
|
|
||||||
if (s && s->codec->samplerate)
|
|
||||||
APPEND(b, " %d Hz", s->codec->samplerate);
|
|
||||||
}
|
}
|
||||||
|
if (s && s->codec->channels.num)
|
||||||
|
APPEND(b, " %dch", s->codec->channels.num);
|
||||||
|
if (s && s->codec->samplerate)
|
||||||
|
APPEND(b, " %d Hz", s->codec->samplerate);
|
||||||
if (s && s->codec->bitrate) {
|
if (s && s->codec->bitrate) {
|
||||||
APPEND(b, " %d kbps", (s->codec->bitrate + 500) / 1000);
|
APPEND(b, " %d kbps", (s->codec->bitrate + 500) / 1000);
|
||||||
} else if (s && s->hls_bitrate) {
|
} else if (s && s->hls_bitrate) {
|
||||||
|
|
Loading…
Reference in New Issue