diff options
-rw-r--r-- | drivers/media/video/cx18/cx18-dvb.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/media/video/cx18/cx18-dvb.c b/drivers/media/video/cx18/cx18-dvb.c index c9744173f969..cae38985b131 100644 --- a/drivers/media/video/cx18/cx18-dvb.c +++ b/drivers/media/video/cx18/cx18-dvb.c | |||
@@ -69,11 +69,21 @@ static int cx18_dvb_start_feed(struct dvb_demux_feed *feed) | |||
69 | struct dvb_demux *demux = feed->demux; | 69 | struct dvb_demux *demux = feed->demux; |
70 | struct cx18_stream *stream = (struct cx18_stream *) demux->priv; | 70 | struct cx18_stream *stream = (struct cx18_stream *) demux->priv; |
71 | struct cx18 *cx = stream->cx; | 71 | struct cx18 *cx = stream->cx; |
72 | int ret = -EINVAL; | 72 | int ret; |
73 | u32 v; | 73 | u32 v; |
74 | 74 | ||
75 | CX18_DEBUG_INFO("Start feed: pid = 0x%x index = %d\n", | 75 | CX18_DEBUG_INFO("Start feed: pid = 0x%x index = %d\n", |
76 | feed->pid, feed->index); | 76 | feed->pid, feed->index); |
77 | |||
78 | mutex_lock(&cx->serialize_lock); | ||
79 | ret = cx18_init_on_first_open(cx); | ||
80 | mutex_unlock(&cx->serialize_lock); | ||
81 | if (ret) { | ||
82 | CX18_ERR("Failed to initialize firmware starting DVB feed\n"); | ||
83 | return ret; | ||
84 | } | ||
85 | ret = -EINVAL; | ||
86 | |||
77 | switch (cx->card->type) { | 87 | switch (cx->card->type) { |
78 | case CX18_CARD_HVR_1600_ESMT: | 88 | case CX18_CARD_HVR_1600_ESMT: |
79 | case CX18_CARD_HVR_1600_SAMSUNG: | 89 | case CX18_CARD_HVR_1600_SAMSUNG: |
@@ -101,6 +111,11 @@ static int cx18_dvb_start_feed(struct dvb_demux_feed *feed) | |||
101 | if (stream->dvb.feeding++ == 0) { | 111 | if (stream->dvb.feeding++ == 0) { |
102 | CX18_DEBUG_INFO("Starting Transport DMA\n"); | 112 | CX18_DEBUG_INFO("Starting Transport DMA\n"); |
103 | ret = cx18_start_v4l2_encode_stream(stream); | 113 | ret = cx18_start_v4l2_encode_stream(stream); |
114 | if (ret < 0) { | ||
115 | CX18_DEBUG_INFO( | ||
116 | "Failed to start Transport DMA\n"); | ||
117 | stream->dvb.feeding--; | ||
118 | } | ||
104 | } else | 119 | } else |
105 | ret = 0; | 120 | ret = 0; |
106 | mutex_unlock(&stream->dvb.feedlock); | 121 | mutex_unlock(&stream->dvb.feedlock); |