}
+/**
+ * sanity wrapper arround m_add_marker()
+ */
+int
+muxer_add_marker(muxer_t *m)
+{
+ if(!m)
+ return -1;
+
+ return m->m_add_marker(m);
+}
+
/**
* sanity wrapper arround m_open_file()
*/
int (*m_write_pkt) (struct muxer *, // Append a media packet
streaming_message_type_t,
void *);
+ int (*m_add_marker) (struct muxer *); // Add a marker (or chapter)
int m_errors; // Number of errors
muxer_container_type_t m_container; // The type of the container
int muxer_open_stream (muxer_t *m, int fd);
int muxer_init (muxer_t *m, const struct streaming_start *ss, const char *name);
int muxer_reconfigure (muxer_t *m, const struct streaming_start *ss);
+int muxer_add_marker (muxer_t *m);
int muxer_close (muxer_t *m);
int muxer_destroy (muxer_t *m);
int muxer_write_meta (muxer_t *m, struct epg_broadcast *eb);
}
+/**
+ * Insert a new chapter at the current location
+ */
+static int
+tvh_muxer_add_marker(muxer_t* m)
+{
+ tvh_muxer_t *tm = (tvh_muxer_t*)m;
+
+ if(mk_mux_insert_chapter(tm->tm_ref)) {
+ tm->m_errors++;
+ return -1;
+ }
+
+ return 0;
+}
+
+
/**
* Multisegment matroska files do exist but I am not sure if they are supported
* by many media players. For now, we'll treat it as an error.
tm->m_mime = tvh_muxer_mime;
tm->m_init = tvh_muxer_init;
tm->m_reconfigure = tvh_muxer_reconfigure;
+ tm->m_add_marker = tvh_muxer_add_marker;
tm->m_write_meta = tvh_muxer_write_meta;
tm->m_write_pkt = tvh_muxer_write_pkt;
tm->m_close = tvh_muxer_close;