[vlc-commits] input: parse `:input-slave" options earlier
vlc/vlc-3.0 | branch: master | Alaric Senat | Thu Apr 22 11:42:12 2021 +0200| [bc53d6edc62772765924118e7e6ed39ac7464a11] | committer: Jean-Baptiste Kempf input: parse `:input-slave" options earlier Move the option parsing right before the input-item slaves copy. This avoid input-slaves unnecessary duplication each time the input is reparsed as the input-item slaves copy itself avoid duplicating. Fixes #19977 (cherry picked from commit 4f7522e620be01a3662bd985aeca1a2b8c4b7ff4) Signed-off-by: Jean-Baptiste Kempf > http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=bc53d6edc62772765924118e7e6ed39ac7464a11 --- src/input/input.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/input/input.c b/src/input/input.c index 81cfac86cc..f8c0cf796c 100644 --- a/src/input/input.c +++ b/src/input/input.c @@ -1148,6 +1148,9 @@ static void LoadSlaves( input_thread_t *p_input ) free( psz_autopath ); } +/* Add slaves from the "input-slave" option */ +GetVarSlaves( p_input, &pp_slaves, &i_slaves ); + /* Add slaves found by the directory demuxer or via libvlc */ input_item_t *p_item = input_priv(p_input)->p_item; vlc_mutex_lock( &p_item->lock ); @@ -1165,9 +1168,6 @@ static void LoadSlaves( input_thread_t *p_input ) TAB_CLEAN( p_item->i_slaves, p_item->pp_slaves ); vlc_mutex_unlock( &p_item->lock ); -/* Add slaves from the "input-slave" option */ -GetVarSlaves( p_input, &pp_slaves, &i_slaves ); - if( i_slaves > 0 ) qsort( pp_slaves, i_slaves, sizeof (input_item_slave_t*), SlaveCompare ); ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] input: add url parsing of `input-slave` option
vlc/vlc-3.0 | branch: master | Alaric Senat | Fri Apr 2 16:30:07 2021 +0200| [6cbe6f5b1774ce491157f8ccaedb5ce36e1159c0] | committer: Steve Lhomme input: add url parsing of `input-slave` option As shown in #25549, we need to extract the path from the url in order to check the file extension without the eventual HTTP's options noise. Fixes: #25549 Signed-off-by: Thomas Guillem (cherry picked from commit bbdaa0b64a0626282d1dca2051c233969f00e1d7) Signed-off-by: Steve Lhomme > http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=6cbe6f5b1774ce491157f8ccaedb5ce36e1159c0 --- src/input/input.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/input/input.c b/src/input/input.c index 49eeab3b0e..81cfac86cc 100644 --- a/src/input/input.c +++ b/src/input/input.c @@ -1058,8 +1058,18 @@ static void GetVarSlaves( input_thread_t *p_input, if( uri == NULL ) continue; +vlc_url_t parsed_uri; +if ( vlc_UrlParse( &parsed_uri, uri ) != VLC_SUCCESS ) +{ +msg_Err( p_input, +"Invalid url passed to the \"input-slave\" option" ); +vlc_UrlClean( &parsed_uri ); +free( uri ); +continue; +} + enum slave_type i_type; -if ( !input_item_slave_GetType(uri, &i_type) ) +if ( !input_item_slave_GetType( parsed_uri.psz_path, &i_type ) ) { msg_Warn( p_input, "Can't deduce slave type of `%s\" with file extension.", @@ -1069,6 +1079,7 @@ static void GetVarSlaves( input_thread_t *p_input, input_item_slave_t *p_slave = input_item_slave_New( uri, i_type, SLAVE_PRIORITY_USER ); +vlc_UrlClean( &parsed_uri ); free( uri ); if( unlikely( p_slave == NULL ) ) ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] input: add url parsing of `input-slave` option
vlc | branch: master | Alaric Senat | Fri Apr 2 16:30:07 2021 +0200| [bbdaa0b64a0626282d1dca2051c233969f00e1d7] | committer: Thomas Guillem input: add url parsing of `input-slave` option As shown in #25549, we need to extract the path from the url in order to check the file extension without the eventual HTTP's options noise. Fixes: #25549 Signed-off-by: Thomas Guillem > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bbdaa0b64a0626282d1dca2051c233969f00e1d7 --- src/input/input.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/input/input.c b/src/input/input.c index 286dfe3fd7..e52fdd9d2f 100644 --- a/src/input/input.c +++ b/src/input/input.c @@ -984,8 +984,18 @@ static void GetVarSlaves( input_thread_t *p_input, if( uri == NULL ) continue; +vlc_url_t parsed_uri; +if ( vlc_UrlParse( &parsed_uri, uri ) != VLC_SUCCESS ) +{ +msg_Err( p_input, +"Invalid url passed to the \"input-slave\" option" ); +vlc_UrlClean( &parsed_uri ); +free( uri ); +continue; +} + enum slave_type i_type; -if ( !input_item_slave_GetType(uri, &i_type) ) +if ( !input_item_slave_GetType( parsed_uri.psz_path, &i_type ) ) { msg_Warn( p_input, "Can't deduce slave type of `%s\" with file extension.", @@ -995,6 +1005,7 @@ static void GetVarSlaves( input_thread_t *p_input, input_item_slave_t *p_slave = input_item_slave_New( uri, i_type, SLAVE_PRIORITY_USER ); +vlc_UrlClean( &parsed_uri ); free( uri ); if( unlikely( p_slave == NULL ) ) ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] input: fix `input-slave` option for subtitles
vlc/vlc-3.0 | branch: master | Alaric Senat | Tue Mar 30 15:29:53 2021 +0200| [8fe00499352f149f2fd6d6e1e065a3fca1a6b163] | committer: Thomas Guillem input: fix `input-slave` option for subtitles Since c34d719f, all files passed by the option `input-slave` were set as audio tracks no matter what. Theses changes force subtitle demux on files with a known spu extension. Fixes #25549 Signed-off-by: Thomas Guillem (cherry picked from commit 08a3c76355b0ba9eb6658a730cc6c763775b63b6) Signed-off-by: Thomas Guillem > http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=8fe00499352f149f2fd6d6e1e065a3fca1a6b163 --- src/input/input.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/input/input.c b/src/input/input.c index 1b8a2eb83d..49eeab3b0e 100644 --- a/src/input/input.c +++ b/src/input/input.c @@ -1058,8 +1058,17 @@ static void GetVarSlaves( input_thread_t *p_input, if( uri == NULL ) continue; +enum slave_type i_type; +if ( !input_item_slave_GetType(uri, &i_type) ) +{ +msg_Warn( p_input, + "Can't deduce slave type of `%s\" with file extension.", + uri ); +i_type = SLAVE_TYPE_AUDIO; +} input_item_slave_t *p_slave = -input_item_slave_New( uri, SLAVE_TYPE_AUDIO, SLAVE_PRIORITY_USER ); +input_item_slave_New( uri, i_type, SLAVE_PRIORITY_USER ); + free( uri ); if( unlikely( p_slave == NULL ) ) ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] input: fix `input-slave` option for subtitles
vlc | branch: master | Alaric Senat | Tue Mar 30 15:29:53 2021 +0200| [08a3c76355b0ba9eb6658a730cc6c763775b63b6] | committer: Thomas Guillem input: fix `input-slave` option for subtitles Since c34d719f, all files passed by the option `input-slave` were set as audio tracks no matter what. Theses changes force subtitle demux on files with a known spu extension. Fixes #25549 Signed-off-by: Thomas Guillem > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=08a3c76355b0ba9eb6658a730cc6c763775b63b6 --- src/input/input.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/input/input.c b/src/input/input.c index ea64473a0b..286dfe3fd7 100644 --- a/src/input/input.c +++ b/src/input/input.c @@ -984,8 +984,17 @@ static void GetVarSlaves( input_thread_t *p_input, if( uri == NULL ) continue; +enum slave_type i_type; +if ( !input_item_slave_GetType(uri, &i_type) ) +{ +msg_Warn( p_input, + "Can't deduce slave type of `%s\" with file extension.", + uri ); +i_type = SLAVE_TYPE_AUDIO; +} input_item_slave_t *p_slave = -input_item_slave_New( uri, SLAVE_TYPE_AUDIO, SLAVE_PRIORITY_USER ); +input_item_slave_New( uri, i_type, SLAVE_PRIORITY_USER ); + free( uri ); if( unlikely( p_slave == NULL ) ) ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] transcode: Fix typos in the video encoder config
vlc | branch: master | Alaric Senat | Mon Jan 18 14:37:56 2021 +0100| [ad0e707bd6f096dffd48e9942cd61c2ddf61c994] | committer: Steve Lhomme transcode: Fix typos in the video encoder config Signed-off-by: Steve Lhomme > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ad0e707bd6f096dffd48e9942cd61c2ddf61c994 --- modules/stream_out/transcode/encoder/video.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/stream_out/transcode/encoder/video.c b/modules/stream_out/transcode/encoder/video.c index cfa4b09504..5e7a3690ea 100644 --- a/modules/stream_out/transcode/encoder/video.c +++ b/modules/stream_out/transcode/encoder/video.c @@ -261,11 +261,11 @@ void transcode_encoder_video_configure( vlc_object_t *p_obj, p_enc_out->i_width = p_enc_in->i_width; p_enc_out->i_visible_width = p_enc_in->i_visible_width; p_enc_out->i_height = p_enc_in->i_height; -p_enc_out->i_visible_height = p_enc_out->i_visible_height; +p_enc_out->i_visible_height = p_enc_in->i_visible_height; -transcode_video_sar_apply( p_src, p_enc_out ); -p_enc_in->i_sar_num = p_enc_out->i_sar_num; -p_enc_in->i_sar_den = p_enc_out->i_sar_den; +transcode_video_sar_apply( p_src, p_enc_in ); +p_enc_out->i_sar_num = p_enc_in->i_sar_num; +p_enc_out->i_sar_den = p_enc_in->i_sar_den; msg_Dbg( p_obj, "encoder aspect is %u:%u", p_enc_out->i_sar_num * p_enc_out->i_width, p_enc_out->i_sar_den * p_enc_out->i_height ); ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] upnp: Correct top directory url formatting
vlc | branch: master | Alaric Senat | Wed Nov 18 19:32:27 2020 +0100| [f5f5a0d0ddb6c96ab08a6b3ca1115dcbd2ae2c77] | committer: Thomas Guillem upnp: Correct top directory url formatting As pointed out in #25055 the choice of url option delimiter is probably meant to be that way. std::string.find() returns std::string::npos (aka -1) in case of no match. Signed-off-by: Thomas Guillem > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f5f5a0d0ddb6c96ab08a6b3ca1115dcbd2ae2c77 --- modules/services_discovery/upnp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services_discovery/upnp.cpp b/modules/services_discovery/upnp.cpp index 054a5d1910..a249e3b4d2 100644 --- a/modules/services_discovery/upnp.cpp +++ b/modules/services_discovery/upnp.cpp @@ -407,7 +407,7 @@ bool MediaServerList::addServer( MediaServerDesc* desc ) } else { char* psz_mrl; // We might already have some options specified in the location. -char opt_delim = desc->location.find( '?' ) == 0 ? '?' : '&'; +char opt_delim = desc->location.find( '?' ) == std::string::npos ? '?' : '&'; if( asprintf( &psz_mrl, "upnp://%s%cObjectID=0", desc->location.c_str(), opt_delim ) < 0 ) return false; ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits