From 5a0bc5c4040cc9d61a261137d0cf796885afa9dc Mon Sep 17 00:00:00 2001 From: Alex Woods Date: Mon, 8 Dec 2003 22:22:36 +0000 Subject: Add a parameter to dvb_filter_pes2ts function to specify whether the packet is a payload unit start or not. --- linux/drivers/media/dvb/dvb-core/dvb_filter.c | 10 +++++++--- linux/drivers/media/dvb/dvb-core/dvb_filter.h | 3 ++- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'linux/drivers/media/dvb/dvb-core') diff --git a/linux/drivers/media/dvb/dvb-core/dvb_filter.c b/linux/drivers/media/dvb/dvb-core/dvb_filter.c index a9e81251a..760df8e7a 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_filter.c +++ b/linux/drivers/media/dvb/dvb-core/dvb_filter.c @@ -564,14 +564,18 @@ void dvb_filter_pes2ts_init(struct dvb_filter_pes2ts *p2ts, unsigned short pid, p2ts->priv=priv; } -int dvb_filter_pes2ts(struct dvb_filter_pes2ts *p2ts, unsigned char *pes, int len) +int dvb_filter_pes2ts(struct dvb_filter_pes2ts *p2ts, unsigned char *pes, + int len, int payload_start) { unsigned char *buf=p2ts->buf; int ret=0, rest; - + //len=6+((pes[4]<<8)|pes[5]); - buf[1]|=0x40; + if (payload_start) + buf[1]|=0x40; + else + buf[1]&=~0x40; while (len>=184) { buf[3]=0x10|((p2ts->cc++)&0x0f); memcpy(buf+4, pes, 184); diff --git a/linux/drivers/media/dvb/dvb-core/dvb_filter.h b/linux/drivers/media/dvb/dvb-core/dvb_filter.h index f792280bd..bd328dc25 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_filter.h +++ b/linux/drivers/media/dvb/dvb-core/dvb_filter.h @@ -37,7 +37,8 @@ struct dvb_filter_pes2ts { void dvb_filter_pes2ts_init(struct dvb_filter_pes2ts *p2ts, unsigned short pid, dvb_filter_pes2ts_cb_t *cb, void *priv); -int dvb_filter_pes2ts(struct dvb_filter_pes2ts *p2ts, unsigned char *pes, int len); +int dvb_filter_pes2ts(struct dvb_filter_pes2ts *p2ts, unsigned char *pes, + int len, int payload_start); #define PROG_STREAM_MAP 0xBC -- cgit v1.2.3