From 008ae5b6596a515cacdc283b846ca23bcc1edfc9 Mon Sep 17 00:00:00 2001 From: Alex Woods Date: Thu, 8 Jan 2004 16:47:30 +0000 Subject: Fix panic that occurs when filters are used at the same time as video streaming. --- linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c') diff --git a/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c index 75b9f3c10..5c0e469c5 100644 --- a/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c +++ b/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c @@ -125,6 +125,7 @@ struct ttusb_dec { struct tasklet_struct urb_tasklet; spinlock_t urb_frame_list_lock; + struct dvb_demux_filter *av_filter; struct list_head filter_info_list; spinlock_t filter_info_list_lock; @@ -285,9 +286,10 @@ static int ttusb_dec_get_stb_state (struct ttusb_dec *dec, unsigned int *mode, static int ttusb_dec_av_pes2ts_cb(void *priv, unsigned char *data) { - struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *)priv; + struct ttusb_dec *dec = (struct ttusb_dec *)priv; - dvbdmxfeed->cb.ts(data, 188, 0, 0, &dvbdmxfeed->feed.ts, DMX_OK); + dec->av_filter->feed->cb.ts(data, 188, 0, 0, + &dec->av_filter->feed->feed.ts, DMX_OK); return 0; } @@ -311,9 +313,9 @@ static void ttusb_dec_set_pids(struct ttusb_dec *dec) ttusb_dec_send_command(dec, 0x50, sizeof(b), b, NULL, NULL); dvb_filter_pes2ts_init(&dec->a_pes2ts, dec->pid[DMX_PES_AUDIO], - ttusb_dec_av_pes2ts_cb, dec->demux.feed); + ttusb_dec_av_pes2ts_cb, dec); dvb_filter_pes2ts_init(&dec->v_pes2ts, dec->pid[DMX_PES_VIDEO], - ttusb_dec_av_pes2ts_cb, dec->demux.feed); + ttusb_dec_av_pes2ts_cb, dec); dec->v_pes_length = 0; dec->v_pes_postbytes = 0; } @@ -805,6 +807,8 @@ static int ttusb_dec_start_ts_feed(struct dvb_demux_feed *dvbdmxfeed) dprintk("\n"); + dec->av_filter = dvbdmxfeed->filter; + switch (dvbdmxfeed->pes_type) { case DMX_TS_PES_VIDEO: @@ -1224,7 +1228,8 @@ static int ttusb_dec_init_dvb(struct ttusb_dec *dec) dprintk("%s\n", __FUNCTION__); - if ((result = dvb_register_adapter(&dec->adapter, dec->model_name)) < 0) { + if ((result = dvb_register_adapter(&dec->adapter, + dec->model_name)) < 0) { printk("%s: dvb_register_adapter failed: error %d\n", __FUNCTION__, result); -- cgit v1.2.3