diff options
author | TSaaristo <tero.saaristo@gmail.com> | 2018-07-05 17:12:46 +0300 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2018-09-26 22:42:53 +0300 |
commit | 3744d0bda93d63a8ceb489a04f6c07817ce57d10 (patch) | |
tree | e95e7d636e46efebb6c6041da743c88f99e75a56 | |
parent | 6eb59fea2fca348a72b0cc8a84ccb7dcfe2f8fe6 (diff) | |
download | mpv-3744d0bda93d63a8ceb489a04f6c07817ce57d10.tar.bz2 mpv-3744d0bda93d63a8ceb489a04f6c07817ce57d10.tar.xz |
encode: fix expected streams when using --lavfi-complex
mpctx->current_track[0][STREAM_VIDEO] (and STREAM_AUDIO) are empty when
using --lavfi-complex. Moving the muxer stream hinting after audio/video chain
initialization and checking if the chains exist fixes encoding with --lavfi-complex.
Previously, the output audio/video streams did not get prepared and the encode
would fail due to unexpected stream addition.
-rw-r--r-- | player/loadfile.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/player/loadfile.c b/player/loadfile.c index 43d401dc06..4e764dc403 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -1299,21 +1299,21 @@ static void play_current_file(struct MPContext *mpctx) update_demuxer_properties(mpctx); + update_playback_speed(mpctx); + + reinit_video_chain(mpctx); + reinit_audio_chain(mpctx); + reinit_sub_all(mpctx); + if (mpctx->encode_lavc_ctx) { - if (mpctx->current_track[0][STREAM_VIDEO]) + if (mpctx->vo_chain) encode_lavc_expect_stream(mpctx->encode_lavc_ctx, STREAM_VIDEO); - if (mpctx->current_track[0][STREAM_AUDIO]) + if (mpctx->ao_chain) encode_lavc_expect_stream(mpctx->encode_lavc_ctx, STREAM_AUDIO); encode_lavc_set_metadata(mpctx->encode_lavc_ctx, mpctx->demuxer->metadata); } - update_playback_speed(mpctx); - - reinit_video_chain(mpctx); - reinit_audio_chain(mpctx); - reinit_sub_all(mpctx); - if (!mpctx->vo_chain && !mpctx->ao_chain && opts->stream_auto_sel) { MP_FATAL(mpctx, "No video or audio streams selected.\n"); mpctx->error_playing = MPV_ERROR_NOTHING_TO_PLAY; |