Requested. Minor incompatible behavior change, as it was signalling MPV_END_FILE_REASON_EOF previously.
Unified · Split
| @@ -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 | 38 | 1.17 - mpv_initialize() now blocks SIGPIPE (details see client.h) |
| 36 | 39 | --- mpv 0.9.0 is released --- |
| 37 | 40 | 1.16 - add mpv_opengl_cb_report_flip() |
| @@ -198,7 +198,7 @@ extern "C" { · 197 unmodified lines | ||
| 198 | 198 | * relational operators (<, >, <=, >=). |
| 199 | 199 | */ |
| 200 | 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 | 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 | 1307 | * mpv_event_end_file.error will be set. |
| 1308 | 1308 | */ |
| 1309 | 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 | 1319 | } mpv_end_file_reason; |
| 1311 | 1320 | |
| 1312 | 1321 | typedef struct mpv_event_end_file { |
| @@ -1130,7 +1130,7 @@ goto_reopen_demuxer: ; · 1129 unmodified lines | ||
| 1130 | 1130 | e->stream_flags |= entry_stream_flags; |
| 1131 | 1131 | transfer_playlist(mpctx, pl); |
| 1132 | 1132 | mp_notify_property(mpctx, "playlist"); |
| 1133 | − mpctx->error_playing = 1; | |
| 1133 | + mpctx->error_playing = 2; | |
| 1134 | 1134 | goto terminate_playback; |
| 1135 | 1135 | } |
| 1136 | 1136 | |
| @@ -1300,11 +1300,13 @@ terminate_playback: · 163 unmodified lines | ||
| 1300 | 1300 | case PT_ERROR: |
| 1301 | 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 | 1304 | mpctx->error_playing = MPV_ERROR_NOTHING_TO_PLAY; |
| 1305 | 1305 | if (mpctx->error_playing < 0) { |
| 1306 | 1306 | end_event.error = mpctx->error_playing; |
| 1307 | 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 | 1310 | } else { |
| 1309 | 1311 | end_event.reason = MPV_END_FILE_REASON_EOF; |
| 1310 | 1312 | } |