+ vlc_mutex_lock( &p_item->lock );
+
+ /* */
+ vlc_epg_t *p_epg = NULL;
+ for( int i = 0; i < p_item->i_epg; i++ )
+ {
+ vlc_epg_t *p_tmp = p_item->pp_epg[i];
+
+ if( (p_tmp->psz_name == NULL) != (p_update->psz_name == NULL) )
+ continue;
+ if( p_tmp->psz_name && p_update->psz_name && strcmp(p_tmp->psz_name, p_update->psz_name) )
+ continue;
+
+ p_epg = p_tmp;
+ break;
+ }
+
+ /* */
+ if( !p_epg )
+ {
+ p_epg = vlc_epg_New( p_update->psz_name );
+ if( p_epg )
+ TAB_APPEND( p_item->i_epg, p_item->pp_epg, p_epg );
+ }
+ if( p_epg )
+ vlc_epg_Merge( p_epg, p_update );
+
+ vlc_mutex_unlock( &p_item->lock );
+
+#ifdef EPG_DEBUG
+ char *psz_epg;
+ if( asprintf( &psz_epg, "EPG %s", p_epg->psz_name ? p_epg->psz_name : "unknown" ) < 0 )
+ goto signal;
+