mpegtsmux: Resend initial segments and header sections after FLUSH_STOP
authorSebastian Dröge <sebastian@centricular.com>
Thu, 29 Mar 2018 16:03:45 +0000 (19:03 +0300)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 3 Apr 2018 11:38:15 +0000 (14:38 +0300)
https://bugzilla.gnome.org/show_bug.cgi?id=794816

gst/mpegtsmux/mpegtsmux.c

index 99562fd..3e07f4b 100644 (file)
@@ -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;
   }