src/gui/movieplayer.cpp delete chid if not used

This commit is contained in:
Jacek Jendrzej
2016-04-16 17:50:52 +02:00
parent 1e38d90b23
commit 7daf49644d

View File

@@ -694,12 +694,15 @@ void* CMoviePlayerGui::bgPlayThread(void *arg)
bool started = mp->StartWebtv();
printf("%s: started: %d\n", __func__, started);fflush(stdout);
bool chidused = false;
mutex.lock();
if (!webtv_started)
started = false;
else if (!started)
else if (!started){
g_RCInput->postMsg(NeutrinoMessages::EVT_ZAP_FAILED, (neutrino_msg_data_t) chid);
chidused = true;
}
webtv_started = started;
mutex.unlock();
@@ -715,6 +718,7 @@ void* CMoviePlayerGui::bgPlayThread(void *arg)
if (eof > 5) {
printf("CMoviePlayerGui::bgPlayThread: playback stopped, try to rezap...\n");
g_RCInput->postMsg(NeutrinoMessages::EVT_WEBTV_ZAP_COMPLETE, (neutrino_msg_data_t) chid);
chidused = true;
break;
}
pos = mp->position;
@@ -728,6 +732,9 @@ void* CMoviePlayerGui::bgPlayThread(void *arg)
}
printf("%s: play end...\n", __func__);fflush(stdout);
mp->PlayFileEnd();
if(!chidused)
delete [] chid;
pthread_exit(NULL);
}