From 48d69b5f853cc3fad7051b2f029d2dca612ef850 Mon Sep 17 00:00:00 2001 From: Andy Walls Date: Thu, 31 Dec 2009 01:35:08 -0300 Subject: [PATCH] --- yaml --- r: 181459 b: refs/heads/master c: 7b1dde03314912cfa9a5fa34ea9423df0db13860 h: refs/heads/master i: 181457: 145775b674909fd447b78140963772b512b8d914 181455: 0aed9d430d257fcba2f56fe35e4218528b3e94b4 v: v3 --- [refs] | 2 +- trunk/drivers/media/video/cx18/cx18-queue.c | 3 +++ trunk/drivers/media/video/cx18/cx18-streams.c | 22 ++++++++++++++++--- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 5edca1c63e64..f3b607dda61f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 540bab93b769c757e92f1bd5e980a2ef647d4e86 +refs/heads/master: 7b1dde03314912cfa9a5fa34ea9423df0db13860 diff --git a/trunk/drivers/media/video/cx18/cx18-queue.c b/trunk/drivers/media/video/cx18/cx18-queue.c index 63304823cef5..aefc8c8cf3c1 100644 --- a/trunk/drivers/media/video/cx18/cx18-queue.c +++ b/trunk/drivers/media/video/cx18/cx18-queue.c @@ -419,6 +419,9 @@ void cx18_stream_free(struct cx18_stream *s) { struct cx18_mdl *mdl; struct cx18_buffer *buf; + struct cx18 *cx = s->cx; + + CX18_DEBUG_INFO("Deallocating buffers for %s stream\n", s->name); /* move all buffers to buf_pool and all MDLs to q_idle */ cx18_unload_queues(s); diff --git a/trunk/drivers/media/video/cx18/cx18-streams.c b/trunk/drivers/media/video/cx18/cx18-streams.c index 9be603c00fb4..1764971f3dac 100644 --- a/trunk/drivers/media/video/cx18/cx18-streams.c +++ b/trunk/drivers/media/video/cx18/cx18-streams.c @@ -319,11 +319,27 @@ void cx18_streams_cleanup(struct cx18 *cx, int unregister) /* Teardown all streams */ for (type = 0; type < CX18_MAX_STREAMS; type++) { - if (cx->streams[type].dvb.enabled) { - cx18_dvb_unregister(&cx->streams[type]); - cx->streams[type].dvb.enabled = false; + + /* No struct video_device, but can have buffers allocated */ + if (type == CX18_ENC_STREAM_TYPE_TS) { + if (cx->streams[type].dvb.enabled) { + cx18_dvb_unregister(&cx->streams[type]); + cx->streams[type].dvb.enabled = false; + cx18_stream_free(&cx->streams[type]); + } + continue; + } + + /* No struct video_device, but can have buffers allocated */ + if (type == CX18_ENC_STREAM_TYPE_IDX) { + if (cx->stream_buffers[type] != 0) { + cx->stream_buffers[type] = 0; + cx18_stream_free(&cx->streams[type]); + } + continue; } + /* If struct video_device exists, can have buffers allocated */ vdev = cx->streams[type].video_dev; cx->streams[type].video_dev = NULL;