From 6f5e1a3230560828a1a3eb4dbeccdd35bd35958b Mon Sep 17 00:00:00 2001 From: Andy Walls Date: Thu, 31 Dec 2009 00:26:49 -0300 Subject: [PATCH] --- yaml --- r: 181458 b: refs/heads/master c: 540bab93b769c757e92f1bd5e980a2ef647d4e86 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/media/video/cx18/cx18-streams.c | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 82ab3b541333..5edca1c63e64 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: efc0b127b2e0135053680cd0118856b051450009 +refs/heads/master: 540bab93b769c757e92f1bd5e980a2ef647d4e86 diff --git a/trunk/drivers/media/video/cx18/cx18-streams.c b/trunk/drivers/media/video/cx18/cx18-streams.c index 987a9308d938..9be603c00fb4 100644 --- a/trunk/drivers/media/video/cx18/cx18-streams.c +++ b/trunk/drivers/media/video/cx18/cx18-streams.c @@ -340,6 +340,11 @@ void cx18_streams_cleanup(struct cx18 *cx, int unregister) } } +static inline bool cx18_stream_enabled(struct cx18_stream *s) +{ + return s->video_dev || s->dvb.enabled; +} + static void cx18_vbi_setup(struct cx18_stream *s) { struct cx18 *cx = s->cx; @@ -547,7 +552,7 @@ int cx18_start_v4l2_encode_stream(struct cx18_stream *s) int captype = 0; struct cx18_api_func_private priv; - if (s->video_dev == NULL && s->dvb.enabled == 0) + if (!cx18_stream_enabled(s)) return -EINVAL; CX18_DEBUG_INFO("Start encoder stream %s\n", s->name); @@ -705,7 +710,7 @@ void cx18_stop_all_captures(struct cx18 *cx) for (i = CX18_MAX_STREAMS - 1; i >= 0; i--) { struct cx18_stream *s = &cx->streams[i]; - if (s->video_dev == NULL && s->dvb.enabled == 0) + if (!cx18_stream_enabled(s)) continue; if (test_bit(CX18_F_S_STREAMING, &s->s_flags)) cx18_stop_v4l2_encode_stream(s, 0); @@ -717,7 +722,7 @@ int cx18_stop_v4l2_encode_stream(struct cx18_stream *s, int gop_end) struct cx18 *cx = s->cx; unsigned long then; - if (s->video_dev == NULL && s->dvb.enabled == 0) + if (!cx18_stream_enabled(s)) return -EINVAL; /* This function assumes that you are allowed to stop the capture @@ -789,7 +794,7 @@ struct cx18_stream *cx18_handle_to_stream(struct cx18 *cx, u32 handle) s = &cx->streams[i]; if (s->handle != handle) continue; - if (s->video_dev || s->dvb.enabled) + if (cx18_stream_enabled(s)) return s; } return NULL;