vlc | branch: master | Francois Cartegnie <[email protected]> | Wed Sep 7 15:59:44 2016 +0200| [c97a77dd8252ddfedc7e8738de2a6ffb95ad655c] | committer: Francois Cartegnie
vout: remove useless locking and epg loop > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c97a77dd8252ddfedc7e8738de2a6ffb95ad655c --- src/video_output/video_epg.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/video_output/video_epg.c b/src/video_output/video_epg.c index 3c16cb1..ce149e9 100644 --- a/src/video_output/video_epg.c +++ b/src/video_output/video_epg.c @@ -279,23 +279,25 @@ int vout_OSDEpg(vout_thread_t *vout, input_item_t *input) char *now_playing = input_item_GetNowPlayingFb(input); vlc_epg_t *epg = NULL; - vlc_mutex_lock(&input->lock); - /* Look for the current program EPG event */ - for (int i = 0; i < input->i_epg; i++) { - vlc_epg_t *tmp = input->pp_epg[i]; - - if (tmp->p_current && - tmp->p_current->psz_name && now_playing != NULL && - !strcmp(tmp->p_current->psz_name, now_playing)) { - epg = vlc_epg_New(tmp->psz_name); - vlc_epg_Merge(epg, tmp); - break; + if(now_playing){ + vlc_mutex_lock(&input->lock); + + for (int i = 0; i < input->i_epg; i++) { + const vlc_epg_t *tmp = input->pp_epg[i]; + + if (tmp->p_current && + tmp->p_current->psz_name && + !strcmp(tmp->p_current->psz_name, now_playing)) { + epg = vlc_epg_New(tmp->psz_name); + vlc_epg_Merge(epg, tmp); + break; + } } - } - vlc_mutex_unlock(&input->lock); - free(now_playing); + vlc_mutex_unlock(&input->lock); + free(now_playing); + } /* If no EPG event has been found. */ if (epg == NULL) _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
