summaryrefslogtreecommitdiff
path: root/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-mpegtsmux-Need-get-pid-when-create-streams.patch
blob: 4e5a455df31f8b123a1fe0cad53529a00833c44f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From 0d97f9e8693a498d10ea9ad68caa4f6305c1114e Mon Sep 17 00:00:00 2001
From: Song Bing <b06498@freescale.com>
Date: Wed, 22 Apr 2015 18:06:35 +0800
Subject: [PATCH 01/26] 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.

Upstream-Status: Pending [https://bugzilla.gnome.org/show_bug.cgi?id=748288]

---
 gst/mpegtsmux/mpegtsmux.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/gst/mpegtsmux/mpegtsmux.c b/gst/mpegtsmux/mpegtsmux.c
index 67c2b72..cfd7c2a 100644
--- a/gst/mpegtsmux/mpegtsmux.c
+++ b/gst/mpegtsmux/mpegtsmux.c
@@ -833,6 +833,21 @@ mpegtsmux_create_streams (MpegTsMux * mux)
       } 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 =
-- 
1.9.1