0006-Don-t-reparse-PMT-unless-it-s-version-has-changed.patch
1.5 KB
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
45
46
47
48
From db98fbe37f2f7175ff03b8d582e940518ddf3642 Mon Sep 17 00:00:00 2001
From: Joakim Plate <elupus@ecce.se>
Date: Sun, 18 Sep 2011 19:17:23 +0200
Subject: [PATCH 06/13] Don't reparse PMT unless it's version has changed
Patch part of the XBMC patch set for ffmpeg, downloaded from
https://github.com/xbmc/FFmpeg/.
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
libavformat/mpegts.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 9f85aed..25007a6 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -88,6 +88,7 @@ struct MpegTSFilter {
int es_id;
int last_cc; /* last cc code (-1 if first packet) */
int64_t last_pcr;
+ int last_version; /* last version of data on this pid */
enum MpegTSFilterType type;
union {
MpegTSPESFilter pes_filter;
@@ -450,6 +451,7 @@ static MpegTSFilter *mpegts_open_filter(MpegTSContext *ts, unsigned int pid,
filter->es_id = -1;
filter->last_cc = -1;
filter->last_pcr= -1;
+ filter->last_version = -1;
return filter;
}
@@ -1972,6 +1974,10 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
return;
if (!h->current)
return;
+ if (h->version == filter->last_version)
+ return;
+ filter->last_version = h->version;
+ av_dlog(ts->stream, "version=%d\n", filter->last_version);
ts->stream->ts_id = h->id;
--
2.1.0