aboutsummaryrefslogtreecommitdiff
path: root/src/encoder_plugin.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-07-20 21:46:05 +0200
committerMax Kellermann <max@duempel.org>2011-07-20 21:46:05 +0200
commit0ea4c970d794d535ae6efb4d0ae2d3fe37980ae3 (patch)
treed08d18c852febad9d6da94dfbe31545dcf93b5d0 /src/encoder_plugin.h
parent57936a13741c09fa54a33a53ed05ac0d996e4807 (diff)
parent838f7cd210dbd3f071d48d54c168c123c3d20c58 (diff)
Merge branch 'v0.16.x'
Conflicts: src/player_thread.c src/playlist_control.c
Diffstat (limited to 'src/encoder_plugin.h')
-rw-r--r--src/encoder_plugin.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/encoder_plugin.h b/src/encoder_plugin.h
index 4a6e3805..95b3da01 100644
--- a/src/encoder_plugin.h
+++ b/src/encoder_plugin.h
@@ -50,6 +50,8 @@ struct encoder_plugin {
bool (*flush)(struct encoder *encoder, GError **error);
+ bool (*pre_tag)(struct encoder *encoder, GError **error);
+
bool (*tag)(struct encoder *encoder, const struct tag *tag,
GError **error);
@@ -148,8 +150,30 @@ encoder_flush(struct encoder *encoder, GError **error)
}
/**
+ * Prepare for sending a tag to the encoder. This is used by some
+ * encoders to flush the previous sub-stream, in preparation to begin
+ * a new one.
+ *
+ * @param encoder the encoder
+ * @param tag the tag object
+ * @param error location to store the error occuring, or NULL to ignore errors.
+ * @return true on success
+ */
+static inline bool
+encoder_pre_tag(struct encoder *encoder, GError **error)
+{
+ /* this method is optional */
+ return encoder->plugin->pre_tag != NULL
+ ? encoder->plugin->pre_tag(encoder, error)
+ : true;
+}
+
+/**
* Sends a tag to the encoder.
*
+ * Instructions: call encoder_pre_tag(); then obtain flushed data with
+ * encoder_read(); finally call encoder_tag().
+ *
* @param encoder the encoder
* @param tag the tag object
* @param error location to store the error occurring, or NULL to ignore errors.