[vlc-devel] [PATCH 5/6] m3u: Handle nested satip playlists

Felix Paul Kühne fkuehne at videolan.org
Wed Jul 20 17:25:21 CEST 2016


From: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

---
 modules/demux/playlist/m3u.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/modules/demux/playlist/m3u.c b/modules/demux/playlist/m3u.c
index aa163ac..eb37536 100644
--- a/modules/demux/playlist/m3u.c
+++ b/modules/demux/playlist/m3u.c
@@ -315,6 +315,23 @@ static int Demux( demux_t *p_demux )
                 }
             }
 
+            if ( p_demux->p_sys->psz_satip_device )
+            {
+                char* psz_ext = strrchr( psz_mrl, '.' );
+                if ( psz_ext && !strcasecmp( psz_ext, ".m3u" ) )
+                {
+                    char *psz_new_mrl;
+                    if ( asprintf( &psz_new_mrl, "%s?satip-device=%s", psz_mrl, p_demux->p_sys->psz_satip_device ) < 0 )
+                    {
+                        free( psz_parse );
+                        free( psz_mrl );
+                        goto error;
+                    }
+                    free( psz_mrl );
+                    psz_mrl = psz_new_mrl;
+                }
+            }
+
             p_input = input_item_NewExt( psz_mrl, psz_name, i_duration,
                                          ITEM_TYPE_UNKNOWN, ITEM_NET_UNKNOWN );
             free( psz_parse );
-- 
2.9.2



More information about the vlc-devel mailing list