summaryrefslogtreecommitdiffstats
path: root/player/loadfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'player/loadfile.c')
-rw-r--r--player/loadfile.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/player/loadfile.c b/player/loadfile.c
index f8d5327acf..c3214d5cc2 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -1548,7 +1548,16 @@ static void play_current_file(struct MPContext *mpctx)
// One track can strictly feed at most 1 decoder
struct track *track = mpctx->current_track[i][t];
if (track) {
- if (track->selected) {
+ if (track->type != STREAM_SUB &&
+ mpctx->encode_lavc_ctx &&
+ !encode_lavc_stream_type_ok(mpctx->encode_lavc_ctx,
+ track->type))
+ {
+ MP_WARN(mpctx, "Disabling %s (not supported by target "
+ "format).\n", stream_type_name(track->type));
+ mpctx->current_track[i][t] = NULL;
+ mark_track_selection(mpctx, i, t, -2); // disable
+ } else if (track->selected) {
MP_ERR(mpctx, "Track %d can't be selected twice.\n",
track->user_tid);
mpctx->current_track[i][t] = NULL;