summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--DOCS/man/en/input.rst4
-rw-r--r--player/command.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/DOCS/man/en/input.rst b/DOCS/man/en/input.rst
index f9ce7b5082..646bad711b 100644
--- a/DOCS/man/en/input.rst
+++ b/DOCS/man/en/input.rst
@@ -918,6 +918,10 @@ an option at runtime.
``yes`` if the track has the default flag set in the file, ``no``
otherwise.
+ ``track-list/N/codec``
+ The codec name used by this track, for example ``h264``. Unavailable
+ in some rare cases.
+
``track-list/N/external``
``yes`` if the track is an external file, ``no`` otherwise. This is
set for separate subtitle files.
diff --git a/player/command.c b/player/command.c
index 2831f710c1..03599a61ee 100644
--- a/player/command.c
+++ b/player/command.c
@@ -1084,6 +1084,8 @@ static int get_track_entry(int item, int action, void *arg, void *ctx)
struct MPContext *mpctx = ctx;
struct track *track = mpctx->tracks[item];
+ const char *codec = track->stream ? track->stream->codec : NULL;
+
struct m_sub_property props[] = {
{"id", SUB_PROP_INT(track->user_tid)},
{"type", SUB_PROP_STR(stream_type_name(track->type)),
@@ -1100,6 +1102,8 @@ static int get_track_entry(int item, int action, void *arg, void *ctx)
{"selected", SUB_PROP_FLAG(track->selected)},
{"external-filename", SUB_PROP_STR(track->external_filename),
.unavailable = !track->external_filename},
+ {"codec", SUB_PROP_STR(codec),
+ .unavailable = !codec},
{0}
};