summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb
diff options
context:
space:
mode:
authorJohannes Stezenbach <devnull@localhost>2005-10-27 21:03:39 +0000
committerJohannes Stezenbach <devnull@localhost>2005-10-27 21:03:39 +0000
commit6addd7d1967c38babd8476c4d015661b9e61d5b3 (patch)
tree2de01dc524072837953dd2ffb0fc6fa5f183fca2 /linux/drivers/media/dvb
parent26dd53f68aeae0c1ad9b81a702e0522cbf077e43 (diff)
downloadmediapointer-dvb-s2-6addd7d1967c38babd8476c4d015661b9e61d5b3.tar.gz
mediapointer-dvb-s2-6addd7d1967c38babd8476c4d015661b9e61d5b3.tar.bz2
From: Mark Adams <mark147m@gmail.com>
Fix a bug in the software demux which causes large MPEG sections to be lost when they follow very small sections. The problem happens when two sections begin in the same transport packet. The dvb_demux code resets its buffer only before the first of these sections. This means that when the second (or subsequent) section begins, there is up to 182 bytes of buffer space already used. If the following section is close to the maximum size, it currently won't fit in the (4096-byte) buffer and is thrown away. The fix is simply to enlarge the buffer by the size of one transport packet and correct one usage of the SECFEED_SIZE definition where what is really meant is the maximum size of a section. Signed-off-by: Mark Adams <mark147m@gmail.com>
Diffstat (limited to 'linux/drivers/media/dvb')
-rw-r--r--linux/drivers/media/dvb/dvb-core/demux.h5
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_demux.c2
2 files changed, 5 insertions, 2 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/demux.h b/linux/drivers/media/dvb/dvb-core/demux.h
index 9719a3b30..7d7b0067f 100644
--- a/linux/drivers/media/dvb/dvb-core/demux.h
+++ b/linux/drivers/media/dvb/dvb-core/demux.h
@@ -48,8 +48,11 @@
* DMX_MAX_SECFEED_SIZE: Maximum length (in bytes) of a private section feed filter.
*/
+#ifndef DMX_MAX_SECTION_SIZE
+#define DMX_MAX_SECTION_SIZE 4096
+#endif
#ifndef DMX_MAX_SECFEED_SIZE
-#define DMX_MAX_SECFEED_SIZE 4096
+#define DMX_MAX_SECFEED_SIZE (DMX_MAX_SECTION_SIZE + 188)
#endif
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_demux.c b/linux/drivers/media/dvb/dvb-core/dvb_demux.c
index dc476dda2..b4c899b15 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_demux.c
+++ b/linux/drivers/media/dvb/dvb-core/dvb_demux.c
@@ -246,7 +246,7 @@ static int dvb_dmx_swfilter_section_copy_dump(struct dvb_demux_feed *feed,
for (n = 0; sec->secbufp + 2 < limit; n++) {
seclen = section_length(sec->secbuf);
- if (seclen <= 0 || seclen > DMX_MAX_SECFEED_SIZE
+ if (seclen <= 0 || seclen > DMX_MAX_SECTION_SIZE
|| seclen + sec->secbufp > limit)
return 0;
sec->seclen = seclen;