summaryrefslogtreecommitdiffstats
path: root/player/loadfile.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-06-11 21:39:48 +0200
committerwm4 <wm4@nowhere>2015-06-11 21:42:09 +0200
commite53cb0890e8071ca86271c8b100343944dbbefe7 (patch)
tree155073a38d2f073f412baf1c6fd7da2eea9b803d /player/loadfile.c
parent87b60ded88f2cfb54636f88324a715a943f14fb9 (diff)
downloadmpv-e53cb0890e8071ca86271c8b100343944dbbefe7.tar.bz2
mpv-e53cb0890e8071ca86271c8b100343944dbbefe7.tar.xz
client API: add MPV_END_FILE_REASON_REDIRECT
Requested. Minor incompatible behavior change, as it was signalling MPV_END_FILE_REASON_EOF previously.
Diffstat (limited to 'player/loadfile.c')
-rw-r--r--player/loadfile.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/player/loadfile.c b/player/loadfile.c
index 93ebd73df6..6b25706055 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -1130,7 +1130,7 @@ goto_reopen_demuxer: ;
e->stream_flags |= entry_stream_flags;
transfer_playlist(mpctx, pl);
mp_notify_property(mpctx, "playlist");
- mpctx->error_playing = 1;
+ mpctx->error_playing = 2;
goto terminate_playback;
}
@@ -1300,11 +1300,13 @@ terminate_playback:
case PT_ERROR:
case AT_END_OF_FILE:
{
- if (mpctx->error_playing >= 0 && nothing_played)
+ if (mpctx->error_playing == 0 && nothing_played)
mpctx->error_playing = MPV_ERROR_NOTHING_TO_PLAY;
if (mpctx->error_playing < 0) {
end_event.error = mpctx->error_playing;
end_event.reason = MPV_END_FILE_REASON_ERROR;
+ } else if (mpctx->error_playing == 2) {
+ end_event.reason = MPV_END_FILE_REASON_REDIRECT;
} else {
end_event.reason = MPV_END_FILE_REASON_EOF;
}