summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Oscarsson <DanOscarsson@users.noreply.github.com>2017-03-26 13:30:27 +0200
committerwm4 <wm4@nowhere>2017-03-26 14:12:39 +0200
commit823f2c603d6e7914ddad6bda0f225f7e63b36bcf (patch)
tree05431c4fef8e960442852dfa981c05350f016b86
parenta94013f5857e4a335cc1da4cf3926a613f422b5c (diff)
downloadmpv-823f2c603d6e7914ddad6bda0f225f7e63b36bcf.tar.bz2
mpv-823f2c603d6e7914ddad6bda0f225f7e63b36bcf.tar.xz
player: print additional stream info
In print_stream print additional stream info for audio and video track. While it may be incorrect it is mostly correct and good info to have.
-rw-r--r--player/loadfile.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/player/loadfile.c b/player/loadfile.c
index dba02ee828..769a1a5254 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -132,7 +132,19 @@ static void print_stream(struct MPContext *mpctx, struct track *t)
if (t->title)
APPEND(b, " '%s'", t->title);
const char *codec = s ? s->codec->codec : NULL;
- APPEND(b, " (%s)", codec ? codec : "<unknown>");
+ APPEND(b, " (%s", codec ? codec : "<unknown>");
+ if (t->type == STREAM_VIDEO) {
+ if (s && s->codec->disp_w)
+ APPEND(b, " %dx%d", s->codec->disp_w, s->codec->disp_h);
+ if (s && s->codec->fps)
+ APPEND(b, " %.3f Hz", s->codec->fps);
+ } else if (t->type == STREAM_AUDIO) {
+ if (s && s->codec->channels.num)
+ APPEND(b, " %d ch", s->codec->channels.num);
+ if (s && s->codec->samplerate)
+ APPEND(b, " %d Hz", s->codec->samplerate);
+ }
+ APPEND(b, ")");
if (t->is_external)
APPEND(b, " (external)");
MP_INFO(mpctx, "%s\n", b);