diff options
author | Alex Woods <devnull@localhost> | 2003-12-08 22:22:36 +0000 |
---|---|---|
committer | Alex Woods <devnull@localhost> | 2003-12-08 22:22:36 +0000 |
commit | 5a0bc5c4040cc9d61a261137d0cf796885afa9dc (patch) | |
tree | 760bbbbd32dadadeeb23d15363d3a963abc04739 /linux/drivers/media | |
parent | cd163e5d563ca92b425feb1e3544f8eece8719e2 (diff) | |
download | mediapointer-dvb-s2-5a0bc5c4040cc9d61a261137d0cf796885afa9dc.tar.gz mediapointer-dvb-s2-5a0bc5c4040cc9d61a261137d0cf796885afa9dc.tar.bz2 |
Add a parameter to dvb_filter_pes2ts function to specify whether the packet
is a payload unit start or not.
Diffstat (limited to 'linux/drivers/media')
-rw-r--r-- | linux/drivers/media/dvb/dvb-core/dvb_filter.c | 10 | ||||
-rw-r--r-- | linux/drivers/media/dvb/dvb-core/dvb_filter.h | 3 | ||||
-rw-r--r-- | linux/drivers/media/dvb/ttpci/av7110.c | 2 | ||||
-rw-r--r-- | linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c | 10 |
4 files changed, 17 insertions, 8 deletions
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 diff --git a/linux/drivers/media/dvb/ttpci/av7110.c b/linux/drivers/media/dvb/ttpci/av7110.c index 6f2ecb376..2b30ba183 100644 --- a/linux/drivers/media/dvb/ttpci/av7110.c +++ b/linux/drivers/media/dvb/ttpci/av7110.c @@ -354,7 +354,7 @@ static int record_cb(struct dvb_filter_pes2ts *p2t, u8 *buf, size_t len) return dvbdmxfeed->cb.ts(buf, len, 0, 0, &dvbdmxfeed->feed.ts, DMX_OK); else - return dvb_filter_pes2ts(p2t, buf, len); + return dvb_filter_pes2ts(p2t, buf, len, 1); } static int dvb_filter_pes2ts_cb(void *priv, unsigned char *data) diff --git a/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c index 4341591bc..081914c83 100644 --- a/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c +++ b/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c @@ -247,6 +247,8 @@ static void ttusb_dec_set_pids(struct ttusb_dec *dec) ttusb_dec_av_pes2ts_cb, dec->demux.feed); dvb_filter_pes2ts_init(&dec->v_pes2ts, dec->pid[DMX_PES_VIDEO], ttusb_dec_av_pes2ts_cb, dec->demux.feed); + dec->v_pes_length = 0; + dec->v_pes_postbytes = 0; } static void ttusb_dec_process_av_pes(struct ttusb_dec *dec, u8 *av_pes, @@ -296,7 +298,8 @@ static void ttusb_dec_process_av_pes(struct ttusb_dec *dec, u8 *av_pes, &av_pes[12], prebytes); dvb_filter_pes2ts(&dec->v_pes2ts, dec->v_pes, - dec->v_pes_length + prebytes); + dec->v_pes_length + prebytes, + 1); } if (av_pes[5] & 0x10) { @@ -341,13 +344,14 @@ static void ttusb_dec_process_av_pes(struct ttusb_dec *dec, u8 *av_pes, if (postbytes == 0) dvb_filter_pes2ts(&dec->v_pes2ts, dec->v_pes, - dec->v_pes_length); + dec->v_pes_length, 1); break; } case 0x02: /* MainAudioStream */ - dvb_filter_pes2ts(&dec->a_pes2ts, &av_pes[8], length - 12); + dvb_filter_pes2ts(&dec->a_pes2ts, &av_pes[8], length - 12, + av_pes[5] & 0x10); break; default: |