"dvr", "Recording completed: \"%s\"",
de->de_filename ?: lang_str_get(de->de_title, NULL));
+ } else if(sm->sm_code == SM_CODE_SOURCE_RECONFIGURED) {
+ muxer_reconfigure(de->de_mux, sm->sm_data);
} else {
if(de->de_last_error != sm->sm_code) {
}
+/**
+ * sanity wrapper arround m_reconfigure()
+ */
+int
+muxer_reconfigure(muxer_t *m, const struct streaming_start *ss)
+{
+ if(!m || !ss)
+ return -1;
+
+ return m->m_reconfigure(m, ss);
+}
+
+
/**
* sanity wrapper arround m_open_file()
*/
int (*m_init) (struct muxer *, // Init The muxer with streams
const struct streaming_start *,
const char *);
+ int (*m_reconfigure)(struct muxer *, // Reconfigure the muxer on
+ const struct streaming_start *); // stream changes
int (*m_close) (struct muxer *); // Close the muxer
void (*m_destroy) (struct muxer *); // Free the memory
int (*m_write_meta) (struct muxer *, struct epg_broadcast *); // Append epg data
int muxer_open_file (muxer_t *m, const char *filename);
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_close (muxer_t *m);
int muxer_destroy (muxer_t *m);
int muxer_write_meta (muxer_t *m, struct epg_broadcast *eb);
/**
- * Init the passthrough muxer with streams
+ * Generate the pmt and pat from a streaming start message
*/
static int
-pass_muxer_init(muxer_t* m, const struct streaming_start *ss, const char *name)
+pass_muxer_reconfigure(muxer_t* m, const struct streaming_start *ss)
{
pass_muxer_t *pm = (pass_muxer_t*)m;
}
+/**
+ * Init the passthrough muxer with streams
+ */
+static int
+pass_muxer_init(muxer_t* m, const struct streaming_start *ss, const char *name)
+{
+ return pass_muxer_reconfigure(m, ss);
+}
+
+
/**
* Open the muxer as a stream muxer (using a non-seekable socket)
*/
pm->m_open_stream = pass_muxer_open_stream;
pm->m_open_file = pass_muxer_open_file;
pm->m_init = pass_muxer_init;
+ pm->m_reconfigure = pass_muxer_reconfigure;
pm->m_mime = pass_muxer_mime;
pm->m_write_meta = pass_muxer_write_meta;
pm->m_write_pkt = pass_muxer_write_pkt;
}
+/**
+ * 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.
+ */
+static int
+tvh_muxer_reconfigure(muxer_t* m, const struct streaming_start *ss)
+{
+ tvh_muxer_t *tm = (tvh_muxer_t*)m;
+
+ tm->m_errors++;
+
+ return -1;
+}
+
+
/**
* Open the muxer as a stream muxer (using a non-seekable socket)
*/
tm->m_open_file = tvh_muxer_open_file;
tm->m_mime = tvh_muxer_mime;
tm->m_init = tvh_muxer_init;
+ tm->m_reconfigure = tvh_muxer_reconfigure;
tm->m_write_meta = tvh_muxer_write_meta;
tm->m_write_pkt = tvh_muxer_write_pkt;
tm->m_close = tvh_muxer_close;
break;
case SMT_STOP:
- tvhlog(LOG_WARNING, "webui", "Stop streaming %s, %s", hc->hc_url_orig,
- streaming_code2txt(sm->sm_code));
- run = 0;
+ if(sm->sm_code == SM_CODE_SOURCE_RECONFIGURED) {
+ muxer_reconfigure(mux, sm->sm_data);
+ } else {
+ tvhlog(LOG_WARNING, "webui", "Stop streaming %s, %s", hc->hc_url_orig,
+ streaming_code2txt(sm->sm_code));
+ run = 0;
+ }
break;
case SMT_SERVICE_STATUS: