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
3232
3333 ::
3434
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
3538 1.17 - mpv_initialize() now blocks SIGPIPE (details see client.h)
3639 --- mpv 0.9.0 is released ---
3740 1.16 - add mpv_opengl_cb_report_flip()
libmpv/client.h+10−1
@@ -198,7 +198,7 @@ extern "C" { · 197 unmodified lines
198198 * relational operators (<, >, <=, >=).
199199 */
200200 #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)
202202
203203 /**
204204 * 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
13071307 * mpv_event_end_file.error will be set.
13081308 */
13091309 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,
13101319 } mpv_end_file_reason;
13111320
13121321 typedef struct mpv_event_end_file {
player/loadfile.c+4−2
@@ -1130,7 +1130,7 @@ goto_reopen_demuxer: ; · 1129 unmodified lines
11301130 e->stream_flags |= entry_stream_flags;
11311131 transfer_playlist(mpctx, pl);
11321132 mp_notify_property(mpctx, "playlist");
1133− mpctx->error_playing = 1;
1133+ mpctx->error_playing = 2;
11341134 goto terminate_playback;
11351135 }
11361136
@@ -1300,11 +1300,13 @@ terminate_playback: · 163 unmodified lines
13001300 case PT_ERROR:
13011301 case AT_END_OF_FILE:
13021302 {
1303− if (mpctx->error_playing >= 0 && nothing_played)
1303+ if (mpctx->error_playing == 0 && nothing_played)
13041304 mpctx->error_playing = MPV_ERROR_NOTHING_TO_PLAY;
13051305 if (mpctx->error_playing < 0) {
13061306 end_event.error = mpctx->error_playing;
13071307 end_event.reason = MPV_END_FILE_REASON_ERROR;
1308+ } else if (mpctx->error_playing == 2) {
1309+ end_event.reason = MPV_END_FILE_REASON_REDIRECT;
13081310 } else {
13091311 end_event.reason = MPV_END_FILE_REASON_EOF;
13101312 }

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