mirror of https://github.com/mpv-player/mpv
encode: propagate errors to exit status properly
Don't just let mpv CLI return 0 (success) as exit status if encoding failed somehow.
This commit is contained in:
parent
d3afe34c09
commit
b5c225382e
|
@ -1701,6 +1701,12 @@ terminate_playback:
|
|||
|
||||
mp_notify(mpctx, MPV_EVENT_TRACKS_CHANGED, NULL);
|
||||
|
||||
if (encode_lavc_didfail(mpctx->encode_lavc_ctx))
|
||||
mpctx->stop_play = PT_ERROR;
|
||||
|
||||
if (mpctx->stop_play == PT_ERROR && !mpctx->error_playing)
|
||||
mpctx->error_playing = MPV_ERROR_GENERIC;
|
||||
|
||||
bool nothing_played = !mpctx->shown_aframes && !mpctx->shown_vframes &&
|
||||
mpctx->error_playing <= 0;
|
||||
switch (mpctx->stop_play) {
|
||||
|
|
|
@ -1182,7 +1182,7 @@ static void handle_eof(struct MPContext *mpctx)
|
|||
void run_playloop(struct MPContext *mpctx)
|
||||
{
|
||||
if (encode_lavc_didfail(mpctx->encode_lavc_ctx)) {
|
||||
mpctx->stop_play = PT_QUIT;
|
||||
mpctx->stop_play = PT_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue