From 7a2110a4993da33b9513c58ae0ac8ee1945a5faf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 29 Mar 2018 19:03:45 +0300 Subject: [PATCH] mpegtsmux: Resend initial segments and header sections after FLUSH_STOP https://bugzilla.gnome.org/show_bug.cgi?id=794816 --- gst/mpegtsmux/mpegtsmux.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/gst/mpegtsmux/mpegtsmux.c b/gst/mpegtsmux/mpegtsmux.c index 99562fd45e..3e07f4bfd7 100644 --- a/gst/mpegtsmux/mpegtsmux.c +++ b/gst/mpegtsmux/mpegtsmux.c @@ -1086,6 +1086,25 @@ mpegtsmux_sink_event (GstCollectPads * pads, GstCollectData * data, } break; } + case GST_EVENT_FLUSH_STOP:{ + GList *cur; + + /* Send initial segments again after a flush-stop, and also resend the + * header sections */ + mux->first = TRUE; + + /* output PAT, SI tables */ + tsmux_resend_pat (mux->tsmux); + tsmux_resend_si (mux->tsmux); + + /* output PMT for each program */ + for (cur = mux->tsmux->programs; cur; cur = cur->next) { + TsMuxProgram *program = (TsMuxProgram *) cur->data; + + tsmux_resend_pmt (program); + } + break; + } default: break; }