[vlc-commits] chromecast: demux: add init() method

Thomas Guillem git at videolan.org
Thu Feb 22 12:00:00 CET 2018


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Feb 20 17:08:59 2018 +0100| [1e041464d04832724df108f3648364e94897183c] | committer: Thomas Guillem

chromecast: demux: add init() method

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

 modules/stream_out/chromecast/chromecast_demux.cpp | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/modules/stream_out/chromecast/chromecast_demux.cpp b/modules/stream_out/chromecast/chromecast_demux.cpp
index 173d0b3ffa..a27ad181aa 100644
--- a/modules/stream_out/chromecast/chromecast_demux.cpp
+++ b/modules/stream_out/chromecast/chromecast_demux.cpp
@@ -47,11 +47,16 @@ struct demux_sys_t
         ,m_enabled( true )
         ,m_startTime( VLC_TS_INVALID )
     {
+        init();
+    }
+
+    void init()
+    {
         vlc_meta_t *p_meta = vlc_meta_New();
         if( likely(p_meta != NULL) )
         {
-            input_item_t *p_item = demux->p_next->p_input ?
-                                   input_GetItem( demux->p_next->p_input ) : NULL;
+            input_item_t *p_item = p_demux->p_next->p_input ?
+                                   input_GetItem( p_demux->p_next->p_input ) : NULL;
             if( p_item )
             {
                 /* Favor Meta from the input item of the input_thread since
@@ -76,12 +81,13 @@ struct demux_sys_t
                 }
                 p_renderer->pf_set_meta( p_renderer->p_opaque, p_meta );
             }
-            else if (demux_Control( demux->p_next, DEMUX_GET_META, p_meta) == VLC_SUCCESS)
+            else if (demux_Control( p_demux->p_next, DEMUX_GET_META, p_meta) == VLC_SUCCESS)
                 p_renderer->pf_set_meta( p_renderer->p_opaque, p_meta );
             else
                 vlc_meta_Delete( p_meta );
         }
-        if (demux_Control( demux->p_next, DEMUX_CAN_SEEK, &canSeek ) != VLC_SUCCESS)
+
+        if (demux_Control( p_demux->p_next, DEMUX_CAN_SEEK, &canSeek ) != VLC_SUCCESS)
             canSeek = false;
 
         int i_current_title;
@@ -90,7 +96,7 @@ struct demux_sys_t
         {
             input_title_t** pp_titles;
             int i_nb_titles, i_title_offset, i_chapter_offset;
-            if( demux_Control( demux->p_next, DEMUX_GET_TITLE_INFO, &pp_titles,
+            if( demux_Control( p_demux->p_next, DEMUX_GET_TITLE_INFO, &pp_titles,
                               &i_nb_titles, &i_title_offset,
                               &i_chapter_offset ) == VLC_SUCCESS )
             {
@@ -122,7 +128,7 @@ struct demux_sys_t
         }
 
         p_renderer->pf_set_on_paused_changed_cb(p_renderer->p_opaque,
-                                                on_paused_changed_cb, demux);
+                                                on_paused_changed_cb, p_demux);
     }
 
     ~demux_sys_t()



More information about the vlc-commits mailing list