dvb: fix segmentation fault in case no valid configuration is found.

This was introduced in c55b242 .
This commit is contained in:
Oliver Freyermuth 2016-01-24 20:20:08 +01:00 committed by wm4
parent d917efcd58
commit 3c4f13c23a
1 changed files with 3 additions and 2 deletions

View File

@ -947,14 +947,15 @@ static int dvb_open(stream_t *stream)
} }
dvb_state_t* state = dvb_get_state(stream); dvb_state_t* state = dvb_get_state(stream);
state->stream_used = true;
pthread_mutex_unlock(&global_dvb_state_lock);
priv->state = state; priv->state = state;
if (state == NULL) { if (state == NULL) {
MP_ERR(stream, "DVB CONFIGURATION IS EMPTY, exit\n"); MP_ERR(stream, "DVB CONFIGURATION IS EMPTY, exit\n");
pthread_mutex_unlock(&global_dvb_state_lock);
return STREAM_ERROR; return STREAM_ERROR;
} }
state->stream_used = true;
pthread_mutex_unlock(&global_dvb_state_lock);
if (state->is_on != 1) { if (state->is_on != 1) {
// State could be already initialized, for example, we just did a channel switch. // State could be already initialized, for example, we just did a channel switch.