From: Luigi Rizzo Date: Wed, 9 Jan 2008 12:13:32 +0000 (+0000) Subject: make get_video_desc() return the active console if X-Git-Tag: 1.6.0-beta1~3^2~140 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bbbef73276ae742957e97e4a102d7f0db677826d;p=thirdparty%2Fasterisk.git make get_video_desc() return the active console if passed a null argument (channel). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@97389 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_oss.c b/channels/chan_oss.c index 9bf749459e..4f40085fad 100644 --- a/channels/chan_oss.c +++ b/channels/chan_oss.c @@ -307,10 +307,12 @@ struct chan_oss_pvt { /*! forward declaration */ static struct chan_oss_pvt *find_desc(char *dev); +static char *oss_active; /*!< the active device */ + /*! \brief return the pointer to the video descriptor */ struct video_desc *get_video_desc(struct ast_channel *c) { - struct chan_oss_pvt *o = c->tech_pvt; + struct chan_oss_pvt *o = c ? c->tech_pvt : find_desc(oss_active); return o ? o->env : NULL; } static struct chan_oss_pvt oss_default = { @@ -327,7 +329,6 @@ static struct chan_oss_pvt oss_default = { .boost = BOOST_SCALE, }; -static char *oss_active; /*!< the active device */ static int setformat(struct chan_oss_pvt *o, int mode);