[vlc-commits] input: signal when an es fmt is updated

Thomas Guillem git at videolan.org
Mon Sep 3 17:05:49 CEST 2018


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Aug 16 15:51:24 2018 +0200| [2acf5e18ee17f9c75718a5f121b199c730543c13] | committer: Thomas Guillem

input: signal when an es fmt is updated

Will be used by the future vlc_player. It will allow to browse all es tracks
with an up to date fmt.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2acf5e18ee17f9c75718a5f121b199c730543c13
---

 include/vlc_input.h |  1 +
 src/input/es_out.c  |  4 +++-
 src/input/event.c   | 10 ++++++++++
 src/input/event.h   |  1 +
 src/input/var.c     |  2 ++
 5 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/include/vlc_input.h b/include/vlc_input.h
index f865e3a1ef..3d01df0dd3 100644
--- a/include/vlc_input.h
+++ b/include/vlc_input.h
@@ -428,6 +428,7 @@ struct vlc_input_event_es {
     enum {
         VLC_INPUT_ES_ADDED,
         VLC_INPUT_ES_DELETED,
+        VLC_INPUT_ES_UPDATED,
         VLC_INPUT_ES_SELECTED,
         VLC_INPUT_ES_UNSELECTED,
     } action;
diff --git a/src/input/es_out.c b/src/input/es_out.c
index 3a8134d6f5..f62e87e415 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -3134,7 +3134,6 @@ static void EsOutUpdateInfo( es_out_t *out, es_out_id_t *es, const es_format_t *
     if( es->fmt.i_cat == fmt->i_cat )
     {
         es_format_t update = *fmt;
-        update.i_id = es->i_meta_id;
         update.i_codec = es->fmt.i_codec;
         update.i_original_fourcc = es->fmt.i_original_fourcc;
 
@@ -3160,6 +3159,9 @@ static void EsOutUpdateInfo( es_out_t *out, es_out_id_t *es, const es_format_t *
         update.i_extra = 0;
         update.p_extra = NULL;
 
+        input_SendEventEsUpdate(p_input, &update);
+
+        update.i_id = es->i_meta_id;
         input_item_UpdateTracksInfo(input_GetItem(p_input), &update);
     }
 
diff --git a/src/input/event.c b/src/input/event.c
index 12bbe7f9f8..01b8f53e70 100644
--- a/src/input/event.c
+++ b/src/input/event.c
@@ -234,6 +234,16 @@ void input_SendEventEsAdd( input_thread_t *p_input, const es_format_t *p_fmt,
         }
     });
 }
+void input_SendEventEsUpdate( input_thread_t *p_input, const es_format_t *p_fmt )
+{
+    input_SendEvent( p_input, &(struct vlc_input_event) {
+        .type = INPUT_EVENT_ES,
+        .es = {
+            .action = VLC_INPUT_ES_UPDATED,
+            .fmt = p_fmt,
+        }
+    });
+}
 void input_SendEventEsDel( input_thread_t *p_input,
                            const es_format_t *p_fmt )
 {
diff --git a/src/input/event.h b/src/input/event.h
index faead56a5a..5057458565 100644
--- a/src/input/event.h
+++ b/src/input/event.h
@@ -63,6 +63,7 @@ void input_SendEventProgramScrambled( input_thread_t *p_input, int i_group, bool
 void input_SendEventEsDel( input_thread_t *p_input, const es_format_t *fmt );
 void input_SendEventEsAdd( input_thread_t *p_input,
                            const es_format_t *fmt, const char *psz_title );
+void input_SendEventEsUpdate( input_thread_t *p_input, const es_format_t *fmt );
 void input_SendEventEsSelect( input_thread_t *p_input, const es_format_t *fmt );
 void input_SendEventEsUnselect( input_thread_t *p_input, const es_format_t *fmt );
 
diff --git a/src/input/var.c b/src/input/var.c
index bd36c1ad87..1d6710c465 100644
--- a/src/input/var.c
+++ b/src/input/var.c
@@ -376,6 +376,8 @@ void input_LegacyEvents( input_thread_t *p_input,
                         VarListSelect( p_input, "teletext-es", i_id );
                     break;
                 }
+                case VLC_INPUT_ES_UPDATED:
+                    break;
             }
             break;
         case INPUT_EVENT_RECORD:



More information about the vlc-commits mailing list