[media] dvb-usb return device errors to demuxer
Return device errors to demuxer from on/off streamming and pid filtering. Please test this patch with all dvb-usb devices. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
6f030abf9a
commit
c8b7ced346
1 changed files with 23 additions and 13 deletions
|
@ -12,7 +12,7 @@
|
||||||
static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff)
|
static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff)
|
||||||
{
|
{
|
||||||
struct dvb_usb_adapter *adap = dvbdmxfeed->demux->priv;
|
struct dvb_usb_adapter *adap = dvbdmxfeed->demux->priv;
|
||||||
int newfeedcount,ret;
|
int newfeedcount, ret;
|
||||||
|
|
||||||
if (adap == NULL)
|
if (adap == NULL)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
@ -24,9 +24,12 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff)
|
||||||
deb_ts("stop feeding\n");
|
deb_ts("stop feeding\n");
|
||||||
usb_urb_kill(&adap->stream);
|
usb_urb_kill(&adap->stream);
|
||||||
|
|
||||||
if (adap->props.streaming_ctrl != NULL)
|
if (adap->props.streaming_ctrl != NULL) {
|
||||||
if ((ret = adap->props.streaming_ctrl(adap,0)))
|
ret = adap->props.streaming_ctrl(adap, 0);
|
||||||
err("error while stopping stream.");
|
err("error while stopping stream.");
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
adap->feedcount = newfeedcount;
|
adap->feedcount = newfeedcount;
|
||||||
|
@ -49,17 +52,24 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff)
|
||||||
|
|
||||||
deb_ts("controlling pid parser\n");
|
deb_ts("controlling pid parser\n");
|
||||||
if (adap->props.caps & DVB_USB_ADAP_HAS_PID_FILTER &&
|
if (adap->props.caps & DVB_USB_ADAP_HAS_PID_FILTER &&
|
||||||
adap->props.caps & DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF &&
|
adap->props.caps &
|
||||||
adap->props.pid_filter_ctrl != NULL)
|
DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF &&
|
||||||
if (adap->props.pid_filter_ctrl(adap,adap->pid_filtering) < 0)
|
adap->props.pid_filter_ctrl != NULL) {
|
||||||
|
ret = adap->props.pid_filter_ctrl(adap,
|
||||||
|
adap->pid_filtering);
|
||||||
|
if (ret < 0) {
|
||||||
err("could not handle pid_parser");
|
err("could not handle pid_parser");
|
||||||
|
return ret;
|
||||||
deb_ts("start feeding\n");
|
|
||||||
if (adap->props.streaming_ctrl != NULL)
|
|
||||||
if (adap->props.streaming_ctrl(adap,1)) {
|
|
||||||
err("error while enabling fifo.");
|
|
||||||
return -ENODEV;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
deb_ts("start feeding\n");
|
||||||
|
if (adap->props.streaming_ctrl != NULL) {
|
||||||
|
ret = adap->props.streaming_ctrl(adap, 1);
|
||||||
|
if (ret < 0) {
|
||||||
|
err("error while enabling fifo.");
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue