[vlc-commits] [Git][videolan/vlc][master] 5 commits: es_out: send the ES updated event after EsOutUpdateInfo()
Steve Lhomme (@robUx4)
gitlab at videolan.org
Sat Oct 7 07:06:01 UTC 2023
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
51b3ceb0 by Thomas Guillem at 2023-10-07T06:34:43+00:00
es_out: send the ES updated event after EsOutUpdateInfo()
EsOutUpdateInfo() update the input_item_t meta. Modifying the call order
here cause the INPUT_EVENT_ES::VLC_INPUT_ES_UPDATED to be sent just
after the item meta has been updated.
- - - - -
e68b6c74 by Thomas Guillem at 2023-10-07T06:34:43+00:00
es_out: don't call EsOutUpdateInfo() in case of alloc error
And make the code easier to read.
- - - - -
c7153d38 by Thomas Guillem at 2023-10-07T06:34:43+00:00
es_out: remove extra input_item_UpdateTracksInfo() call
It will be called just after from EsOutUpdateInfo()
- - - - -
33bff19d by Thomas Guillem at 2023-10-07T06:34:43+00:00
es_out: always call input_SendEventMetaInfo()
This event is not even listened by anything anyway... (bug!)
- - - - -
fe938751 by Thomas Guillem at 2023-10-07T06:34:43+00:00
player: listen for INPUT_EVENT_ITEM_INFO
It could be also possible to create a new event: on_media_info_changed.
- - - - -
3 changed files:
- include/vlc_player.h
- src/input/es_out.c
- src/player/input.c
Changes:
=====================================
include/vlc_player.h
=====================================
@@ -3136,7 +3136,7 @@ struct vlc_player_cbs
enum vlc_player_media_stopped_action new_action, void *data);
/**
- * Called when the media meta has changed
+ * Called when the media meta and/or info has changed
*
* @param player locked player instance
* @param media current media
=====================================
src/input/es_out.c
=====================================
@@ -1724,7 +1724,7 @@ static void EsOutProgramMeta( es_out_t *out, input_source_t *source,
input_item_MergeInfos( p_item, p_cat );
b_has_new_infos = true;
}
- if( p_sys->input_type != INPUT_TYPE_PREPARSING && b_has_new_infos )
+ if( b_has_new_infos )
input_SendEventMetaInfo( p_input );
}
@@ -1819,7 +1819,7 @@ static void EsOutProgramEpg( es_out_t *out, input_source_t *source,
else
ret = input_item_DelInfo( p_item, psz_cat, now_playing_tr );
- if( ret == VLC_SUCCESS && p_sys->input_type != INPUT_TYPE_PREPARSING )
+ if( ret == VLC_SUCCESS )
input_SendEventMetaInfo( p_input );
}
@@ -1863,7 +1863,7 @@ static void EsOutProgramUpdateScrambled( es_out_t *p_out, es_out_pgrm_t *p_pgrm
ret = input_item_DelInfo( p_item, psz_cat, _("Scrambled") );
free( psz_cat );
- if( ret == VLC_SUCCESS && p_sys->input_type != INPUT_TYPE_PREPARSING )
+ if( ret == VLC_SUCCESS )
input_SendEventMetaInfo( p_input );
input_SendEventProgramScrambled( p_input, p_pgrm->i_id, b_scrambled );
}
@@ -2976,10 +2976,12 @@ static int EsOutSend( es_out_t *out, es_out_id_t *es, block_t *p_block )
if( status.format.changed )
{
- if (EsOutEsUpdateFmt( out, es, &status.format.fmt ) == VLC_SUCCESS)
+ int ret = EsOutEsUpdateFmt( out, es, &status.format.fmt );
+ if (ret == VLC_SUCCESS)
+ {
+ EsOutUpdateInfo(out, es, status.format.meta);
EsOutSendEsEvent(out, es, VLC_INPUT_ES_UPDATED, false);
-
- EsOutUpdateInfo(out, es, status.format.meta);
+ }
es_format_Clean( &status.format.fmt );
if( status.format.meta )
@@ -4230,11 +4232,7 @@ static int EsOutEsUpdateFmt(es_out_t *out, es_out_id_t *es,
es_format_Clean(&es->fmt_out);
int ret = es_format_Copy(&es->fmt_out, &update);
if (ret == VLC_SUCCESS)
- {
EsOutUpdateEsLanguageTitle(es, &es->fmt_out);
- input_item_UpdateTracksInfo(input_GetItem(p_input), &es->fmt_out,
- es->id.str_id, es->id.stable);
- }
return ret;
}
@@ -4616,8 +4614,7 @@ static void EsOutUpdateInfo( es_out_t *out, es_out_id_t *es, const vlc_meta_t *p
}
/* */
input_item_ReplaceInfos( p_item, p_cat );
- if( p_sys->input_type != INPUT_TYPE_PREPARSING )
- input_SendEventMetaInfo( p_input );
+ input_SendEventMetaInfo( p_input );
}
static void EsOutDeleteInfoEs( es_out_t *out, es_out_id_t *es )
@@ -4632,7 +4629,7 @@ static void EsOutDeleteInfoEs( es_out_t *out, es_out_id_t *es )
int ret = input_item_DelInfo(p_item, psz_info_category, NULL);
free(psz_info_category);
- if (ret == VLC_SUCCESS && p_sys->input_type != INPUT_TYPE_PREPARSING)
+ if (ret == VLC_SUCCESS)
input_SendEventMetaInfo(p_input);
}
=====================================
src/player/input.c
=====================================
@@ -860,6 +860,7 @@ input_thread_Events(input_thread_t *input_thread,
vlc_player_input_HandleVoutEvent(input, &event->vout);
break;
case INPUT_EVENT_ITEM_META:
+ case INPUT_EVENT_ITEM_INFO:
vlc_player_SendEvent(player, on_media_meta_changed,
input_GetItem(input->thread));
break;
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/67e2541b19b8a12f6d799222872dd0f0ac2e83b4...fe938751058cf15bc83107c87314a9fdc362a7f7
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/67e2541b19b8a12f6d799222872dd0f0ac2e83b4...fe938751058cf15bc83107c87314a9fdc362a7f7
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list