1 |
commit: 9dd555c6390023e972d0854609b19af438e31f4d |
2 |
Author: Mart Raudsepp <leio <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Dec 12 16:49:13 2017 +0000 |
4 |
Commit: Mart Raudsepp <leio <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Dec 12 16:54:56 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9dd555c6 |
7 |
|
8 |
media-libs/gst-plugins-bad: remove old |
9 |
|
10 |
Package-Manager: Portage-2.3.16, Repoman-2.3.6 |
11 |
|
12 |
media-libs/gst-plugins-bad/Manifest | 1 - |
13 |
.../files/1.10.3-CVE-2017-5848.patch | 951 --------------------- |
14 |
.../gst-plugins-bad/gst-plugins-bad-1.10.3.ebuild | 105 --- |
15 |
3 files changed, 1057 deletions(-) |
16 |
|
17 |
diff --git a/media-libs/gst-plugins-bad/Manifest b/media-libs/gst-plugins-bad/Manifest |
18 |
index 7f5245f5df5..4eee864e687 100644 |
19 |
--- a/media-libs/gst-plugins-bad/Manifest |
20 |
+++ b/media-libs/gst-plugins-bad/Manifest |
21 |
@@ -1,5 +1,4 @@ |
22 |
DIST gst-plugins-bad-0.10.23-h264-patches.tar.xz 5284 BLAKE2B 90ad2a742de6d6b3efedb1a2fc16a9f24cf0566fd455a27f113afa0fc2ceff5f2517a31e8db8ed6ed8b4c92595b333a29dbb451077975f3d726808976f4a8671 SHA512 528ed30edb544dd970047fd4b0f05bf75f9f49f07a8118f805430c56c3ec75643013799491aeba70c62cb0343cd3e72758bf5c167d00e90a6a3f13857e4860e1 |
23 |
DIST gst-plugins-bad-0.10.23.tar.xz 3155044 BLAKE2B 86ed955fb5c73f2145b8f8ed2daaeffd9975362e81c3ca911be00d18f6b6d975381651071eb54514ef94a931f1fc89e673dc8c1d68e10de132bbe51accb6d165 SHA512 6437dd12707ef29651f4014b54612cf2a3a42ed4e05a1c5f4a432d80e27efd2abc0df891ebcfdc9e7b2cf9f71a15b88e48b3aa6db24a178ed6de3b1bdf4c3dc4 |
24 |
-DIST gst-plugins-bad-1.10.3.tar.xz 4734656 BLAKE2B d85a1f70ab759056d048051048eaf85b1c16621fa9bacacb4ca83c8cd2b21e05815393850b06581093334371ea771c9929595332352d107224e1d4791ee87427 SHA512 028e2c579d6e41fed2a3b7de91f3e0eac08fecd52bd67f198437909025aa41dbf4fd7ddd76decd989f8c4ca7664fad3517b403b326d8ef297bfdd006b5d79944 |
25 |
DIST gst-plugins-bad-1.10.5.tar.xz 4737820 BLAKE2B e050813b59be50792d290a171e9e0fd90ce05c8c012625548e29ef9b551964597b0655c206e0444953ecfc2bad0b8dfee6c8766615fa82a76cf856d355ba94fc SHA512 03a1b712084ace16b933b708e19922aef4f9b5f7ba0408c35865e699d70bd19e73121594449355b6252a31d9085602d8bef581fe14cfdf6c9fdcf2ddcea21e1a |
26 |
DIST gst-plugins-bad-1.12.3.tar.xz 4707000 BLAKE2B 1cb82e6f1c20d24a42ed0c7465e4dd8815627b0e716fe9be5d005ddd609c92a08619214a6b15059e7f537dadbc36c34d4c6ebfde1284c6a6029d2edf89bf9fa2 SHA512 6df47381de3a2f4286d047c1e7de2c76dd4312c9806636e2012717282cde0f3e5b2d0ffa910c564c8e122b19363e842b663cce1eda7ae95a05d63d1dbbd52661 |
27 |
|
28 |
diff --git a/media-libs/gst-plugins-bad/files/1.10.3-CVE-2017-5848.patch b/media-libs/gst-plugins-bad/files/1.10.3-CVE-2017-5848.patch |
29 |
deleted file mode 100644 |
30 |
index fdc604ada9d..00000000000 |
31 |
--- a/media-libs/gst-plugins-bad/files/1.10.3-CVE-2017-5848.patch |
32 |
+++ /dev/null |
33 |
@@ -1,951 +0,0 @@ |
34 |
-From 96f9b83eed617886fefa0ec5682e072f65eafc8b Mon Sep 17 00:00:00 2001 |
35 |
-From: Jan Schmidt <jan@×××××××××××.com> |
36 |
-Date: Wed, 1 Feb 2017 14:25:32 +1100 |
37 |
-Subject: [PATCH] psdemux: Rewrite PSM parsing using GstByteReader |
38 |
- |
39 |
-Avoid possible buffer overflows and ignore invalid PSM packets better |
40 |
-by using GstByteReader. |
41 |
- |
42 |
-https://bugzilla.gnome.org/show_bug.cgi?id=777957 |
43 |
---- |
44 |
- gst/mpegdemux/Makefile.am | 2 +- |
45 |
- gst/mpegdemux/gstmpegdemux.c | 322 ++++++++++++++++--------------------------- |
46 |
- 2 files changed, 117 insertions(+), 207 deletions(-) |
47 |
- |
48 |
-diff --git a/gst/mpegdemux/Makefile.am b/gst/mpegdemux/Makefile.am |
49 |
-index df59955..dd43134 100644 |
50 |
---- a/gst/mpegdemux/Makefile.am |
51 |
-+++ b/gst/mpegdemux/Makefile.am |
52 |
-@@ -11,7 +11,7 @@ libgstmpegpsdemux_la_CFLAGS = \ |
53 |
- libgstmpegpsdemux_la_LIBADD = \ |
54 |
- $(GST_PLUGINS_BASE_LIBS) -lgsttag-$(GST_API_VERSION) \ |
55 |
- -lgstpbutils-$(GST_API_VERSION) \ |
56 |
-- $(GST_BASE_LIBS) $(GST_LIBS) |
57 |
-+ $(GST_BASE_LIBS) -lgstbase-$(GST_API_VERSION) $(GST_LIBS) |
58 |
- libgstmpegpsdemux_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) |
59 |
- libgstmpegpsdemux_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) |
60 |
- |
61 |
-diff --git a/gst/mpegdemux/gstmpegdemux.c b/gst/mpegdemux/gstmpegdemux.c |
62 |
-index b608db8..755e8e6 100644 |
63 |
---- a/gst/mpegdemux/gstmpegdemux.c |
64 |
-+++ b/gst/mpegdemux/gstmpegdemux.c |
65 |
-@@ -50,6 +50,7 @@ |
66 |
- |
67 |
- #include <gst/tag/tag.h> |
68 |
- #include <gst/pbutils/pbutils.h> |
69 |
-+#include <gst/base/gstbytereader.h> |
70 |
- |
71 |
- #include "gstmpegdefs.h" |
72 |
- #include "gstmpegdemux.h" |
73 |
-@@ -2062,42 +2063,48 @@ need_more_data: |
74 |
- static GstFlowReturn |
75 |
- gst_ps_demux_parse_psm (GstPsDemux * demux) |
76 |
- { |
77 |
-- guint16 length = 0, info_length = 0, es_map_length = 0; |
78 |
-+ guint16 psm_length, info_length = 0, es_map_length = 0; |
79 |
- guint8 psm_version = 0; |
80 |
-- const guint8 *data, *es_map_base; |
81 |
-+ GstByteReader br; |
82 |
- #ifndef GST_DISABLE_GST_DEBUG |
83 |
- gboolean applicable; |
84 |
- #endif |
85 |
- |
86 |
-+ /* Need at least 6 bytes for start code + length */ |
87 |
- if (gst_adapter_available (demux->adapter) < 6) |
88 |
- goto need_more_data; |
89 |
- |
90 |
-- /* start code + length */ |
91 |
-- data = gst_adapter_map (demux->adapter, 6); |
92 |
-- |
93 |
-- /* skip start code */ |
94 |
-- data += 4; |
95 |
-+ { |
96 |
-+ const guint8 *data; |
97 |
- |
98 |
-- length = GST_READ_UINT16_BE (data); |
99 |
-- GST_DEBUG_OBJECT (demux, "length %u", length); |
100 |
-+ /* start code + length */ |
101 |
-+ data = gst_adapter_map (demux->adapter, 6); |
102 |
-+ /* skip start code */ |
103 |
-+ data += 4; |
104 |
-+ psm_length = GST_READ_UINT16_BE (data); |
105 |
-+ GST_DEBUG_OBJECT (demux, "PSM length %u", psm_length); |
106 |
- |
107 |
-- if (G_UNLIKELY (length > 0x3FA)) |
108 |
-- goto psm_len_error; |
109 |
-+ if (G_UNLIKELY (psm_length > 0x3FA)) |
110 |
-+ goto psm_len_error; |
111 |
-+ psm_length += 6; /* Add start code + size to length */ |
112 |
- |
113 |
-- length += 6; |
114 |
-+ gst_adapter_unmap (demux->adapter); |
115 |
- |
116 |
-- gst_adapter_unmap (demux->adapter); |
117 |
-+ if (gst_adapter_available (demux->adapter) < psm_length) |
118 |
-+ goto need_more_data; |
119 |
- |
120 |
-- if (gst_adapter_available (demux->adapter) < length) |
121 |
-- goto need_more_data; |
122 |
-+ data = gst_adapter_map (demux->adapter, psm_length); |
123 |
- |
124 |
-- data = gst_adapter_map (demux->adapter, length); |
125 |
-+ gst_byte_reader_init (&br, data, psm_length); |
126 |
-+ } |
127 |
- |
128 |
- /* skip start code and length */ |
129 |
-- data += 6; |
130 |
-+ if (!gst_byte_reader_skip (&br, 6)) |
131 |
-+ goto fail_invalid; |
132 |
- |
133 |
- /* Read PSM applicable bit together with version */ |
134 |
-- psm_version = GST_READ_UINT8 (data); |
135 |
-+ if (!gst_byte_reader_get_uint8 (&br, &psm_version)) |
136 |
-+ goto fail_invalid; |
137 |
- #ifndef GST_DISABLE_GST_DEBUG |
138 |
- applicable = (psm_version & 0x80) >> 7; |
139 |
- #endif |
140 |
-@@ -2105,62 +2112,70 @@ gst_ps_demux_parse_psm (GstPsDemux * demux) |
141 |
- GST_DEBUG_OBJECT (demux, "PSM version %u (applicable now %u)", psm_version, |
142 |
- applicable); |
143 |
- |
144 |
-- /* Jump over version and marker bit */ |
145 |
-- data += 2; |
146 |
-+ /* Jump over the next byte (marker bit) */ |
147 |
-+ if (!gst_byte_reader_skip (&br, 1)) |
148 |
-+ goto fail_invalid; |
149 |
- |
150 |
- /* Read PS info length */ |
151 |
-- info_length = GST_READ_UINT16_BE (data); |
152 |
-- /* Cap it to PSM length - needed bytes for ES map length and CRC */ |
153 |
-- info_length = MIN (length - 16, info_length); |
154 |
-+ if (!gst_byte_reader_get_uint16_be (&br, &info_length)) |
155 |
-+ goto fail_invalid; |
156 |
- GST_DEBUG_OBJECT (demux, "PS info length %u bytes", info_length); |
157 |
-- |
158 |
-- /* Jump over that section */ |
159 |
-- data += (2 + info_length); |
160 |
-+ /* Skip the PS info, we don't use it */ |
161 |
-+ if (!gst_byte_reader_skip (&br, info_length)) |
162 |
-+ goto fail_invalid; |
163 |
- |
164 |
- /* Read ES map length */ |
165 |
-- es_map_length = GST_READ_UINT16_BE (data); |
166 |
-- /* Cap it to PSM remaining length - CRC */ |
167 |
-- es_map_length = MIN (length - (16 + info_length), es_map_length); |
168 |
-+ if (!gst_byte_reader_get_uint16_be (&br, &es_map_length)) |
169 |
-+ goto fail_invalid; |
170 |
- GST_DEBUG_OBJECT (demux, "ES map length %u bytes", es_map_length); |
171 |
- |
172 |
-- /* Jump over the size */ |
173 |
-- data += 2; |
174 |
-- |
175 |
- /* Now read the ES map */ |
176 |
-- es_map_base = data; |
177 |
-- while (es_map_base + 4 <= data + es_map_length) { |
178 |
-- guint8 stream_type = 0, stream_id = 0; |
179 |
-- guint16 stream_info_length = 0; |
180 |
-- |
181 |
-- stream_type = GST_READ_UINT8 (es_map_base); |
182 |
-- es_map_base++; |
183 |
-- stream_id = GST_READ_UINT8 (es_map_base); |
184 |
-- es_map_base++; |
185 |
-- stream_info_length = GST_READ_UINT16_BE (es_map_base); |
186 |
-- es_map_base += 2; |
187 |
-- /* Cap stream_info_length */ |
188 |
-- stream_info_length = MIN (data + es_map_length - es_map_base, |
189 |
-- stream_info_length); |
190 |
-- |
191 |
-- GST_DEBUG_OBJECT (demux, "Stream type %02X with id %02X and %u bytes info", |
192 |
-- stream_type, stream_id, stream_info_length); |
193 |
-- if (G_LIKELY (stream_id != 0xbd)) |
194 |
-- demux->psm[stream_id] = stream_type; |
195 |
-- else { |
196 |
-- /* Ignore stream type for private_stream_1 and discover it looking at |
197 |
-- * the stream data. |
198 |
-- * Fixes demuxing some clips with lpcm that was wrongly declared as |
199 |
-- * mpeg audio */ |
200 |
-- GST_DEBUG_OBJECT (demux, "stream type for private_stream_1 ignored"); |
201 |
-+ { |
202 |
-+ GstByteReader es_map_br; |
203 |
-+ if (!gst_byte_reader_get_sub_reader (&br, &es_map_br, es_map_length)) |
204 |
-+ goto fail_invalid; |
205 |
-+ |
206 |
-+ while (gst_byte_reader_get_remaining (&es_map_br) >= 4) { |
207 |
-+ guint8 stream_type = 0, stream_id = 0; |
208 |
-+ guint16 stream_info_length = 0; |
209 |
-+ |
210 |
-+ if (!gst_byte_reader_get_uint8 (&es_map_br, &stream_type) || |
211 |
-+ !gst_byte_reader_get_uint8 (&es_map_br, &stream_id) || |
212 |
-+ !gst_byte_reader_get_uint16_be (&es_map_br, &stream_info_length)) |
213 |
-+ break; |
214 |
-+ |
215 |
-+ GST_DEBUG_OBJECT (demux, |
216 |
-+ "Stream type %02X with id %02X and %u bytes info", stream_type, |
217 |
-+ stream_id, stream_info_length); |
218 |
-+ |
219 |
-+ if (G_LIKELY (stream_id != 0xbd)) |
220 |
-+ demux->psm[stream_id] = stream_type; |
221 |
-+ else { |
222 |
-+ /* Ignore stream type for private_stream_1 and discover it looking at |
223 |
-+ * the stream data. |
224 |
-+ * Fixes demuxing some clips with lpcm that was wrongly declared as |
225 |
-+ * mpeg audio */ |
226 |
-+ GST_DEBUG_OBJECT (demux, "stream type for private_stream_1 ignored"); |
227 |
-+ } |
228 |
-+ |
229 |
-+ /* FIXME: We could use the descriptors instead of skipping them */ |
230 |
-+ if (!gst_byte_reader_skip (&es_map_br, stream_info_length)) |
231 |
-+ break; |
232 |
- } |
233 |
-- es_map_base += stream_info_length; |
234 |
- } |
235 |
-+ /* We ignore the 4-byte CRC at the end */ |
236 |
- |
237 |
- gst_adapter_unmap (demux->adapter); |
238 |
-- gst_adapter_flush (demux->adapter, length); |
239 |
-- ADAPTER_OFFSET_FLUSH (length); |
240 |
-+ gst_adapter_flush (demux->adapter, psm_length); |
241 |
-+ ADAPTER_OFFSET_FLUSH (psm_length); |
242 |
- return GST_FLOW_OK; |
243 |
- |
244 |
-+fail_invalid: |
245 |
-+ GST_DEBUG_OBJECT (demux, "Failed to parse PSM. Skipping"); |
246 |
-+ gst_adapter_unmap (demux->adapter); |
247 |
-+ gst_adapter_flush (demux->adapter, psm_length); |
248 |
-+ ADAPTER_OFFSET_FLUSH (psm_length); |
249 |
-+ return GST_FLOW_LOST_SYNC; |
250 |
- psm_len_error: |
251 |
- { |
252 |
- GST_DEBUG_OBJECT (demux, "error in PSM length"); |
253 |
-@@ -2191,13 +2206,10 @@ gst_ps_demux_data_cb (GstPESFilter * filter, gboolean first, |
254 |
- GstMapInfo map; |
255 |
- gsize datalen; |
256 |
- guint offset = 0; |
257 |
-- |
258 |
- gst_buffer_map (buffer, &map, GST_MAP_READ); |
259 |
- datalen = map.size; |
260 |
-- |
261 |
- start_code = filter->start_code; |
262 |
- id = filter->id; |
263 |
-- |
264 |
- if (first) { |
265 |
- /* find the stream type */ |
266 |
- stream_type = demux->psm[id]; |
267 |
-@@ -2208,7 +2220,6 @@ gst_ps_demux_data_cb (GstPESFilter * filter, gboolean first, |
268 |
- * (see ftp://ftp.mplayerhq.hu/MPlayer/samples/MPEG-VOB/vdr-AC3) */ |
269 |
- if (datalen >= 4) { |
270 |
- guint hdr = GST_READ_UINT32_BE (map.data); |
271 |
-- |
272 |
- if (G_UNLIKELY ((hdr & 0xffff0000) == AC3_SYNC_WORD)) { |
273 |
- id = 0x80; |
274 |
- stream_type = demux->psm[id] = ST_GST_AUDIO_RAWA52; |
275 |
-@@ -2220,10 +2231,8 @@ gst_ps_demux_data_cb (GstPESFilter * filter, gboolean first, |
276 |
- /* new id is in the first byte */ |
277 |
- id = map.data[offset++]; |
278 |
- datalen--; |
279 |
-- |
280 |
- /* and remap */ |
281 |
- stream_type = demux->psm[id]; |
282 |
-- |
283 |
- /* Now, if it's a subpicture stream - no more, otherwise |
284 |
- * take the first byte too, since it's the frame count in audio |
285 |
- * streams and our backwards compat convention is to strip it off */ |
286 |
-@@ -2231,7 +2240,6 @@ gst_ps_demux_data_cb (GstPESFilter * filter, gboolean first, |
287 |
- /* Number of audio frames in this packet */ |
288 |
- #ifndef GST_DISABLE_GST_DEBUG |
289 |
- guint8 nframes; |
290 |
-- |
291 |
- nframes = map.data[offset]; |
292 |
- GST_LOG_OBJECT (demux, "private type 0x%02x, %d frames", id, |
293 |
- nframes); |
294 |
-@@ -2239,8 +2247,8 @@ gst_ps_demux_data_cb (GstPESFilter * filter, gboolean first, |
295 |
- offset++; |
296 |
- datalen--; |
297 |
- } else { |
298 |
-- GST_LOG_OBJECT (demux, "private type 0x%02x, stream type %d", id, |
299 |
-- stream_type); |
300 |
-+ GST_LOG_OBJECT (demux, "private type 0x%02x, stream type %d", |
301 |
-+ id, stream_type); |
302 |
- } |
303 |
- } |
304 |
- } |
305 |
-@@ -2253,7 +2261,6 @@ gst_ps_demux_data_cb (GstPESFilter * filter, gboolean first, |
306 |
- " (%" G_GUINT64_FORMAT ")", id, filter->pts, demux->next_pts); |
307 |
- } else |
308 |
- demux->next_pts = G_MAXUINT64; |
309 |
-- |
310 |
- if (filter->dts != -1) { |
311 |
- demux->next_dts = filter->dts + demux->scr_adjust; |
312 |
- GST_LOG_OBJECT (demux, "stream 0x%02x DTS = orig %" G_GUINT64_FORMAT |
313 |
-@@ -2290,7 +2297,6 @@ gst_ps_demux_data_cb (GstPESFilter * filter, gboolean first, |
314 |
- if (demux->current_stream->notlinked == FALSE) { |
315 |
- out_buf = |
316 |
- gst_buffer_copy_region (buffer, GST_BUFFER_COPY_ALL, offset, datalen); |
317 |
-- |
318 |
- ret = gst_ps_demux_send_data (demux, demux->current_stream, out_buf); |
319 |
- if (ret == GST_FLOW_NOT_LINKED) { |
320 |
- demux->current_stream->notlinked = TRUE; |
321 |
-@@ -2300,9 +2306,7 @@ gst_ps_demux_data_cb (GstPESFilter * filter, gboolean first, |
322 |
- done: |
323 |
- gst_buffer_unmap (buffer, &map); |
324 |
- gst_buffer_unref (buffer); |
325 |
-- |
326 |
- return ret; |
327 |
-- |
328 |
- /* ERRORS */ |
329 |
- unknown_stream_type: |
330 |
- { |
331 |
-@@ -2320,17 +2324,13 @@ gst_ps_demux_resync (GstPsDemux * demux, gboolean save) |
332 |
- guint32 code; |
333 |
- gint offset; |
334 |
- gboolean found; |
335 |
-- |
336 |
- avail = gst_adapter_available (demux->adapter); |
337 |
- if (G_UNLIKELY (avail < 4)) |
338 |
- goto need_data; |
339 |
-- |
340 |
- /* Common case, read 4 bytes an check it */ |
341 |
- data = gst_adapter_map (demux->adapter, 4); |
342 |
-- |
343 |
- /* read currect code */ |
344 |
- code = GST_READ_UINT32_BE (data); |
345 |
-- |
346 |
- /* The common case is that the sync code is at 0 bytes offset */ |
347 |
- if (G_LIKELY ((code & 0xffffff00) == 0x100L)) { |
348 |
- GST_LOG_OBJECT (demux, "Found resync code %08x after 0 bytes", code); |
349 |
-@@ -2344,16 +2344,12 @@ gst_ps_demux_resync (GstPsDemux * demux, gboolean save) |
350 |
- offset = 4; |
351 |
- if (offset >= avail) |
352 |
- goto need_data; /* Not enough data to find sync */ |
353 |
-- |
354 |
- data = gst_adapter_map (demux->adapter, avail); |
355 |
-- |
356 |
- do { |
357 |
- code = (code << 8) | data[offset++]; |
358 |
- found = (code & 0xffffff00) == 0x100L; |
359 |
- } while (offset < avail && !found); |
360 |
-- |
361 |
- gst_adapter_unmap (demux->adapter); |
362 |
-- |
363 |
- if (!save || demux->sink_segment.rate >= 0.0) { |
364 |
- GST_LOG_OBJECT (demux, "flushing %d bytes", offset - 4); |
365 |
- /* forward playback, we can discard and flush the skipped bytes */ |
366 |
-@@ -2384,7 +2380,6 @@ gst_ps_demux_resync (GstPsDemux * demux, gboolean save) |
367 |
- } |
368 |
- |
369 |
- return found; |
370 |
-- |
371 |
- need_data: |
372 |
- { |
373 |
- GST_LOG_OBJECT (demux, "we need more data for resync %d", avail); |
374 |
-@@ -2409,42 +2404,32 @@ gst_ps_demux_scan_ts (GstPsDemux * demux, const guint8 * data, |
375 |
- guint64 pts, dts; |
376 |
- guint32 code; |
377 |
- guint16 len; |
378 |
-- |
379 |
- /* read the 4 bytes for the sync code */ |
380 |
- code = GST_READ_UINT32_BE (data); |
381 |
- if (G_LIKELY (code != ID_PS_PACK_START_CODE)) |
382 |
- goto beach; |
383 |
-- |
384 |
- /* skip start code */ |
385 |
- data += 4; |
386 |
-- |
387 |
- scr1 = GST_READ_UINT32_BE (data); |
388 |
- scr2 = GST_READ_UINT32_BE (data + 4); |
389 |
-- |
390 |
- /* start parsing the stream */ |
391 |
- if ((*data & 0xc0) == 0x40) { |
392 |
- /* MPEG-2 PACK header */ |
393 |
- guint32 scr_ext; |
394 |
- guint32 next32; |
395 |
- guint8 stuffing_bytes; |
396 |
-- |
397 |
- /* :2=01 ! scr:3 ! marker:1==1 ! scr:15 ! marker:1==1 ! scr:15 */ |
398 |
-- |
399 |
- /* check markers */ |
400 |
- if ((scr1 & 0xc4000400) != 0x44000400) |
401 |
- goto beach; |
402 |
-- |
403 |
- scr = ((guint64) scr1 & 0x38000000) << 3; |
404 |
- scr |= ((guint64) scr1 & 0x03fff800) << 4; |
405 |
- scr |= ((guint64) scr1 & 0x000003ff) << 5; |
406 |
- scr |= ((guint64) scr2 & 0xf8000000) >> 27; |
407 |
-- |
408 |
- /* marker:1==1 ! scr_ext:9 ! marker:1==1 */ |
409 |
- if ((scr2 & 0x04010000) != 0x04010000) |
410 |
- goto beach; |
411 |
-- |
412 |
- scr_ext = (scr2 & 0x03fe0000) >> 17; |
413 |
-- |
414 |
- if (scr_ext) { |
415 |
- scr = (scr * 300 + scr_ext % 300) / 300; |
416 |
- } |
417 |
-@@ -2455,7 +2440,6 @@ gst_ps_demux_scan_ts (GstPsDemux * demux, const guint8 * data, |
418 |
- next32 = GST_READ_UINT32_BE (data); |
419 |
- if ((next32 & 0x00000300) != 0x00000300) |
420 |
- goto beach; |
421 |
-- |
422 |
- stuffing_bytes = (next32 & 0x07); |
423 |
- data += 4; |
424 |
- while (stuffing_bytes--) { |
425 |
-@@ -2467,10 +2451,8 @@ gst_ps_demux_scan_ts (GstPsDemux * demux, const guint8 * data, |
426 |
- /* check markers */ |
427 |
- if ((scr1 & 0xf1000100) != 0x21000100) |
428 |
- goto beach; |
429 |
-- |
430 |
- if ((scr2 & 0x01800001) != 0x01800001) |
431 |
- goto beach; |
432 |
-- |
433 |
- /* :4=0010 ! scr:3 ! marker:1==1 ! scr:15 ! marker:1==1 ! scr:15 ! marker:1==1 */ |
434 |
- scr = ((guint64) scr1 & 0x0e000000) << 5; |
435 |
- scr |= ((guint64) scr1 & 0x00fffe00) << 6; |
436 |
-@@ -2488,7 +2470,6 @@ gst_ps_demux_scan_ts (GstPsDemux * demux, const guint8 * data, |
437 |
- /* Possible optional System header here */ |
438 |
- code = GST_READ_UINT32_BE (data); |
439 |
- len = GST_READ_UINT16_BE (data + 4); |
440 |
-- |
441 |
- if (code == ID_PS_SYSTEM_HEADER_START_CODE) { |
442 |
- /* Found a system header, skip it */ |
443 |
- /* Check for sufficient data - system header, plus enough |
444 |
-@@ -2496,7 +2477,6 @@ gst_ps_demux_scan_ts (GstPsDemux * demux, const guint8 * data, |
445 |
- if (data + 6 + len + 6 > end) |
446 |
- return FALSE; |
447 |
- data += len + 6; |
448 |
-- |
449 |
- /* read the 4 bytes for the PES sync code */ |
450 |
- code = GST_READ_UINT32_BE (data); |
451 |
- len = GST_READ_UINT16_BE (data + 4); |
452 |
-@@ -2505,10 +2485,8 @@ gst_ps_demux_scan_ts (GstPsDemux * demux, const guint8 * data, |
453 |
- /* Check we have enough data left for reading the PES packet */ |
454 |
- if (data + 6 + len > end) |
455 |
- return FALSE; |
456 |
-- |
457 |
- if (!gst_ps_demux_is_pes_sync (code)) |
458 |
- goto beach; |
459 |
-- |
460 |
- switch (code) { |
461 |
- case ID_PS_PROGRAM_STREAM_MAP: |
462 |
- case ID_PRIVATE_STREAM_2: |
463 |
-@@ -2525,9 +2503,7 @@ gst_ps_demux_scan_ts (GstPsDemux * demux, const guint8 * data, |
464 |
- |
465 |
- /* skip sync code and size */ |
466 |
- data += 6; |
467 |
-- |
468 |
- pts = dts = -1; |
469 |
-- |
470 |
- /* stuffing bits, first two bits are '10' for mpeg2 pes so this code is |
471 |
- * not triggered. */ |
472 |
- while (TRUE) { |
473 |
-@@ -2539,7 +2515,6 @@ gst_ps_demux_scan_ts (GstPsDemux * demux, const guint8 * data, |
474 |
- /* STD buffer size, never for mpeg2 */ |
475 |
- if ((*data & 0xc0) == 0x40) |
476 |
- data += 2; |
477 |
-- |
478 |
- /* PTS but no DTS, never for mpeg2 */ |
479 |
- if ((*data & 0xf0) == 0x20) { |
480 |
- READ_TS (data, pts, beach); |
481 |
-@@ -2551,7 +2526,6 @@ gst_ps_demux_scan_ts (GstPsDemux * demux, const guint8 * data, |
482 |
- } else if ((*data & 0xc0) == 0x80) { |
483 |
- /* mpeg2 case */ |
484 |
- guchar flags; |
485 |
-- |
486 |
- /* 2: '10' |
487 |
- * 2: PES_scrambling_control |
488 |
- * 1: PES_priority |
489 |
-@@ -2560,10 +2534,8 @@ gst_ps_demux_scan_ts (GstPsDemux * demux, const guint8 * data, |
490 |
- * 1: original_or_copy |
491 |
- */ |
492 |
- flags = *data++; |
493 |
-- |
494 |
- if ((flags & 0xc0) != 0x80) |
495 |
- goto beach; |
496 |
-- |
497 |
- /* 2: PTS_DTS_flags |
498 |
- * 1: ESCR_flag |
499 |
- * 1: ES_rate_flag |
500 |
-@@ -2573,14 +2545,11 @@ gst_ps_demux_scan_ts (GstPsDemux * demux, const guint8 * data, |
501 |
- * 1: PES_extension_flag |
502 |
- */ |
503 |
- flags = *data++; |
504 |
-- |
505 |
- /* 8: PES_header_data_length */ |
506 |
- data++; |
507 |
-- |
508 |
- /* only DTS: this is invalid */ |
509 |
- if ((flags & 0xc0) == 0x40) |
510 |
- goto beach; |
511 |
-- |
512 |
- /* check for PTS */ |
513 |
- if ((flags & 0x80)) { |
514 |
- READ_TS (data, pts, beach); |
515 |
-@@ -2617,26 +2586,21 @@ gst_ps_demux_scan_forward_ts (GstPsDemux * demux, guint64 * pos, |
516 |
- guint cursor, to_read = BLOCK_SZ; |
517 |
- guint end_scan; |
518 |
- GstMapInfo map; |
519 |
-- |
520 |
- do { |
521 |
- /* Check we can get at least scan_sz bytes */ |
522 |
- if (offset + scan_sz > demux->sink_segment.stop) |
523 |
- return FALSE; |
524 |
-- |
525 |
- /* Don't go further than 'limit' bytes */ |
526 |
- if (limit && offset > *pos + limit) |
527 |
- return FALSE; |
528 |
-- |
529 |
- if (offset + to_read > demux->sink_segment.stop) |
530 |
- to_read = demux->sink_segment.stop - offset; |
531 |
-- |
532 |
- /* read some data */ |
533 |
- buffer = NULL; |
534 |
- ret = gst_pad_pull_range (demux->sinkpad, offset, to_read, &buffer); |
535 |
- if (G_UNLIKELY (ret != GST_FLOW_OK)) |
536 |
- return FALSE; |
537 |
- gst_buffer_map (buffer, &map, GST_MAP_READ); |
538 |
-- |
539 |
- /* may get a short buffer at the end of the file */ |
540 |
- if (G_UNLIKELY (map.size <= scan_sz)) { |
541 |
- gst_buffer_unmap (buffer, &map); |
542 |
-@@ -2645,7 +2609,6 @@ gst_ps_demux_scan_forward_ts (GstPsDemux * demux, guint64 * pos, |
543 |
- } |
544 |
- |
545 |
- end_scan = map.size - scan_sz; |
546 |
-- |
547 |
- /* scan the block */ |
548 |
- for (cursor = 0; !found && cursor <= end_scan; cursor++) { |
549 |
- found = gst_ps_demux_scan_ts (demux, map.data + cursor, mode, &ts, |
550 |
-@@ -2655,7 +2618,6 @@ gst_ps_demux_scan_forward_ts (GstPsDemux * demux, guint64 * pos, |
551 |
- /* done with the buffer, unref it */ |
552 |
- gst_buffer_unmap (buffer, &map); |
553 |
- gst_buffer_unref (buffer); |
554 |
-- |
555 |
- if (found) { |
556 |
- *rts = ts; |
557 |
- *pos = offset + cursor - 1; |
558 |
-@@ -2663,7 +2625,6 @@ gst_ps_demux_scan_forward_ts (GstPsDemux * demux, guint64 * pos, |
559 |
- offset += cursor; |
560 |
- } |
561 |
- } while (!found && offset < demux->sink_segment.stop); |
562 |
-- |
563 |
- return found; |
564 |
- } |
565 |
- |
566 |
-@@ -2681,16 +2642,13 @@ gst_ps_demux_scan_backward_ts (GstPsDemux * demux, guint64 * pos, |
567 |
- guint start_scan; |
568 |
- guint8 *data; |
569 |
- GstMapInfo map; |
570 |
-- |
571 |
- do { |
572 |
- /* Check we have at least scan_sz bytes available */ |
573 |
- if (offset < scan_sz - 1) |
574 |
- return FALSE; |
575 |
-- |
576 |
- /* Don't go backward past the start or 'limit' bytes */ |
577 |
- if (limit && offset + limit < *pos) |
578 |
- return FALSE; |
579 |
-- |
580 |
- if (offset > BLOCK_SZ) |
581 |
- offset -= BLOCK_SZ; |
582 |
- else { |
583 |
-@@ -2702,9 +2660,7 @@ gst_ps_demux_scan_backward_ts (GstPsDemux * demux, guint64 * pos, |
584 |
- ret = gst_pad_pull_range (demux->sinkpad, offset, to_read, &buffer); |
585 |
- if (G_UNLIKELY (ret != GST_FLOW_OK)) |
586 |
- return FALSE; |
587 |
-- |
588 |
- gst_buffer_map (buffer, &map, GST_MAP_READ); |
589 |
-- |
590 |
- /* may get a short buffer at the end of the file */ |
591 |
- if (G_UNLIKELY (map.size <= scan_sz)) { |
592 |
- gst_buffer_unmap (buffer, &map); |
593 |
-@@ -2714,7 +2670,6 @@ gst_ps_demux_scan_backward_ts (GstPsDemux * demux, guint64 * pos, |
594 |
- |
595 |
- start_scan = map.size - scan_sz; |
596 |
- data = map.data + start_scan; |
597 |
-- |
598 |
- /* scan the block */ |
599 |
- for (cursor = (start_scan + 1); !found && cursor > 0; cursor--) { |
600 |
- found = gst_ps_demux_scan_ts (demux, data--, mode, &ts, |
601 |
-@@ -2724,14 +2679,12 @@ gst_ps_demux_scan_backward_ts (GstPsDemux * demux, guint64 * pos, |
602 |
- /* done with the buffer, unref it */ |
603 |
- gst_buffer_unmap (buffer, &map); |
604 |
- gst_buffer_unref (buffer); |
605 |
-- |
606 |
- if (found) { |
607 |
- *rts = ts; |
608 |
- *pos = offset + cursor; |
609 |
- } |
610 |
- |
611 |
- } while (!found && offset > 0); |
612 |
-- |
613 |
- return found; |
614 |
- } |
615 |
- |
616 |
-@@ -2745,54 +2698,47 @@ gst_ps_sink_get_duration (GstPsDemux * demux) |
617 |
- guint64 offset; |
618 |
- guint i; |
619 |
- guint64 scr = 0; |
620 |
-- |
621 |
- /* init the sink segment */ |
622 |
- gst_segment_init (&demux->sink_segment, format); |
623 |
-- |
624 |
- /* get peer to figure out length */ |
625 |
- if ((peer = gst_pad_get_peer (demux->sinkpad)) == NULL) |
626 |
- goto beach; |
627 |
-- |
628 |
- res = gst_pad_query_duration (peer, format, &length); |
629 |
- gst_object_unref (peer); |
630 |
-- |
631 |
- if (!res || length <= 0) |
632 |
- goto beach; |
633 |
-- |
634 |
- GST_DEBUG_OBJECT (demux, "file length %" G_GINT64_FORMAT, length); |
635 |
-- |
636 |
- /* update the sink segment */ |
637 |
- demux->sink_segment.stop = length; |
638 |
- gst_segment_set_duration (&demux->sink_segment, format, length); |
639 |
- gst_segment_set_position (&demux->sink_segment, format, 0); |
640 |
-- |
641 |
- /* Scan for notorious SCR and PTS to calculate the duration */ |
642 |
- /* scan for first SCR in the stream */ |
643 |
- offset = demux->sink_segment.start; |
644 |
-- gst_ps_demux_scan_forward_ts (demux, &offset, SCAN_SCR, &demux->first_scr, |
645 |
-- DURATION_SCAN_LIMIT); |
646 |
-- GST_DEBUG_OBJECT (demux, "First SCR: %" G_GINT64_FORMAT " %" GST_TIME_FORMAT |
647 |
-- " in packet starting at %" G_GUINT64_FORMAT, |
648 |
-- demux->first_scr, GST_TIME_ARGS (MPEGTIME_TO_GSTTIME (demux->first_scr)), |
649 |
-- offset); |
650 |
-+ gst_ps_demux_scan_forward_ts (demux, &offset, SCAN_SCR, |
651 |
-+ &demux->first_scr, DURATION_SCAN_LIMIT); |
652 |
-+ GST_DEBUG_OBJECT (demux, |
653 |
-+ "First SCR: %" G_GINT64_FORMAT " %" GST_TIME_FORMAT |
654 |
-+ " in packet starting at %" G_GUINT64_FORMAT, demux->first_scr, |
655 |
-+ GST_TIME_ARGS (MPEGTIME_TO_GSTTIME (demux->first_scr)), offset); |
656 |
- demux->first_scr_offset = offset; |
657 |
- /* scan for last SCR in the stream */ |
658 |
- offset = demux->sink_segment.stop; |
659 |
-- gst_ps_demux_scan_backward_ts (demux, &offset, SCAN_SCR, &demux->last_scr, |
660 |
-- DURATION_SCAN_LIMIT); |
661 |
-- GST_DEBUG_OBJECT (demux, "Last SCR: %" G_GINT64_FORMAT " %" GST_TIME_FORMAT |
662 |
-- " in packet starting at %" G_GUINT64_FORMAT, |
663 |
-- demux->last_scr, GST_TIME_ARGS (MPEGTIME_TO_GSTTIME (demux->last_scr)), |
664 |
-- offset); |
665 |
-+ gst_ps_demux_scan_backward_ts (demux, &offset, SCAN_SCR, |
666 |
-+ &demux->last_scr, DURATION_SCAN_LIMIT); |
667 |
-+ GST_DEBUG_OBJECT (demux, |
668 |
-+ "Last SCR: %" G_GINT64_FORMAT " %" GST_TIME_FORMAT |
669 |
-+ " in packet starting at %" G_GUINT64_FORMAT, demux->last_scr, |
670 |
-+ GST_TIME_ARGS (MPEGTIME_TO_GSTTIME (demux->last_scr)), offset); |
671 |
- demux->last_scr_offset = offset; |
672 |
- /* scan for first PTS in the stream */ |
673 |
- offset = demux->sink_segment.start; |
674 |
-- gst_ps_demux_scan_forward_ts (demux, &offset, SCAN_PTS, &demux->first_pts, |
675 |
-- DURATION_SCAN_LIMIT); |
676 |
-- GST_DEBUG_OBJECT (demux, "First PTS: %" G_GINT64_FORMAT " %" GST_TIME_FORMAT |
677 |
-- " in packet starting at %" G_GUINT64_FORMAT, |
678 |
-- demux->first_pts, GST_TIME_ARGS (MPEGTIME_TO_GSTTIME (demux->first_pts)), |
679 |
-- offset); |
680 |
-+ gst_ps_demux_scan_forward_ts (demux, &offset, SCAN_PTS, |
681 |
-+ &demux->first_pts, DURATION_SCAN_LIMIT); |
682 |
-+ GST_DEBUG_OBJECT (demux, |
683 |
-+ "First PTS: %" G_GINT64_FORMAT " %" GST_TIME_FORMAT |
684 |
-+ " in packet starting at %" G_GUINT64_FORMAT, demux->first_pts, |
685 |
-+ GST_TIME_ARGS (MPEGTIME_TO_GSTTIME (demux->first_pts)), offset); |
686 |
- if (demux->first_pts != G_MAXUINT64) { |
687 |
- /* scan for last PTS in the stream */ |
688 |
- offset = demux->sink_segment.stop; |
689 |
-@@ -2817,8 +2763,8 @@ gst_ps_sink_get_duration (GstPsDemux * demux) |
690 |
- /* Start demuxing from the right place */ |
691 |
- demux->sink_segment.position = offset; |
692 |
- GST_DEBUG_OBJECT (demux, "Replaced First SCR: %" G_GINT64_FORMAT |
693 |
-- " %" GST_TIME_FORMAT " in packet starting at %" G_GUINT64_FORMAT, |
694 |
-- demux->first_scr, |
695 |
-+ " %" GST_TIME_FORMAT " in packet starting at %" |
696 |
-+ G_GUINT64_FORMAT, demux->first_scr, |
697 |
- GST_TIME_ARGS (MPEGTIME_TO_GSTTIME (demux->first_scr)), offset); |
698 |
- break; |
699 |
- } |
700 |
-@@ -2828,7 +2774,6 @@ gst_ps_sink_get_duration (GstPsDemux * demux) |
701 |
- demux->base_time = MPEGTIME_TO_GSTTIME (demux->first_scr); |
702 |
- demux->scr_rate_n = demux->last_scr_offset - demux->first_scr_offset; |
703 |
- demux->scr_rate_d = demux->last_scr - demux->first_scr; |
704 |
-- |
705 |
- if (G_LIKELY (demux->first_pts != G_MAXUINT64 && |
706 |
- demux->last_pts != G_MAXUINT64)) { |
707 |
- /* update the src segment */ |
708 |
-@@ -2845,9 +2790,7 @@ gst_ps_sink_get_duration (GstPsDemux * demux) |
709 |
- &demux->sink_segment); |
710 |
- GST_INFO_OBJECT (demux, "src segment configured %" GST_SEGMENT_FORMAT, |
711 |
- &demux->src_segment); |
712 |
-- |
713 |
- res = TRUE; |
714 |
-- |
715 |
- beach: |
716 |
- return res; |
717 |
- } |
718 |
-@@ -2858,7 +2801,6 @@ gst_ps_demux_pull_block (GstPad * pad, GstPsDemux * demux, |
719 |
- { |
720 |
- GstFlowReturn ret; |
721 |
- GstBuffer *buffer = NULL; |
722 |
-- |
723 |
- ret = gst_pad_pull_range (pad, offset, size, &buffer); |
724 |
- if (G_UNLIKELY (ret != GST_FLOW_OK)) { |
725 |
- GST_DEBUG_OBJECT (demux, "pull range at %" G_GUINT64_FORMAT |
726 |
-@@ -2867,13 +2809,11 @@ gst_ps_demux_pull_block (GstPad * pad, GstPsDemux * demux, |
727 |
- } else |
728 |
- GST_LOG_OBJECT (demux, "pull range at %" G_GUINT64_FORMAT |
729 |
- " size %u done", offset, size); |
730 |
-- |
731 |
- if (demux->sink_segment.rate < 0) { |
732 |
- GST_LOG_OBJECT (demux, "setting discont flag on backward rate"); |
733 |
- GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_DISCONT); |
734 |
- } |
735 |
- ret = gst_ps_demux_chain (pad, GST_OBJECT (demux), buffer); |
736 |
-- |
737 |
- beach: |
738 |
- return ret; |
739 |
- } |
740 |
-@@ -2884,9 +2824,7 @@ gst_ps_demux_loop (GstPad * pad) |
741 |
- GstPsDemux *demux; |
742 |
- GstFlowReturn ret = GST_FLOW_OK; |
743 |
- guint64 offset = 0; |
744 |
-- |
745 |
- demux = GST_PS_DEMUX (gst_pad_get_parent (pad)); |
746 |
-- |
747 |
- if (G_UNLIKELY (demux->flushing)) { |
748 |
- ret = GST_FLOW_FLUSHING; |
749 |
- goto pause; |
750 |
-@@ -2894,7 +2832,6 @@ gst_ps_demux_loop (GstPad * pad) |
751 |
- |
752 |
- if (G_UNLIKELY (demux->sink_segment.format == GST_FORMAT_UNDEFINED)) |
753 |
- gst_ps_sink_get_duration (demux); |
754 |
-- |
755 |
- offset = demux->sink_segment.position; |
756 |
- if (demux->sink_segment.rate >= 0) { |
757 |
- guint size = BLOCK_SZ; |
758 |
-@@ -2903,24 +2840,22 @@ gst_ps_demux_loop (GstPad * pad) |
759 |
- } |
760 |
- /* pull in data */ |
761 |
- ret = gst_ps_demux_pull_block (pad, demux, offset, size); |
762 |
-- |
763 |
- /* pause if something went wrong */ |
764 |
- if (G_UNLIKELY (ret != GST_FLOW_OK)) |
765 |
- goto pause; |
766 |
-- |
767 |
- /* update our position */ |
768 |
- offset += size; |
769 |
- gst_segment_set_position (&demux->sink_segment, GST_FORMAT_BYTES, offset); |
770 |
-- |
771 |
- /* check EOS condition */ |
772 |
- if ((demux->src_segment.flags & GST_SEEK_FLAG_SEGMENT) && |
773 |
- ((demux->sink_segment.position >= demux->sink_segment.stop) || |
774 |
- (demux->src_segment.stop != (guint64) - 1 && |
775 |
- demux->src_segment.position >= demux->src_segment.stop))) { |
776 |
-- GST_DEBUG_OBJECT (demux, "forward mode using segment reached end of " |
777 |
-- "segment pos %" GST_TIME_FORMAT " stop %" GST_TIME_FORMAT |
778 |
-- " pos in bytes %" G_GUINT64_FORMAT " stop in bytes %" |
779 |
-- G_GUINT64_FORMAT, GST_TIME_ARGS (demux->src_segment.position), |
780 |
-+ GST_DEBUG_OBJECT (demux, |
781 |
-+ "forward mode using segment reached end of " "segment pos %" |
782 |
-+ GST_TIME_FORMAT " stop %" GST_TIME_FORMAT " pos in bytes %" |
783 |
-+ G_GUINT64_FORMAT " stop in bytes %" G_GUINT64_FORMAT, |
784 |
-+ GST_TIME_ARGS (demux->src_segment.position), |
785 |
- GST_TIME_ARGS (demux->src_segment.stop), |
786 |
- demux->sink_segment.position, demux->sink_segment.stop); |
787 |
- ret = GST_FLOW_EOS; |
788 |
-@@ -2928,25 +2863,22 @@ gst_ps_demux_loop (GstPad * pad) |
789 |
- } |
790 |
- } else { /* Reverse playback */ |
791 |
- guint64 size = MIN (offset, BLOCK_SZ); |
792 |
-- |
793 |
- /* pull in data */ |
794 |
- ret = gst_ps_demux_pull_block (pad, demux, offset - size, size); |
795 |
-- |
796 |
- /* pause if something went wrong */ |
797 |
- if (G_UNLIKELY (ret != GST_FLOW_OK)) |
798 |
- goto pause; |
799 |
-- |
800 |
- /* update our position */ |
801 |
- offset -= size; |
802 |
- gst_segment_set_position (&demux->sink_segment, GST_FORMAT_BYTES, offset); |
803 |
-- |
804 |
- /* check EOS condition */ |
805 |
- if (demux->sink_segment.position <= demux->sink_segment.start || |
806 |
- demux->src_segment.position <= demux->src_segment.start) { |
807 |
-- GST_DEBUG_OBJECT (demux, "reverse mode using segment reached end of " |
808 |
-- "segment pos %" GST_TIME_FORMAT " stop %" GST_TIME_FORMAT |
809 |
-- " pos in bytes %" G_GUINT64_FORMAT " stop in bytes %" |
810 |
-- G_GUINT64_FORMAT, GST_TIME_ARGS (demux->src_segment.position), |
811 |
-+ GST_DEBUG_OBJECT (demux, |
812 |
-+ "reverse mode using segment reached end of " "segment pos %" |
813 |
-+ GST_TIME_FORMAT " stop %" GST_TIME_FORMAT " pos in bytes %" |
814 |
-+ G_GUINT64_FORMAT " stop in bytes %" G_GUINT64_FORMAT, |
815 |
-+ GST_TIME_ARGS (demux->src_segment.position), |
816 |
- GST_TIME_ARGS (demux->src_segment.start), |
817 |
- demux->sink_segment.position, demux->sink_segment.start); |
818 |
- ret = GST_FLOW_EOS; |
819 |
-@@ -2955,27 +2887,21 @@ gst_ps_demux_loop (GstPad * pad) |
820 |
- } |
821 |
- |
822 |
- gst_object_unref (demux); |
823 |
-- |
824 |
- return; |
825 |
-- |
826 |
- pause: |
827 |
- { |
828 |
- const gchar *reason = gst_flow_get_name (ret); |
829 |
-- |
830 |
- GST_LOG_OBJECT (demux, "pausing task, reason %s", reason); |
831 |
- gst_pad_pause_task (pad); |
832 |
-- |
833 |
- if (ret == GST_FLOW_EOS) { |
834 |
- /* perform EOS logic */ |
835 |
- gst_element_no_more_pads (GST_ELEMENT_CAST (demux)); |
836 |
- if (demux->src_segment.flags & GST_SEEK_FLAG_SEGMENT) { |
837 |
- gint64 stop; |
838 |
-- |
839 |
- /* for segment playback we need to post when (in stream time) |
840 |
- * we stopped, this is either stop (when set) or the duration. */ |
841 |
- if ((stop = demux->src_segment.stop) == -1) |
842 |
- stop = demux->src_segment.duration; |
843 |
-- |
844 |
- if (demux->sink_segment.rate >= 0) { |
845 |
- GST_LOG_OBJECT (demux, "Sending segment done, at end of segment"); |
846 |
- gst_element_post_message (GST_ELEMENT_CAST (demux), |
847 |
-@@ -2984,8 +2910,8 @@ pause: |
848 |
- gst_ps_demux_send_event (demux, |
849 |
- gst_event_new_segment_done (GST_FORMAT_TIME, stop)); |
850 |
- } else { /* Reverse playback */ |
851 |
-- GST_LOG_OBJECT (demux, "Sending segment done, at beginning of " |
852 |
-- "segment"); |
853 |
-+ GST_LOG_OBJECT (demux, |
854 |
-+ "Sending segment done, at beginning of " "segment"); |
855 |
- gst_element_post_message (GST_ELEMENT_CAST (demux), |
856 |
- gst_message_new_segment_done (GST_OBJECT_CAST (demux), |
857 |
- GST_FORMAT_TIME, demux->src_segment.start)); |
858 |
-@@ -3020,7 +2946,6 @@ gst_ps_demux_sink_activate (GstPad * sinkpad, GstObject * parent) |
859 |
- { |
860 |
- gboolean res = FALSE; |
861 |
- GstQuery *query = gst_query_new_scheduling (); |
862 |
-- |
863 |
- if (gst_pad_peer_query (sinkpad, query)) { |
864 |
- if (gst_query_has_scheduling_mode_with_flags (query, |
865 |
- GST_PAD_MODE_PULL, GST_SCHEDULING_FLAG_SEEKABLE)) { |
866 |
-@@ -3033,7 +2958,6 @@ gst_ps_demux_sink_activate (GstPad * sinkpad, GstObject * parent) |
867 |
- } |
868 |
- |
869 |
- gst_query_unref (query); |
870 |
-- |
871 |
- return res; |
872 |
- } |
873 |
- |
874 |
-@@ -3043,9 +2967,7 @@ gst_ps_demux_sink_activate_push (GstPad * sinkpad, GstObject * parent, |
875 |
- gboolean active) |
876 |
- { |
877 |
- GstPsDemux *demux = GST_PS_DEMUX (parent); |
878 |
-- |
879 |
- demux->random_access = FALSE; |
880 |
-- |
881 |
- return TRUE; |
882 |
- } |
883 |
- |
884 |
-@@ -3057,12 +2979,11 @@ gst_ps_demux_sink_activate_pull (GstPad * sinkpad, GstObject * parent, |
885 |
- gboolean active) |
886 |
- { |
887 |
- GstPsDemux *demux = GST_PS_DEMUX (parent); |
888 |
-- |
889 |
- if (active) { |
890 |
- GST_DEBUG ("pull mode activated"); |
891 |
- demux->random_access = TRUE; |
892 |
-- return gst_pad_start_task (sinkpad, (GstTaskFunction) gst_ps_demux_loop, |
893 |
-- sinkpad, NULL); |
894 |
-+ return gst_pad_start_task (sinkpad, |
895 |
-+ (GstTaskFunction) gst_ps_demux_loop, sinkpad, NULL); |
896 |
- } else { |
897 |
- demux->random_access = FALSE; |
898 |
- return gst_pad_stop_task (sinkpad); |
899 |
-@@ -3090,12 +3011,9 @@ static GstFlowReturn |
900 |
- gst_ps_demux_combine_flows (GstPsDemux * demux, GstFlowReturn ret) |
901 |
- { |
902 |
- GST_LOG_OBJECT (demux, "flow return: %s", gst_flow_get_name (ret)); |
903 |
-- |
904 |
- ret = gst_flow_combiner_update_flow (demux->flowcombiner, ret); |
905 |
-- |
906 |
- if (G_UNLIKELY (demux->need_no_more_pads && ret == GST_FLOW_NOT_LINKED)) |
907 |
- ret = GST_FLOW_OK; |
908 |
-- |
909 |
- GST_LOG_OBJECT (demux, "combined flow return: %s", gst_flow_get_name (ret)); |
910 |
- return ret; |
911 |
- } |
912 |
-@@ -3107,32 +3025,28 @@ gst_ps_demux_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer) |
913 |
- GstFlowReturn ret = GST_FLOW_OK; |
914 |
- guint32 avail; |
915 |
- gboolean save, discont; |
916 |
-- |
917 |
- discont = GST_BUFFER_IS_DISCONT (buffer); |
918 |
-- |
919 |
- if (discont) { |
920 |
-- GST_LOG_OBJECT (demux, "Received buffer with discont flag and" |
921 |
-- " offset %" G_GUINT64_FORMAT, GST_BUFFER_OFFSET (buffer)); |
922 |
-- |
923 |
-+ GST_LOG_OBJECT (demux, |
924 |
-+ "Received buffer with discont flag and" " offset %" |
925 |
-+ G_GUINT64_FORMAT, GST_BUFFER_OFFSET (buffer)); |
926 |
- gst_pes_filter_drain (&demux->filter); |
927 |
- gst_ps_demux_mark_discont (demux, TRUE, FALSE); |
928 |
-- |
929 |
- /* mark discont on all streams */ |
930 |
- if (demux->sink_segment.rate >= 0.0) { |
931 |
- demux->current_scr = G_MAXUINT64; |
932 |
- demux->bytes_since_scr = 0; |
933 |
- } |
934 |
- } else { |
935 |
-- GST_LOG_OBJECT (demux, "Received buffer with offset %" G_GUINT64_FORMAT, |
936 |
-+ GST_LOG_OBJECT (demux, |
937 |
-+ "Received buffer with offset %" G_GUINT64_FORMAT, |
938 |
- GST_BUFFER_OFFSET (buffer)); |
939 |
- } |
940 |
- |
941 |
- /* We keep the offset to interpolate SCR */ |
942 |
- demux->adapter_offset = GST_BUFFER_OFFSET (buffer); |
943 |
-- |
944 |
- gst_adapter_push (demux->adapter, buffer); |
945 |
- demux->bytes_since_scr += gst_buffer_get_size (buffer); |
946 |
-- |
947 |
- avail = gst_adapter_available (demux->rev_adapter); |
948 |
- if (avail > 0) { |
949 |
- GST_LOG_OBJECT (demux, "appending %u saved bytes", avail); |
950 |
-@@ -3145,7 +3059,6 @@ gst_ps_demux_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer) |
951 |
- |
952 |
- avail = gst_adapter_available (demux->adapter); |
953 |
- GST_LOG_OBJECT (demux, "avail now: %d, state %d", avail, demux->filter.state); |
954 |
-- |
955 |
- switch (demux->filter.state) { |
956 |
- case STATE_DATA_SKIP: |
957 |
- case STATE_DATA_PUSH: |
958 |
-@@ -3215,7 +3128,6 @@ gst_ps_demux_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer) |
959 |
- * saved up to the next ps sync. */ |
960 |
- if (ps_sync) |
961 |
- save = FALSE; |
962 |
-- |
963 |
- switch (ret) { |
964 |
- case GST_FLOW_NEED_MORE_DATA: |
965 |
- GST_DEBUG_OBJECT (demux, "need more data"); |
966 |
-@@ -3249,7 +3161,6 @@ gst_ps_demux_change_state (GstElement * element, GstStateChange transition) |
967 |
- { |
968 |
- GstPsDemux *demux = GST_PS_DEMUX (element); |
969 |
- GstStateChangeReturn result; |
970 |
-- |
971 |
- switch (transition) { |
972 |
- case GST_STATE_CHANGE_NULL_TO_READY: |
973 |
- gst_pes_filter_init (&demux->filter, demux->adapter, |
974 |
-@@ -3266,7 +3177,6 @@ gst_ps_demux_change_state (GstElement * element, GstStateChange transition) |
975 |
- } |
976 |
- |
977 |
- result = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); |
978 |
-- |
979 |
- switch (transition) { |
980 |
- case GST_STATE_CHANGE_PAUSED_TO_READY: |
981 |
- gst_ps_demux_reset (demux); |
982 |
--- |
983 |
-2.10.1 |
984 |
- |
985 |
|
986 |
diff --git a/media-libs/gst-plugins-bad/gst-plugins-bad-1.10.3.ebuild b/media-libs/gst-plugins-bad/gst-plugins-bad-1.10.3.ebuild |
987 |
deleted file mode 100644 |
988 |
index d96dd6e58c0..00000000000 |
989 |
--- a/media-libs/gst-plugins-bad/gst-plugins-bad-1.10.3.ebuild |
990 |
+++ /dev/null |
991 |
@@ -1,105 +0,0 @@ |
992 |
-# Copyright 1999-2017 Gentoo Foundation |
993 |
-# Distributed under the terms of the GNU General Public License v2 |
994 |
- |
995 |
-EAPI=6 |
996 |
-GST_ORG_MODULE="gst-plugins-bad" |
997 |
- |
998 |
-inherit eutils flag-o-matic gstreamer virtualx autotools |
999 |
- |
1000 |
-DESCRIPTION="Less plugins for GStreamer" |
1001 |
-HOMEPAGE="https://gstreamer.freedesktop.org/" |
1002 |
- |
1003 |
-LICENSE="LGPL-2" |
1004 |
-KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 ~sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux" |
1005 |
- |
1006 |
-IUSE="X bzip2 egl gles2 gtk +introspection opengl +orc vcd vnc wayland" |
1007 |
-REQUIRED_USE=" |
1008 |
- gles2? ( !opengl ) |
1009 |
- opengl? ( X ) |
1010 |
- wayland? ( egl ) |
1011 |
-" |
1012 |
- |
1013 |
-# X11 is automagic for now, upstream #709530 |
1014 |
-RDEPEND=" |
1015 |
- >=dev-libs/glib-2.40.0:2[${MULTILIB_USEDEP}] |
1016 |
- >=media-libs/gstreamer-${PV}:${SLOT}[${MULTILIB_USEDEP},introspection?] |
1017 |
- >=media-libs/gst-plugins-base-${PV}:${SLOT}[${MULTILIB_USEDEP},introspection?] |
1018 |
- introspection? ( >=dev-libs/gobject-introspection-1.31.1:= ) |
1019 |
- |
1020 |
- bzip2? ( >=app-arch/bzip2-1.0.6-r4[${MULTILIB_USEDEP}] ) |
1021 |
- egl? ( >=media-libs/mesa-9.1.6[egl,${MULTILIB_USEDEP}] ) |
1022 |
- gles2? ( >=media-libs/mesa-9.1.6[gles2,${MULTILIB_USEDEP}] ) |
1023 |
- opengl? ( |
1024 |
- >=media-libs/mesa-9.1.6[${MULTILIB_USEDEP}] |
1025 |
- virtual/glu[${MULTILIB_USEDEP}] ) |
1026 |
- X? ( x11-libs/libX11[${MULTILIB_USEDEP}] ) |
1027 |
- wayland? ( >=dev-libs/wayland-1.4.0[${MULTILIB_USEDEP}] ) |
1028 |
- |
1029 |
- gtk? ( >=x11-libs/gtk+-3.15:3[X?,wayland?,${MULTILIB_USEDEP}] ) |
1030 |
- orc? ( >=dev-lang/orc-0.4.17[${MULTILIB_USEDEP}] ) |
1031 |
-" |
1032 |
-DEPEND="${RDEPEND} |
1033 |
- >=dev-util/gtk-doc-am-1.12 |
1034 |
-" |
1035 |
- |
1036 |
-RESTRICT="test" |
1037 |
- |
1038 |
-PATCHES=( "${FILESDIR}"/${PV}-CVE-2017-5848.patch ) # Remove eautoreconf from src_prepare when removing |
1039 |
- |
1040 |
-src_prepare() { |
1041 |
- default |
1042 |
- addpredict /dev # Prevent sandbox violations bug #570624 |
1043 |
- eautoreconf # For CVE-2017-5848.patch updating Makefile.am to add a -base helper library link; remove autotools inherit when removing |
1044 |
-} |
1045 |
- |
1046 |
-multilib_src_configure() { |
1047 |
- local myconf=() |
1048 |
- if use opengl || use gles2 ; then |
1049 |
- # Actually enable the gl element, not just libs |
1050 |
- myconf+=( --enable-gl ) |
1051 |
- fi |
1052 |
- |
1053 |
- # Always enable gsettings (no extra dependency) |
1054 |
- # and shm (need a switch for winnt ?) |
1055 |
- gstreamer_multilib_src_configure \ |
1056 |
- $(multilib_native_use_enable introspection) \ |
1057 |
- $(use_enable bzip2 bz2) \ |
1058 |
- $(use_enable egl) \ |
1059 |
- $(use_enable gles2) \ |
1060 |
- $(use_enable gtk gtk3) \ |
1061 |
- $(use_enable opengl) \ |
1062 |
- $(use_enable opengl glx) \ |
1063 |
- $(use_enable orc) \ |
1064 |
- $(use_enable vcd) \ |
1065 |
- $(use_enable vnc librfb) \ |
1066 |
- $(use_enable wayland) \ |
1067 |
- $(use_enable X x11) \ |
1068 |
- --disable-examples \ |
1069 |
- --disable-debug \ |
1070 |
- --disable-cocoa \ |
1071 |
- --without-player-tests \ |
1072 |
- --disable-wgl \ |
1073 |
- --enable-shm \ |
1074 |
- ${myconf[$@]} |
1075 |
- # not ported |
1076 |
- # --enable-gsettings |
1077 |
- |
1078 |
- if multilib_is_native_abi; then |
1079 |
- local x |
1080 |
- for x in libs plugins; do |
1081 |
- ln -s "${S}"/docs/${x}/html docs/${x}/html || die |
1082 |
- done |
1083 |
- fi |
1084 |
-} |
1085 |
- |
1086 |
-multilib_src_test() { |
1087 |
- unset DISPLAY |
1088 |
- # Tests are slower than upstream expects |
1089 |
- virtx emake check CK_DEFAULT_TIMEOUT=300 |
1090 |
-} |
1091 |
- |
1092 |
-multilib_src_install_all() { |
1093 |
- DOCS="AUTHORS ChangeLog NEWS README RELEASE" |
1094 |
- einstalldocs |
1095 |
- prune_libtool_files --modules |
1096 |
-} |