mpegtsmux: Need get pid when create streams.
when camerabin use mpegtsmux as muxer, start video recording and then
stop video recording and then start video recording, mpegtsmux get wrong
pid.
https://bugzilla.gnome.org/show_bug.cgi?id=748288
UpStream Status: Pending
diff --git a/gst/mpegtsmux/mpegtsmux.c b/gst/mpegtsmux/mpegtsmux.c
index 99562fd..0d921f4 100644
--- a/gst/mpegtsmux/mpegtsmux.c
+++ b/gst/mpegtsmux/mpegtsmux.c
@@ -954,6 +954,21 @@
} else {
ts_data->prog_id = DEFAULT_PROG_ID;
}
+
+ if (!ts_data->pid) {
+ gint pid = -1;
+
+ name = GST_PAD_NAME (c_data->pad);
+ if (name != NULL && sscanf (name, "sink_%d", &pid) == 1) {
+ if (tsmux_find_stream (mux->tsmux, pid)) {
+ GST_WARNING_OBJECT (mux, "Duplicate PID");
+ }
+ } else {
+ pid = tsmux_get_new_pid (mux->tsmux);
+ }
+
+ ts_data->pid = pid;
+ }
}
ts_data->prog =