*
* Authors: Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifdef HAVE_CONFIG_H
case VOUT_CONTROL_OSD_TITLE:
case VOUT_CONTROL_CHANGE_FILTERS:
case VOUT_CONTROL_CHANGE_SUB_SOURCES:
+ case VOUT_CONTROL_CHANGE_SUB_FILTERS:
free(cmd->u.string);
break;
default:
vlc_cond_init(&ctrl->wait_acknowledge);
ctrl->is_dead = false;
- ctrl->is_sleeping = false;
ctrl->can_sleep = true;
ctrl->is_processing = false;
ARRAY_INIT(ctrl->cmd);
{
vlc_mutex_lock(&ctrl->lock);
ctrl->can_sleep = false;
- if (ctrl->is_sleeping)
- vlc_cond_signal(&ctrl->wait_request);
+ vlc_cond_signal(&ctrl->wait_request);
vlc_mutex_unlock(&ctrl->lock);
}
vlc_cond_broadcast(&ctrl->wait_acknowledge);
const mtime_t max_deadline = mdate() + timeout;
+ const mtime_t wait_deadline = deadline <= VLC_TS_INVALID ? max_deadline : __MIN(deadline, max_deadline);
- /* Supurious wake up are perfectly fine */
- if (deadline <= VLC_TS_INVALID) {
- ctrl->is_sleeping = true;
- if (ctrl->can_sleep)
- vlc_cond_timedwait(&ctrl->wait_request, &ctrl->lock, max_deadline);
- ctrl->is_sleeping = false;
- } else {
- vlc_cond_timedwait(&ctrl->wait_request, &ctrl->lock, __MIN(deadline, max_deadline));
- }
+ /* Spurious wakeups are perfectly fine */
+ if (ctrl->can_sleep)
+ vlc_cond_timedwait(&ctrl->wait_request, &ctrl->lock, wait_deadline);
}
bool has_cmd;