summaryrefslogtreecommitdiffstats
path: root/libmpv
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-10-08 13:11:55 +0200
committerwm4 <wm4@nowhere>2014-10-08 13:11:55 +0200
commitf73778ad82685bd15c40e20b9983ce460d9c3226 (patch)
tree01556613b5a1ba36e91f93b9e891aae7d05347ac /libmpv
parent2632ea3de618bc8b1e533260d9bb3aec277a80b3 (diff)
downloadmpv-f73778ad82685bd15c40e20b9983ce460d9c3226.tar.bz2
mpv-f73778ad82685bd15c40e20b9983ce460d9c3226.tar.xz
msg, client API: buffer partial lines
The API could return partial lines, meaning the message could stop in the middle of a line, and the next message would have the rest of it (or just the next part of it). This was a pain for the user, so do the nasty task of buffering the lines ourselves. Now only complete lines are sent. To make things even easier for the API user, don't put multiple lines into a single event, but split them. The terminal output code needed something similar (inserting a prefix header on start of each line). To avoid code duplication, this commit refactors the terminal output so that lines are split in a single place.
Diffstat (limited to 'libmpv')
-rw-r--r--libmpv/client.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/libmpv/client.h b/libmpv/client.h
index c4df6a3fbf..98164ce813 100644
--- a/libmpv/client.h
+++ b/libmpv/client.h
@@ -1044,13 +1044,9 @@ typedef struct mpv_event_log_message {
*/
const char *level;
/**
- * The log message. Note that this is the direct output of a printf()
- * style output API. The text will contain embedded newlines, and it's
- * possible that a single message contains multiple lines, or that a
- * message contains a partial line.
- *
- * It's safe to display messages only if they end with a newline character,
- * and to buffer them otherwise.
+ * The log message. It consists of 1 line of text, and is terminated with
+ * a newline character. (Before API version 1.6, it could contain multiple
+ * or partial lines.)
*/
const char *text;
} mpv_event_log_message;