History

client API: add MPV_END_FILE_REASON_REDIRECT

Requested. Minor incompatible behavior change, as it was signalling MPV_END_FILE_REASON_EOF previously.

wm4 committed 11 years ago

Commit e53cb081 parent 87b60de3 files · +17 −3Browse files

Unified · Split

3 files
  1. DOCS/client-api-changes.rst +3 −0
  2. libmpv/client.h +10 −1
  3. player/loadfile.c +4 −2
DOCS/client-api-changes.rst+3−0
@@ -32,6 +32,9 @@ API changes · 31 unmodified lines
32 32
33::33::
34 34
35 1.18 - add MPV_END_FILE_REASON_REDIRECT, and change behavior of
36 MPV_EVENT_END_FILE accordingly
37 - a bunch of interface-changes.rst changes
35 1.17 - mpv_initialize() now blocks SIGPIPE (details see client.h)38 1.17 - mpv_initialize() now blocks SIGPIPE (details see client.h)
36 --- mpv 0.9.0 is released ---39 --- mpv 0.9.0 is released ---
37 1.16 - add mpv_opengl_cb_report_flip()40 1.16 - add mpv_opengl_cb_report_flip()
libmpv/client.h+10−1
@@ -198,7 +198,7 @@ extern "C" { · 197 unmodified lines
198 * relational operators (<, >, <=, >=).198 * relational operators (<, >, <=, >=).
199 */199 */
200#define MPV_MAKE_VERSION(major, minor) (((major) << 16) | (minor) | 0UL)200#define MPV_MAKE_VERSION(major, minor) (((major) << 16) | (minor) | 0UL)
201#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION(1, 17)201#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION(1, 18)
202 202
203/**203/**
204 * Return the MPV_CLIENT_API_VERSION the mpv source has been compiled with.204 * Return the MPV_CLIENT_API_VERSION the mpv source has been compiled with.
@@ -1307,6 +1307,15 @@ typedef enum mpv_end_file_reason { · 1102 unmodified lines
1307 * mpv_event_end_file.error will be set.1307 * mpv_event_end_file.error will be set.
1308 */1308 */
1309 MPV_END_FILE_REASON_ERROR = 4,1309 MPV_END_FILE_REASON_ERROR = 4,
1310 /**
1311 * The file was a playlist or similar. When the playlist is read, its
1312 * entries will be appended to the playlist after the entry of the current
1313 * file, the entry of the current file is removed, and a MPV_EVENT_END_FILE
1314 * event is sent with reason set to MPV_END_FILE_REASON_REDIRECT. Then
1315 * playback continues with the playlist contents.
1316 * Since API version 1.18.
1317 */
1318 MPV_END_FILE_REASON_REDIRECT = 5,
1310} mpv_end_file_reason;1319} mpv_end_file_reason;
1311 1320
1312typedef struct mpv_event_end_file {1321typedef struct mpv_event_end_file {
player/loadfile.c+4−2
@@ -1130,7 +1130,7 @@ goto_reopen_demuxer: ; · 1129 unmodified lines
1130 e->stream_flags |= entry_stream_flags;1130 e->stream_flags |= entry_stream_flags;
1131 transfer_playlist(mpctx, pl);1131 transfer_playlist(mpctx, pl);
1132 mp_notify_property(mpctx, "playlist");1132 mp_notify_property(mpctx, "playlist");
1133 mpctx->error_playing = 1;1133 mpctx->error_playing = 2;
1134 goto terminate_playback;1134 goto terminate_playback;
1135 }1135 }
1136 1136
@@ -1300,11 +1300,13 @@ terminate_playback: · 163 unmodified lines
1300 case PT_ERROR:1300 case PT_ERROR:
1301 case AT_END_OF_FILE:1301 case AT_END_OF_FILE:
1302 {1302 {
1303 if (mpctx->error_playing >= 0 && nothing_played)1303 if (mpctx->error_playing == 0 && nothing_played)
1304 mpctx->error_playing = MPV_ERROR_NOTHING_TO_PLAY;1304 mpctx->error_playing = MPV_ERROR_NOTHING_TO_PLAY;
1305 if (mpctx->error_playing < 0) {1305 if (mpctx->error_playing < 0) {
1306 end_event.error = mpctx->error_playing;1306 end_event.error = mpctx->error_playing;
1307 end_event.reason = MPV_END_FILE_REASON_ERROR;1307 end_event.reason = MPV_END_FILE_REASON_ERROR;
1308 } else if (mpctx->error_playing == 2) {
1309 end_event.reason = MPV_END_FILE_REASON_REDIRECT;
1308 } else {1310 } else {
1309 end_event.reason = MPV_END_FILE_REASON_EOF;1311 end_event.reason = MPV_END_FILE_REASON_EOF;
1310 }1312 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t