summaryrefslogtreecommitdiffstats
path: root/player/loadfile.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-02-10 22:08:47 +0100
committerwm4 <wm4@nowhere>2016-02-10 22:08:47 +0100
commit69b0af06ec0fdc8179ae839a4b1717d02517a607 (patch)
tree69bd1eaaaf8f79ee72d52c65cdf8b18368cc5317 /player/loadfile.c
parented6c04b1e5d614d997a2862c5d81ced04389b0f6 (diff)
downloadmpv-69b0af06ec0fdc8179ae839a4b1717d02517a607.tar.bz2
mpv-69b0af06ec0fdc8179ae839a4b1717d02517a607.tar.xz
player: abort loading if there is a problem with complex filters
Diffstat (limited to 'player/loadfile.c')
-rw-r--r--player/loadfile.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/player/loadfile.c b/player/loadfile.c
index 14ea719e62..1e3a02726d 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -1024,23 +1024,26 @@ static void load_timeline(struct MPContext *mpctx)
print_timeline(mpctx);
}
-static void init_complex_filters(struct MPContext *mpctx)
+static bool init_complex_filters(struct MPContext *mpctx)
{
assert(!mpctx->lavfi);
char *graph = mpctx->opts->lavfi_complex;
if (!graph || !graph[0])
- return;
+ return true;
if (mpctx->tl) {
MP_ERR(mpctx, "complex filters not supported with timeline\n");
- return;
+ return false;
}
mpctx->lavfi = lavfi_create(mpctx->log, graph);
if (!mpctx->lavfi)
- return;
+ return false;
+
+ if (lavfi_has_failed(mpctx->lavfi))
+ return false;
for (int n = 0; n < mpctx->num_tracks; n++) {
struct track *track = mpctx->tracks[n];
@@ -1084,6 +1087,8 @@ static void init_complex_filters(struct MPContext *mpctx)
lavfi_set_connected(pad, true);
reinit_audio_chain_src(mpctx, pad);
}
+
+ return true;
}
static bool init_complex_filter_decoders(struct MPContext *mpctx)
@@ -1251,7 +1256,8 @@ reopen_file:
check_previous_track_selection(mpctx);
- init_complex_filters(mpctx);
+ if (!init_complex_filters(mpctx))
+ goto terminate_playback;
assert(NUM_PTRACKS == 2); // opts->stream_id is hardcoded to 2
for (int t = 0; t < STREAM_TYPE_COUNT; t++) {