[vlc-commits] stream_filter: remove redundant tests
vlc | branch: master | Rémi Denis-Courmont | Thu Sep 24 20:06:41 2020 +0300| [9bd74c486afaf31ff2346bd8fcbb22617b72bff1] | committer: Rémi Denis-Courmont stream_filter: remove redundant tests Those checks are redundant as of the previous patch. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9bd74c486afaf31ff2346bd8fcbb22617b72bff1 --- modules/demux/playlist/asx.c | 3 --- modules/demux/playlist/b4s.c | 1 - modules/demux/playlist/bdmv.c | 2 -- modules/demux/playlist/dvb.c | 1 - modules/demux/playlist/ifo.c | 2 -- modules/demux/playlist/itml.c | 2 +- modules/demux/playlist/m3u.c | 1 - modules/demux/playlist/playlist.h | 6 -- modules/demux/playlist/pls.c | 2 -- modules/demux/playlist/podcast.c | 1 - modules/demux/playlist/qtl.c | 1 - modules/demux/playlist/ram.c | 1 - modules/demux/playlist/sgimb.c| 1 - modules/demux/playlist/wms.c | 2 -- modules/demux/playlist/wpl.c | 1 - modules/demux/playlist/xspf.c | 2 -- modules/lua/stream_filter.c | 6 ++ modules/stream_filter/record.c| 3 --- 18 files changed, 3 insertions(+), 35 deletions(-) diff --git a/modules/demux/playlist/asx.c b/modules/demux/playlist/asx.c index e17be85e96..1dc691736c 100644 --- a/modules/demux/playlist/asx.c +++ b/modules/demux/playlist/asx.c @@ -155,9 +155,6 @@ static bool PeekASX( stream_t *s ) int Import_ASX( vlc_object_t *p_this ) { stream_t *p_demux = (stream_t *)p_this; - -CHECK_FILE(p_demux); - char *type = stream_MimeType( p_demux->s ); if( stream_HasExtension( p_demux, ".asx" ) diff --git a/modules/demux/playlist/b4s.c b/modules/demux/playlist/b4s.c index cf6af71c3d..74f0f88e89 100644 --- a/modules/demux/playlist/b4s.c +++ b/modules/demux/playlist/b4s.c @@ -48,7 +48,6 @@ int Import_B4S( vlc_object_t *p_this ) { stream_t *demux = (stream_t *)p_this; -CHECK_FILE(demux); if( !stream_HasExtension( demux, ".b4s" ) ) return VLC_EGENERIC; diff --git a/modules/demux/playlist/bdmv.c b/modules/demux/playlist/bdmv.c index ab1f283838..762ac6cfbc 100644 --- a/modules/demux/playlist/bdmv.c +++ b/modules/demux/playlist/bdmv.c @@ -51,8 +51,6 @@ int Import_BDMV( vlc_object_t *p_this ) { stream_t *p_stream = (stream_t *)p_this; -CHECK_FILE(p_stream); - if( !stream_HasExtension( p_stream, ".BDMV" ) ) return VLC_EGENERIC; diff --git a/modules/demux/playlist/dvb.c b/modules/demux/playlist/dvb.c index 5dc6220203..ebbc46950f 100644 --- a/modules/demux/playlist/dvb.c +++ b/modules/demux/playlist/dvb.c @@ -45,7 +45,6 @@ int Import_DVB(vlc_object_t *p_this) { stream_t *demux = (stream_t *)p_this; -CHECK_FILE(demux); if (!stream_HasExtension(demux, ".conf" ) && !demux->obj.force ) return VLC_EGENERIC; diff --git a/modules/demux/playlist/ifo.c b/modules/demux/playlist/ifo.c index b62837f2fb..9468e133b4 100644 --- a/modules/demux/playlist/ifo.c +++ b/modules/demux/playlist/ifo.c @@ -52,8 +52,6 @@ int Import_IFO( vlc_object_t *p_this ) { stream_t *p_stream = (stream_t *)p_this; -CHECK_FILE(p_stream); - if( !stream_HasExtension( p_stream, ".IFO" ) ) return VLC_EGENERIC; diff --git a/modules/demux/playlist/itml.c b/modules/demux/playlist/itml.c index 0e4daccce7..66a4a2fd4e 100644 --- a/modules/demux/playlist/itml.c +++ b/modules/demux/playlist/itml.c @@ -45,7 +45,7 @@ static int ReadDir( stream_t *, input_item_node_t * ); int Import_iTML( vlc_object_t *p_this ) { stream_t *p_demux = (stream_t *)p_this; -CHECK_FILE(p_demux); + if( !stream_HasExtension( p_demux, ".xml" ) && !p_demux->obj.force ) return VLC_EGENERIC; diff --git a/modules/demux/playlist/m3u.c b/modules/demux/playlist/m3u.c index 2cf71fd8d8..73156cf3ed 100644 --- a/modules/demux/playlist/m3u.c +++ b/modules/demux/playlist/m3u.c @@ -80,7 +80,6 @@ int Import_M3U( vlc_object_t *p_this ) ssize_t i_peek; int offset = 0; -CHECK_FILE(p_stream); i_peek = vlc_stream_Peek( p_stream->s, _peek, 1024 ); if( i_peek < 8 ) return VLC_EGENERIC; diff --git a/modules/demux/playlist/playlist.h b/modules/demux/playlist/playlist.h index da7fa2affc..4d35a8e20c 100644 --- a/modules/demux/playlist/playlist.h +++ b/modules/demux/playlist/playlist.h @@ -65,9 +65,3 @@ void Close_WPL ( vlc_object_t * ); #define GetCurrentItem(obj) ((obj)->p_input_item) #define GetSource(obj) ((obj)->s) - -#define CHECK_FILE(obj) \ -do { \ -if( GetSource(obj)->pf_readdir != NULL ) \ -return VLC_EGENERIC; \ -} while(0) diff --git a/modules/demux/playlist/pls.c b/modules/demux/playlist/pls.c index 7ad7fad29a..5e885f7d75 100644 --- a/modules/demux/playlist/pls.c +++ b/modules/demux/playlist/pls.c @@ -47,8 +47,6 @@ int Import_PLS( vlc_object_t *p_this ) stream_t *p_demux = (stream_t *)p_this; const uint8_t *p_peek; -CHECK_FILE(p_demux); - if( vlc_stream_Peek( p_demux->s, _peek, 10 ) < 10 ) {
[vlc-commits] stream_filter: only filter byte streams
vlc | branch: master | Rémi Denis-Courmont | Thu Sep 24 20:04:42 2020 +0300| [60e36ce7d25f1badc3bd14931195a99c5afe1767] | committer: Rémi Denis-Courmont stream_filter: only filter byte streams All existing stream filters either implicitly (e.g. by peeking) or explicitly (by checking pf_* pointers) check that the source is a byte stream. Don't waste time probing filters for directories or (access_)demuxers. If we ever need to filter directories, we are better off adding a different capability to do so. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=60e36ce7d25f1badc3bd14931195a99c5afe1767 --- src/input/stream_filter.c | 4 1 file changed, 4 insertions(+) diff --git a/src/input/stream_filter.c b/src/input/stream_filter.c index 7b190a3739..40ccbeaf82 100644 --- a/src/input/stream_filter.c +++ b/src/input/stream_filter.c @@ -52,6 +52,10 @@ stream_t *vlc_stream_FilterNew( stream_t *p_source, { assert(p_source != NULL); +/* Stream filters can only filter byte streams. */ +if (p_source->pf_read == NULL && p_source->pf_block == NULL) +return NULL; + struct vlc_stream_filter_private *priv; stream_t *s = vlc_stream_CustomNew(vlc_object_parent(p_source), StreamDelete, sizeof (*priv), ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] mpc: register the file extensions
vlc | branch: master | Rémi Denis-Courmont | Fri Sep 25 17:15:50 2020 +0300| [d623807b3e1782645c4631799a9d6d05f2f4aca6] | committer: Rémi Denis-Courmont mpc: register the file extensions > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d623807b3e1782645c4631799a9d6d05f2f4aca6 --- modules/demux/mpc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/demux/mpc.c b/modules/demux/mpc.c index 6d52c61f9e..f08d6e1fa2 100644 --- a/modules/demux/mpc.c +++ b/modules/demux/mpc.c @@ -57,6 +57,9 @@ vlc_module_begin () set_callback( Open ) add_shortcut( "mpc" ) +add_file_extension("mpc") +add_file_extension("mp+") +add_file_extension("mpp") vlc_module_end () /* ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] tivo: register the file extensions
vlc | branch: master | Rémi Denis-Courmont | Fri Sep 25 17:15:50 2020 +0300| [4eb4c0ad640f4c5e4ddc160c452ea2a999cdc276] | committer: Rémi Denis-Courmont tivo: register the file extensions > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4eb4c0ad640f4c5e4ddc160c452ea2a999cdc276 --- modules/demux/ty.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/demux/ty.c b/modules/demux/ty.c index a911d39b71..ad783a6a96 100644 --- a/modules/demux/ty.c +++ b/modules/demux/ty.c @@ -70,6 +70,8 @@ vlc_module_begin () */ set_callbacks( Open, Close ) add_shortcut("ty", "tivo") +add_file_extension("ty") +add_file_extension("ty+") vlc_module_end () /* ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] demux: always use strongly-typed file extensions
vlc | branch: master | Rémi Denis-Courmont | Thu Sep 24 17:11:52 2020 +0300| [c16039c911c2fa95d2007cd3f5bf3e65edd9215c] | committer: Rémi Denis-Courmont demux: always use strongly-typed file extensions There are two sets of file extension to demux module mapping: - The "strong" set contains file extensions deemed reliable, either because the demux probe is reasonably strict and safe, or because the extension is rarely mismatched. - The "quick" set contains file extensions that are not considered reliable. This is essentially "mp3" which is supposedly (?) often misused for non-MPGA (or non-raw ES) files. The quick set cannot be used in normal parsing, as it could pick the the wrong demuxer (that is to say, MPEG ES). It was introduced in the original preparsing changeset, presumably to limit the overhead. There are however no obvious reasons not to use the strong set for preparsing. This patch does exactly that, and then removes duplicated mappings for Ogg and WMA. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c16039c911c2fa95d2007cd3f5bf3e65edd9215c --- src/input/demux.c | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/input/demux.c b/src/input/demux.c index 9190b7d5fc..ccefec76e7 100644 --- a/src/input/demux.c +++ b/src/input/demux.c @@ -120,21 +120,14 @@ static const char* DemuxNameFromExtension( char const* ext, static demux_mapping quick[] = { /* NOTE: shall be sorted in asc order */ { "mp3", "mpga" }, -{ "ogg", "ogg" }, -{ "wma", "asf" }, }; -struct { -demux_mapping* data; -size_t size; +demux_mapping *res = demux_lookup(ext, strong, ARRAY_SIZE(strong)); -} lookup = { -.data = b_preparsing ? quick : strong, -.size = b_preparsing ? ARRAY_SIZE( quick ) : ARRAY_SIZE( strong ) -}; +if (res == NULL && b_preparsing) +res = demux_lookup(ext, quick, ARRAY_SIZE(quick)); -demux_mapping* result = demux_lookup( ext, lookup.data, lookup.size ); -return result ? result->name : NULL; +return (res != NULL) ? res->name : NULL; } demux_t *demux_New( vlc_object_t *p_obj, const char *psz_name, ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] demux: merge two variables
vlc | branch: master | Rémi Denis-Courmont | Thu Sep 24 17:29:58 2020 +0300| [cf79771c2ece7ecd2e66485240bfd310dbf61b4d] | committer: Rémi Denis-Courmont demux: merge two variables (and don't use the same name as another variable in the same function) > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cf79771c2ece7ecd2e66485240bfd310dbf61b4d --- src/input/demux.c | 24 ++-- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/input/demux.c b/src/input/demux.c index 3808bbb927..9190b7d5fc 100644 --- a/src/input/demux.c +++ b/src/input/demux.c @@ -183,7 +183,7 @@ static int demux_Probe(void *func, bool forced, va_list ap) } demux_t *demux_NewAdvanced( vlc_object_t *p_obj, input_thread_t *p_input, -const char *psz_demux, const char *url, +const char *module, const char *url, stream_t *s, es_out_t *out, bool b_preparsing ) { struct vlc_demux_private *priv; @@ -196,18 +196,18 @@ demux_t *demux_NewAdvanced( vlc_object_t *p_obj, input_thread_t *p_input, assert(s != NULL); priv = vlc_stream_Private(p_demux); -if (!strcasecmp( psz_demux, "any" ) || !psz_demux[0]) +if (!strcasecmp(module, "any" ) || module[0] == '\0') { /* Look up demux by mime-type for hard to detect formats */ char *type = stream_MimeType( s ); if( type != NULL ) { -psz_demux = demux_NameFromMimeType( type ); +module = demux_NameFromMimeType( type ); free( type ); } } p_demux->p_input_item = p_input ? input_GetItem(p_input) : NULL; -p_demux->psz_name = strdup( psz_demux ); +p_demux->psz_name = strdup(module); if (unlikely(p_demux->psz_name == NULL)) goto error; @@ -221,7 +221,7 @@ demux_t *demux_NewAdvanced( vlc_object_t *p_obj, input_thread_t *p_input, if( !b_preparsing ) msg_Dbg( p_obj, "creating demux \"%s\", URL: %s, path: %s", - psz_demux, url, p_demux->psz_filepath ); + module, url, p_demux->psz_filepath ); p_demux->s = s; p_demux->out= out; @@ -231,22 +231,18 @@ demux_t *demux_NewAdvanced( vlc_object_t *p_obj, input_thread_t *p_input, p_demux->pf_control = NULL; p_demux->p_sys = NULL; -const char *psz_module = NULL; - -if( !strcmp( p_demux->psz_name, "any" ) && p_demux->psz_filepath ) +if (strcasecmp(module, "any") == 0 && p_demux->psz_filepath != NULL) { char const* psz_ext = strrchr( p_demux->psz_filepath, '.' ); if( psz_ext ) -psz_module = DemuxNameFromExtension( psz_ext + 1, b_preparsing ); +module = DemuxNameFromExtension( psz_ext + 1, b_preparsing ); } -if( psz_module == NULL ) -psz_module = p_demux->psz_name; - -priv->module = vlc_module_load(p_demux, "demux", psz_module, -!strcmp(psz_module, p_demux->psz_name), demux_Probe, p_demux); +bool strict = strcmp(module, p_demux->psz_name) == 0; +priv->module = vlc_module_load(p_demux, "demux", module, strict, + demux_Probe, p_demux); if (priv->module == NULL) { free( p_demux->psz_filepath ); ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] mpc: remove redundant extension checks
vlc | branch: master | Rémi Denis-Courmont | Fri Sep 25 17:16:03 2020 +0300| [4fddc116ff9cdd8ef5db5b45b803b1069f3acb30] | committer: Rémi Denis-Courmont mpc: remove redundant extension checks With the extension registered, the force flag is implied if the file name matches one of the extension. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4fddc116ff9cdd8ef5db5b45b803b1069f3acb30 --- modules/demux/mpc.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/modules/demux/mpc.c b/modules/demux/mpc.c index f08d6e1fa2..bd8891d2fc 100644 --- a/modules/demux/mpc.c +++ b/modules/demux/mpc.c @@ -110,13 +110,7 @@ static int Open( vlc_object_t * p_this ) return VLC_EGENERIC; if( !p_demux->obj.force ) -{ -/* Check file name extension */ -if( !demux_IsPathExtension( p_demux, ".mpc" ) && -!demux_IsPathExtension( p_demux, ".mp+" ) && -!demux_IsPathExtension( p_demux, ".mpp" ) ) -return VLC_EGENERIC; -} +return VLC_EGENERIC; } /* */ ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] demux: inline one trivial function
vlc | branch: master | Rémi Denis-Courmont | Thu Sep 24 17:47:49 2020 +0300| [9d858fe2e990c30fef21c8c27e1a57770d7cbccc] | committer: Rémi Denis-Courmont demux: inline one trivial function > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9d858fe2e990c30fef21c8c27e1a57770d7cbccc --- src/input/demux.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/input/demux.c b/src/input/demux.c index 4a534530e5..a854037e71 100644 --- a/src/input/demux.c +++ b/src/input/demux.c @@ -49,12 +49,6 @@ static int demux_mapping_cmp( const void *k, const void *v ) return vlc_ascii_strcasecmp( k, entry->key ); } -static demux_mapping* demux_lookup( char const* key, -demux_mapping* data, size_t size ) -{ -return bsearch( key, data, size, sizeof( *data ), demux_mapping_cmp ); -} - static const char *demux_NameFromMimeType(const char *mime) { static demux_mapping types[] = @@ -69,7 +63,9 @@ static const char *demux_NameFromMimeType(const char *mime) { "video/nsa", "nsv" }, { "video/nsv", "nsv" }, }; -demux_mapping *type = demux_lookup( mime, types, ARRAY_SIZE( types ) ); + +demux_mapping *type = bsearch(mime, types, ARRAY_SIZE(types), + sizeof (*types), demux_mapping_cmp); return (type != NULL) ? type->name : "any"; } ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] demux: do not hard-code file extensions in core
vlc | branch: master | Rémi Denis-Courmont | Thu Sep 24 17:36:12 2020 +0300| [cc7762fd6e7fcf36c71c3d90828942d2a563d780] | committer: Rémi Denis-Courmont demux: do not hard-code file extensions in core (except mp3 which remains a special preparsing case) > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cc7762fd6e7fcf36c71c3d90828942d2a563d780 --- src/input/demux.c | 74 ++- 1 file changed, 13 insertions(+), 61 deletions(-) diff --git a/src/input/demux.c b/src/input/demux.c index ccefec76e7..4a534530e5 100644 --- a/src/input/demux.c +++ b/src/input/demux.c @@ -73,63 +73,6 @@ static const char *demux_NameFromMimeType(const char *mime) return (type != NULL) ? type->name : "any"; } -static const char* DemuxNameFromExtension( char const* ext, - bool b_preparsing ) -{ -/* NOTE: Add only file without any problems here and with strong detection: - * - no .mp3, .a52, ... - * - wav can't be added 'cause of a52 and dts in them as raw audio - */ -static demux_mapping strong[] = -{ /* NOTE: must be sorted in asc order */ -{ "aiff", "aiff" }, -{ "asf", "asf" }, -{ "au", "au" }, -{ "avi", "avi" }, -{ "dv", "dv" }, -{ "flac", "flac" }, -{ "h264", "h264" }, -{ "kar", "smf" }, -{ "m3u", "m3u" }, -{ "m4a", "mp4" }, -{ "m4v", "m4v" }, -{ "mid", "smf" }, -{ "mka", "mkv" }, -{ "mks", "mkv" }, -{ "mkv", "mkv" }, -{ "moov", "mp4" }, -{ "mov", "mp4" }, -{ "mp4", "mp4" }, -{ "nsv", "nsv" }, -{ "oga", "ogg" }, -{ "ogg", "ogg" }, -{ "ogm", "ogg" }, -{ "ogv", "ogg" }, -{ "ogx", "ogg" }, /*RFC5334*/ -{ "opus", "ogg" }, /*draft-terriberry-oggopus-01*/ -{ "pva", "pva" }, -{ "rm", "avformat" }, -{ "rmi", "smf" }, -{ "spx", "ogg" }, -{ "voc", "voc" }, -{ "wma", "asf" }, -{ "wmv", "asf" }, -}; - -/* Here, we don't mind if it does not work, it must be quick */ -static demux_mapping quick[] = -{ /* NOTE: shall be sorted in asc order */ -{ "mp3", "mpga" }, -}; - -demux_mapping *res = demux_lookup(ext, strong, ARRAY_SIZE(strong)); - -if (res == NULL && b_preparsing) -res = demux_lookup(ext, quick, ARRAY_SIZE(quick)); - -return (res != NULL) ? res->name : NULL; -} - demux_t *demux_New( vlc_object_t *p_obj, const char *psz_name, stream_t *s, es_out_t *out ) { @@ -224,18 +167,27 @@ demux_t *demux_NewAdvanced( vlc_object_t *p_obj, input_thread_t *p_input, p_demux->pf_control = NULL; p_demux->p_sys = NULL; +char *modbuf = NULL; + if (strcasecmp(module, "any") == 0 && p_demux->psz_filepath != NULL) { -char const* psz_ext = strrchr( p_demux->psz_filepath, '.' ); - -if( psz_ext ) -module = DemuxNameFromExtension( psz_ext + 1, b_preparsing ); +const char *ext = strrchr(p_demux->psz_filepath, '.'); + +if (ext != NULL) { +if (b_preparsing && !vlc_ascii_strcasecmp(ext, ".mp3")) +module = "mpga"; +else +if (likely(asprintf(, "ext-%s", ext + 1) >= 0)) +module = modbuf; +} } bool strict = strcmp(module, p_demux->psz_name) == 0; priv->module = vlc_module_load(p_demux, "demux", module, strict, demux_Probe, p_demux); +free(modbuf); + if (priv->module == NULL) { free( p_demux->psz_filepath ); ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] demux: remove file extension of dirac demuxer
vlc | branch: master | Rémi Denis-Courmont | Thu Sep 24 17:01:53 2020 +0300| [95276a99974d5e4ed7afec99d393b6855fa6] | committer: Rémi Denis-Courmont demux: remove file extension of dirac demuxer The dirac demuxer was already removed in eb8ab8df4b1483e1cc299d96b5c43b738ee03d25. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=95276a99974d5e4ed7afec99d393b6855fa6 --- src/input/demux.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/input/demux.c b/src/input/demux.c index 9e587b88df..3808bbb927 100644 --- a/src/input/demux.c +++ b/src/input/demux.c @@ -86,7 +86,6 @@ static const char* DemuxNameFromExtension( char const* ext, { "asf", "asf" }, { "au", "au" }, { "avi", "avi" }, -{ "drc", "dirac" }, { "dv", "dv" }, { "flac", "flac" }, { "h264", "h264" }, ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] demux: declare file extensions in descriptor
vlc | branch: master | Rémi Denis-Courmont | Thu Sep 24 17:00:17 2020 +0300| [f52dd6104d4bfbd39b4619bde0f2bba386afab6d] | committer: Rémi Denis-Courmont demux: declare file extensions in descriptor For each *existing* mapping of a file extension to a demux in src/input/demux.c, this adds a corresponding declaration in the module descriptor. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f52dd6104d4bfbd39b4619bde0f2bba386afab6d --- include/vlc_demux.h | 3 +++ modules/codec/avcodec/avcodec.c | 1 + modules/demux/aiff.c | 1 + modules/demux/asf/asf.c | 3 +++ modules/demux/au.c| 1 + modules/demux/avformat/avformat.c | 2 ++ modules/demux/avi/avi.c | 1 + modules/demux/flac.c | 1 + modules/demux/mkv/mkv.cpp | 3 +++ modules/demux/mp4/mp4.c | 5 + modules/demux/mpeg/h26x.c | 1 + modules/demux/nsv.c | 1 + modules/demux/ogg.c | 7 +++ modules/demux/playlist/playlist.c | 1 + modules/demux/pva.c | 1 + modules/demux/rawdv.c | 1 + modules/demux/smf.c | 3 +++ modules/demux/voc.c | 1 + 18 files changed, 37 insertions(+) diff --git a/include/vlc_demux.h b/include/vlc_demux.h index eca3d0c6dd..8a9cc57bf9 100644 --- a/include/vlc_demux.h +++ b/include/vlc_demux.h @@ -50,6 +50,9 @@ #define INPUT_UPDATE_META 0x0040 #define INPUT_UPDATE_TITLE_LIST 0x0100 +/* Demux module descriptor helpers */ +#define add_file_extension(ext) add_shortcut("ext-" ext) + /* demux_meta_t is returned by "meta reader" module to the demuxer */ typedef struct demux_meta_t { diff --git a/modules/codec/avcodec/avcodec.c b/modules/codec/avcodec/avcodec.c index dc2d3d3550..75bb9337d7 100644 --- a/modules/codec/avcodec/avcodec.c +++ b/modules/codec/avcodec/avcodec.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include diff --git a/modules/demux/aiff.c b/modules/demux/aiff.c index 77fb9dfa2c..87e9db16b0 100644 --- a/modules/demux/aiff.c +++ b/modules/demux/aiff.c @@ -49,6 +49,7 @@ vlc_module_begin () set_capability( "demux", 10 ) set_callback( Open ) add_shortcut( "aiff" ) +add_file_extension("aiff") vlc_module_end () /* diff --git a/modules/demux/asf/asf.c b/modules/demux/asf/asf.c index 441d9ec7e4..4828a77804 100644 --- a/modules/demux/asf/asf.c +++ b/modules/demux/asf/asf.c @@ -62,6 +62,9 @@ vlc_module_begin () set_capability( "demux", 200 ) set_callbacks( Open, Close ) add_shortcut( "asf", "wmv" ) +add_file_extension("asf") +add_file_extension("wma") +add_file_extension("wmv") vlc_module_end () diff --git a/modules/demux/au.c b/modules/demux/au.c index e2b4618976..a271dea127 100644 --- a/modules/demux/au.c +++ b/modules/demux/au.c @@ -50,6 +50,7 @@ vlc_module_begin () set_capability( "demux", 10 ) set_callback( Open ) add_shortcut( "au" ) +add_file_extension("au") vlc_module_end () /* diff --git a/modules/demux/avformat/avformat.c b/modules/demux/avformat/avformat.c index ac34a377c5..a33ffcfbe2 100644 --- a/modules/demux/avformat/avformat.c +++ b/modules/demux/avformat/avformat.c @@ -28,6 +28,7 @@ #include #include +#include #include "avformat.h" #include "../../codec/avcodec/avcommon.h" @@ -35,6 +36,7 @@ vlc_module_begin () #endif /* MERGE_FFMPEG */ add_shortcut( "ffmpeg", "avformat" ) +add_file_extension("rm") set_category( CAT_INPUT ) set_subcategory( SUBCAT_INPUT_DEMUX ) set_description( N_("Avformat demuxer" ) ) diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c index 34bd228681..7bae686ca1 100644 --- a/modules/demux/avi/avi.c +++ b/modules/demux/avi/avi.c @@ -73,6 +73,7 @@ vlc_module_begin () set_capability( "demux", 212 ) set_category( CAT_INPUT ) set_subcategory( SUBCAT_INPUT_DEMUX ) +add_file_extension("avi") add_bool( "avi-interleaved", false, INTERLEAVE_TEXT, INTERLEAVE_TEXT, true ) diff --git a/modules/demux/flac.c b/modules/demux/flac.c index ab029554c8..defb7d39bc 100644 --- a/modules/demux/flac.c +++ b/modules/demux/flac.c @@ -54,6 +54,7 @@ vlc_module_begin () set_subcategory( SUBCAT_INPUT_DEMUX ) set_callbacks( Open, Close ) add_shortcut( "flac" ) +add_file_extension("flac") vlc_module_end () /* diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp index 4685968f2b..82f464a74a 100644 --- a/modules/demux/mkv/mkv.cpp +++ b/modules/demux/mkv/mkv.cpp @@ -81,6 +81,9 @@ vlc_module_begin () N_("Find all cluster positions by jumping cluster-to-cluster before playback"), true ); add_shortcut( "mka", "mkv" ) +
[vlc-commits] tivo: remove redundant extension checks
vlc | branch: master | Rémi Denis-Courmont | Fri Sep 25 17:16:03 2020 +0300| [9916f9e4f08445f2e8cac84402ad6b77609d7246] | committer: Rémi Denis-Courmont tivo: remove redundant extension checks With the extension registered, the force flag is implied if the file name matches one of the extension. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9916f9e4f08445f2e8cac84402ad6b77609d7246 --- modules/demux/ty.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/demux/ty.c b/modules/demux/ty.c index ad783a6a96..7ea97f6eb2 100644 --- a/modules/demux/ty.c +++ b/modules/demux/ty.c @@ -311,9 +311,7 @@ static int Open(vlc_object_t *p_this) U32_AT(_peek[4]) != 0x02 || U32_AT(_peek[8]) != CHUNK_SIZE ) { -if( !p_demux->obj.force && -!demux_IsPathExtension( p_demux, ".ty" ) && -!demux_IsPathExtension( p_demux, ".ty+" ) ) +if( !p_demux->obj.force ) return VLC_EGENERIC; msg_Warn( p_demux, "this does not look like a TY file, " "continuing anyway..." ); ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] rawdv: drop priority to zero
vlc | branch: master | Rémi Denis-Courmont | Fri Sep 25 17:10:53 2020 +0300| [f65b6e45e500f1e03a8804760686c872fc0f837d] | committer: Rémi Denis-Courmont rawdv: drop priority to zero This is effectively the same as requiring the force flag be set, but it avoids loading the module. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f65b6e45e500f1e03a8804760686c872fc0f837d --- modules/demux/rawdv.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/modules/demux/rawdv.c b/modules/demux/rawdv.c index 2fbd661563..4c02cd1a0d 100644 --- a/modules/demux/rawdv.c +++ b/modules/demux/rawdv.c @@ -48,7 +48,7 @@ static void Close( vlc_object_t * ); vlc_module_begin () set_shortname( "DV" ) set_description( N_("DV (Digital Video) demuxer") ) -set_capability( "demux", 3 ) +set_capability( "demux", 0 ) set_category( CAT_INPUT ) set_subcategory( SUBCAT_INPUT_DEMUX ) add_bool( "rawdv-hurry-up", false, HURRYUP_TEXT, HURRYUP_LONGTEXT, false ) @@ -136,9 +136,6 @@ static int Open( vlc_object_t * p_this ) dv_header_t dv_header; dv_id_t dv_id; -if( !p_demux->obj.force ) -return VLC_EGENERIC; - if( vlc_stream_Peek( p_demux->s, _peek, DV_PAL_FRAME_SIZE ) < DV_NTSC_FRAME_SIZE ) return VLC_EGENERIC; ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] rawdv: don't recheck for extension
vlc | branch: master | Rémi Denis-Courmont | Fri Sep 25 17:09:08 2020 +0300| [f982c2e2e4a762c42101d1c4456a83940b0d95da] | committer: Rémi Denis-Courmont rawdv: don't recheck for extension If the file as the .dv extension, the core will already force the rawdv demux. In other words, the .dv extension implies the force flag. So we only need to check the force flag. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f982c2e2e4a762c42101d1c4456a83940b0d95da --- modules/demux/rawdv.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/modules/demux/rawdv.c b/modules/demux/rawdv.c index 84a45cc446..2fbd661563 100644 --- a/modules/demux/rawdv.c +++ b/modules/demux/rawdv.c @@ -53,6 +53,10 @@ vlc_module_begin () set_subcategory( SUBCAT_INPUT_DEMUX ) add_bool( "rawdv-hurry-up", false, HURRYUP_TEXT, HURRYUP_LONGTEXT, false ) set_callbacks( Open, Close ) +/* It isn't easy to recognize a raw DV stream. The chances that we'll + * mistake a stream from another type for a raw DV stream are too high, so + * we'll rely on the file extension to trigger this demux. Alternatively, + * it is possible to force this demux. */ add_shortcut( "rawdv" ) add_file_extension("dv") vlc_module_end () @@ -132,13 +136,7 @@ static int Open( vlc_object_t * p_this ) dv_header_t dv_header; dv_id_t dv_id; -/* It isn't easy to recognize a raw DV stream. The chances that we'll - * mistake a stream from another type for a raw DV stream are too high, so - * we'll rely on the file extension to trigger this demux. Alternatively, - * it is possible to force this demux. */ - -/* Check for DV file extension */ -if( !demux_IsPathExtension( p_demux, ".dv" ) && !p_demux->obj.force ) +if( !p_demux->obj.force ) return VLC_EGENERIC; if( vlc_stream_Peek( p_demux->s, _peek, DV_PAL_FRAME_SIZE ) < ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] textst: use vlc_obj_malloc() and simplify
vlc | branch: master | Rémi Denis-Courmont | Fri Sep 25 16:41:44 2020 +0300| [23724d9b468adffe0786d8450983ab8fe5860ff6] | committer: Rémi Denis-Courmont textst: use vlc_obj_malloc() and simplify > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=23724d9b468adffe0786d8450983ab8fe5860ff6 --- modules/codec/textst.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/modules/codec/textst.c b/modules/codec/textst.c index a74d9a930b..26852f9248 100644 --- a/modules/codec/textst.c +++ b/modules/codec/textst.c @@ -40,7 +40,6 @@ * Module descriptor */ static int Open (vlc_object_t *); -static void Close(vlc_object_t *); typedef struct { @@ -52,7 +51,7 @@ vlc_module_begin() set_category(CAT_INPUT) set_subcategory(SUBCAT_INPUT_SCODEC) set_capability("spu decoder", 10) -set_callbacks(Open, Close) +set_callback(Open) vlc_module_end() #define BD_TEXTST_DATA_STRING 1 @@ -259,12 +258,6 @@ static int Decode(decoder_t *p_dec, block_t *p_block) return VLCDEC_SUCCESS; } -static void Close(vlc_object_t *object) -{ -decoder_t *p_dec = (decoder_t*)object; -free(p_dec->p_sys); -} - static int Open(vlc_object_t *object) { decoder_t *p_dec = (decoder_t*)object; @@ -272,7 +265,7 @@ static int Open(vlc_object_t *object) if (p_dec->fmt_in.i_codec != VLC_CODEC_BD_TEXT) return VLC_EGENERIC; -decoder_sys_t *p_sys = malloc(sizeof(decoder_sys_t)); +decoder_sys_t *p_sys = vlc_obj_malloc(object, sizeof(decoder_sys_t)); if(!p_sys) return VLC_ENOMEM; memset(p_sys->palette, 0xFF, 256 * sizeof(uint32_t)); ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] mpcdec: use vlc_obj_calloc() and simplify
vlc | branch: master | Rémi Denis-Courmont | Fri Sep 25 16:22:12 2020 +0300| [27bdfe0feb26b3152787931d1ac628dc460b8168] | committer: Rémi Denis-Courmont mpcdec: use vlc_obj_calloc() and simplify > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=27bdfe0feb26b3152787931d1ac628dc460b8168 --- modules/demux/mpc.c | 26 +- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/modules/demux/mpc.c b/modules/demux/mpc.c index d7438c7558..6d52c61f9e 100644 --- a/modules/demux/mpc.c +++ b/modules/demux/mpc.c @@ -48,7 +48,6 @@ * Module descriptor */ static int Open ( vlc_object_t * ); -static void Close ( vlc_object_t * ); vlc_module_begin () set_category( CAT_INPUT ) @@ -56,7 +55,7 @@ vlc_module_begin () set_description( N_("MusePack demuxer") ) set_capability( "demux", 145 ) -set_callbacks( Open, Close ) +set_callback( Open ) add_shortcut( "mpc" ) vlc_module_end () @@ -118,7 +117,7 @@ static int Open( vlc_object_t * p_this ) } /* */ -p_sys = calloc( 1, sizeof( *p_sys ) ); +p_sys = vlc_obj_calloc( p_this, 1, sizeof( *p_sys ) ); if( !p_sys ) return VLC_ENOMEM; @@ -134,12 +133,12 @@ static int Open( vlc_object_t * p_this ) /* Load info */ mpc_streaminfo_init( _sys->info ); if( mpc_streaminfo_read( _sys->info, _sys->reader ) != ERROR_CODE_OK ) -goto error; +return VLC_EGENERIC; /* */ mpc_decoder_setup( _sys->decoder, _sys->reader ); if( !mpc_decoder_initialize( _sys->decoder, _sys->info ) ) -goto error; +return VLC_EGENERIC; /* Fill p_demux fields */ p_demux->pf_demux = Demux; @@ -192,24 +191,9 @@ static int Open( vlc_object_t * p_this ) fmt.i_id = 0; p_sys->p_es = es_out_Add( p_demux->out, ); if( !p_sys->p_es ) -goto error; +return VLC_EGENERIC; return VLC_SUCCESS; - -error: -free( p_sys ); -return VLC_EGENERIC; -} - -/* - * Close: frees unused data - */ -static void Close( vlc_object_t * p_this ) -{ -demux_t*p_demux = (demux_t*)p_this; -demux_sys_t*p_sys = p_demux->p_sys; - -free( p_sys ); } /* ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] araw: use vlc_obj_malloc() and simplify
vlc | branch: master | Rémi Denis-Courmont | Fri Sep 25 16:25:09 2020 +0300| [8c873c20622b5e077544d5a5d6788531c8592a80] | committer: Rémi Denis-Courmont araw: use vlc_obj_malloc() and simplify > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8c873c20622b5e077544d5a5d6788531c8592a80 --- modules/codec/araw.c | 15 ++- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/modules/codec/araw.c b/modules/codec/araw.c index 2f819c1270..c8c921414e 100644 --- a/modules/codec/araw.c +++ b/modules/codec/araw.c @@ -39,7 +39,6 @@ * Module descriptor */ static int DecoderOpen ( vlc_object_t * ); -static void DecoderClose( vlc_object_t * ); #ifdef ENABLE_SOUT static int EncoderOpen ( vlc_object_t * ); @@ -51,7 +50,7 @@ vlc_module_begin () set_capability( "audio decoder", 100 ) set_category( CAT_INPUT ) set_subcategory( SUBCAT_INPUT_ACODEC ) -set_callbacks( DecoderOpen, DecoderClose ) +set_callback( DecoderOpen ) #ifdef ENABLE_SOUT /* audio encoder submodule */ @@ -257,7 +256,7 @@ static int DecoderOpen( vlc_object_t *p_this ) p_dec->fmt_in.audio.i_bitspersample ); /* Allocate the memory needed to store the decoder's structure */ -decoder_sys_t *p_sys = malloc(sizeof(*p_sys)); +decoder_sys_t *p_sys = vlc_obj_malloc(p_this, sizeof(*p_sys)); if( unlikely(p_sys == NULL) ) return VLC_ENOMEM; @@ -629,16 +628,6 @@ static void DAT12Decode( void *outp, const uint8_t *in, unsigned samples ) *(out++) = dat12tos16(U16_AT(in) >> 4); } -/* - * DecoderClose: decoder destruction - */ -static void DecoderClose( vlc_object_t *p_this ) -{ -decoder_t *p_dec = (decoder_t *)p_this; - -free( p_dec->p_sys ); -} - #ifdef ENABLE_SOUT /* NOTE: Output buffers are always aligned since they are allocated by the araw plugin. * Contrary to the decoder, the encoder can also assume that input buffers are aligned, ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] rawvideo: use vlc_obj_calloc() and simplify
vlc | branch: master | Rémi Denis-Courmont | Fri Sep 25 16:29:53 2020 +0300| [0863fd5ae5581352b4a37e1172328e06f189ffcd] | committer: Rémi Denis-Courmont rawvideo: use vlc_obj_calloc() and simplify > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0863fd5ae5581352b4a37e1172328e06f189ffcd --- modules/codec/rawvideo.c | 16 +++- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/modules/codec/rawvideo.c b/modules/codec/rawvideo.c index c43932d437..43f864ad29 100644 --- a/modules/codec/rawvideo.c +++ b/modules/codec/rawvideo.c @@ -54,7 +54,6 @@ typedef struct / static int OpenDecoder ( vlc_object_t * ); static int OpenPacketizer( vlc_object_t * ); -static void CloseCommon ( vlc_object_t * ); /* * Module descriptor @@ -64,12 +63,12 @@ vlc_module_begin () set_capability( "video decoder", 50 ) set_category( CAT_INPUT ) set_subcategory( SUBCAT_INPUT_VCODEC ) -set_callbacks( OpenDecoder, CloseCommon ) +set_callback( OpenDecoder ) add_submodule () set_description( N_("Pseudo raw video packetizer") ) set_capability( "packetizer", 100 ) -set_callbacks( OpenPacketizer, CloseCommon ) +set_callback( OpenPacketizer ) vlc_module_end () /** @@ -90,7 +89,7 @@ static int OpenCommon( decoder_t *p_dec ) } /* Allocate the memory needed to store the decoder's structure */ -decoder_sys_t *p_sys = calloc(1, sizeof(*p_sys)); +decoder_sys_t *p_sys = vlc_obj_calloc(VLC_OBJECT(p_dec), 1, sizeof(*p_sys)); if( unlikely(p_sys == NULL) ) return VLC_ENOMEM; @@ -325,12 +324,3 @@ static int OpenPacketizer( vlc_object_t *p_this ) } return ret; } - -/** - * Common deinitialization - */ -static void CloseCommon( vlc_object_t *p_this ) -{ -decoder_t *p_dec = (decoder_t*)p_this; -free( p_dec->p_sys ); -} ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] png: use vlc_obj_malloc() and simplify
vlc | branch: master | Rémi Denis-Courmont | Fri Sep 25 16:29:53 2020 +0300| [9afb676f1495c2f4a9de760b39f66d8f2611ab05] | committer: Rémi Denis-Courmont png: use vlc_obj_malloc() and simplify > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9afb676f1495c2f4a9de760b39f66d8f2611ab05 --- modules/codec/png.c | 32 1 file changed, 4 insertions(+), 28 deletions(-) diff --git a/modules/codec/png.c b/modules/codec/png.c index 07ef26d346..40f021e425 100644 --- a/modules/codec/png.c +++ b/modules/codec/png.c @@ -63,7 +63,6 @@ typedef struct * Local prototypes */ static int OpenDecoder ( vlc_object_t * ); -static void CloseDecoder ( vlc_object_t * ); static int DecodeBlock ( decoder_t *, block_t * ); @@ -77,7 +76,6 @@ typedef struct } encoder_sys_t; static int OpenEncoder(vlc_object_t *); -static void CloseEncoder(vlc_object_t *); static block_t *EncodeBlock(encoder_t *, picture_t *); @@ -89,7 +87,7 @@ vlc_module_begin () set_subcategory( SUBCAT_INPUT_VCODEC ) set_description( N_("PNG video decoder") ) set_capability( "video decoder", 1000 ) -set_callbacks( OpenDecoder, CloseDecoder ) +set_callback( OpenDecoder ) add_shortcut( "png" ) /* encoder submodule */ @@ -98,7 +96,7 @@ vlc_module_begin () set_section(N_("Encoding"), NULL) set_description(N_("PNG video encoder")) set_capability("encoder", 1000) -set_callbacks(OpenEncoder, CloseEncoder) +set_callback(OpenEncoder) vlc_module_end () /* @@ -115,7 +113,7 @@ static int OpenDecoder( vlc_object_t *p_this ) } /* Allocate the memory needed to store the decoder's structure */ -decoder_sys_t *p_sys = malloc( sizeof(decoder_sys_t) ); +decoder_sys_t *p_sys = vlc_obj_malloc( p_this, sizeof(decoder_sys_t) ); if( p_sys == NULL ) return VLC_ENOMEM; p_dec->p_sys = p_sys; @@ -321,17 +319,6 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block ) return VLCDEC_SUCCESS; } -/* - * CloseDecoder: png decoder destruction - */ -static void CloseDecoder( vlc_object_t *p_this ) -{ -decoder_t *p_dec = (decoder_t *)p_this; -decoder_sys_t *p_sys = p_dec->p_sys; - -free( p_sys ); -} - static int OpenEncoder(vlc_object_t *p_this) { encoder_t *p_enc = (encoder_t *) p_this; @@ -340,7 +327,7 @@ static int OpenEncoder(vlc_object_t *p_this) return VLC_EGENERIC; /* Allocate the memory needed to store the encoder's structure */ -encoder_sys_t *p_sys = malloc( sizeof(encoder_sys_t) ); +encoder_sys_t *p_sys = vlc_obj_malloc(p_this, sizeof(encoder_sys_t)); if( p_sys == NULL ) return VLC_ENOMEM; p_enc->p_sys = p_sys; @@ -445,14 +432,3 @@ static block_t *EncodeBlock(encoder_t *p_enc, picture_t *p_pic) block_Release(p_block); return NULL; } - -/* - * CloseEncoder: png encoder destruction - */ -static void CloseEncoder( vlc_object_t *p_this ) -{ -encoder_t *p_enc = (encoder_t *)p_this; -encoder_sys_t *p_sys = p_enc->p_sys; - -free( p_sys ); -} ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] sdl_image: use vlc_obj_malloc() and simplify
vlc | branch: master | Rémi Denis-Courmont | Fri Sep 25 16:41:44 2020 +0300| [065caf92f8715ff6c9183f5a86f101dd9cd831e6] | committer: Rémi Denis-Courmont sdl_image: use vlc_obj_malloc() and simplify > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=065caf92f8715ff6c9183f5a86f101dd9cd831e6 --- modules/codec/sdl_image.c | 16 ++-- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/modules/codec/sdl_image.c b/modules/codec/sdl_image.c index 763dddeb2d..e58045a9e6 100644 --- a/modules/codec/sdl_image.c +++ b/modules/codec/sdl_image.c @@ -46,7 +46,6 @@ typedef struct * Local prototypes */ static int OpenDecoder ( vlc_object_t * ); -static void CloseDecoder ( vlc_object_t * ); static int DecodeBlock ( decoder_t *, block_t * ); @@ -59,7 +58,7 @@ vlc_module_begin () set_shortname( N_("SDL Image decoder")) set_description( N_("SDL_image video decoder") ) set_capability( "video decoder", 60 ) -set_callbacks( OpenDecoder, CloseDecoder ) +set_callback( OpenDecoder ) add_shortcut( "sdl_image" ) vlc_module_end () @@ -106,7 +105,7 @@ static int OpenDecoder( vlc_object_t *p_this ) /* Allocate the memory needed to store the decoder's structure */ if( ( p_dec->p_sys = p_sys = - (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL ) + vlc_obj_malloc(p_this, sizeof(decoder_sys_t)) ) == NULL ) return VLC_ENOMEM; p_sys->psz_sdl_type = p_supported_fmt[i].psz_sdl_type; @@ -267,14 +266,3 @@ error: block_Release( p_block ); return VLCDEC_SUCCESS; } - -/* - * CloseDecoder: sdl decoder destruction - */ -static void CloseDecoder( vlc_object_t *p_this ) -{ -decoder_t *p_dec = (decoder_t *)p_this; -decoder_sys_t *p_sys = p_dec->p_sys; - -free( p_sys ); -} ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] g711: use vlc_obj_malloc() and simplify
vlc | branch: master | Rémi Denis-Courmont | Fri Sep 25 16:29:53 2020 +0300| [42e093a4f9e6366d10bd1cd6723458ef258b81cb] | committer: Rémi Denis-Courmont g711: use vlc_obj_malloc() and simplify > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=42e093a4f9e6366d10bd1cd6723458ef258b81cb --- modules/codec/g711.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/modules/codec/g711.c b/modules/codec/g711.c index 789f6feaa5..1e55b1d54a 100644 --- a/modules/codec/g711.c +++ b/modules/codec/g711.c @@ -32,7 +32,6 @@ #include static int DecoderOpen ( vlc_object_t * ); -static void DecoderClose( vlc_object_t * ); static int DecodeBlock( decoder_t *, block_t * ); static void Flush( decoder_t * ); @@ -46,7 +45,7 @@ vlc_module_begin () set_capability( "audio decoder", 100 ) set_category( CAT_INPUT ) set_subcategory( SUBCAT_INPUT_ACODEC ) -set_callbacks( DecoderOpen, DecoderClose ) +set_callback( DecoderOpen ) #ifdef ENABLE_SOUT add_submodule () @@ -178,7 +177,7 @@ static int DecoderOpen( vlc_object_t *p_this ) /* Allocate the memory needed to store the decoder's structure */ -decoder_sys_t *p_sys = malloc(sizeof(*p_sys)); +decoder_sys_t *p_sys = vlc_obj_malloc(p_this, sizeof(*p_sys)); if( unlikely(p_sys == NULL) ) return VLC_ENOMEM; @@ -283,13 +282,6 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block ) return VLCDEC_SUCCESS; } -static void DecoderClose( vlc_object_t *p_this ) -{ -decoder_t *p_dec = (decoder_t *)p_this; - -free( p_dec->p_sys ); -} - #ifdef ENABLE_SOUT static const int8_t alaw_encode[2049] = { ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] telx: use vlc_obj_calloc() and simplify
vlc | branch: master | Rémi Denis-Courmont | Fri Sep 25 16:41:44 2020 +0300| [74d6edf31fcf1bbe4985ac75fbcca436693b7bd8] | committer: Rémi Denis-Courmont telx: use vlc_obj_calloc() and simplify > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=74d6edf31fcf1bbe4985ac75fbcca436693b7bd8 --- modules/codec/telx.c | 17 ++--- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/modules/codec/telx.c b/modules/codec/telx.c index dc5259f4e2..8563aab4db 100644 --- a/modules/codec/telx.c +++ b/modules/codec/telx.c @@ -47,7 +47,6 @@ * Module descriptor. */ static int Open ( vlc_object_t * ); -static void Close( vlc_object_t * ); static int Decode( decoder_t *, block_t * ); #define OVERRIDE_PAGE_TEXT N_("Override page") @@ -72,7 +71,7 @@ vlc_module_begin () set_capability( "spu decoder", 50 ) set_category( CAT_INPUT ) set_subcategory( SUBCAT_INPUT_SCODEC ) -set_callbacks( Open, Close ) +set_callback( Open ) add_integer( "telx-override-page", -1, OVERRIDE_PAGE_TEXT, OVERRIDE_PAGE_LONGTEXT, true ) @@ -185,14 +184,13 @@ static int Open( vlc_object_t *p_this ) decoder_sys_t *p_sys = NULL; inti_val; - if( p_dec->fmt_in.i_codec != VLC_CODEC_TELETEXT) { return VLC_EGENERIC; } p_dec->pf_decode = Decode; -p_sys = p_dec->p_sys = calloc( 1, sizeof(*p_sys) ); +p_sys = p_dec->p_sys = vlc_obj_calloc( p_this, 1, sizeof(*p_sys) ); if( p_sys == NULL ) return VLC_ENOMEM; p_dec->fmt_out.i_codec = 0; @@ -249,17 +247,6 @@ static int Open( vlc_object_t *p_this ) /* return VLC_EGENERIC; */ } -/* - * Close: - */ -static void Close( vlc_object_t *p_this ) -{ -decoder_t *p_dec = (decoder_t*) p_this; -decoder_sys_t *p_sys = p_dec->p_sys; - -free( p_sys ); -} - /** * change bits endianness * **/ ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] aes: use vlc_obj_malloc() and simplify
vlc | branch: master | Rémi Denis-Courmont | Fri Sep 25 16:29:53 2020 +0300| [1939950e68406db119ef868178bfad68de1a8618] | committer: Rémi Denis-Courmont aes: use vlc_obj_malloc() and simplify > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1939950e68406db119ef868178bfad68de1a8618 --- modules/codec/aes3.c | 17 - 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/modules/codec/aes3.c b/modules/codec/aes3.c index 982fd460a1..cc77214586 100644 --- a/modules/codec/aes3.c +++ b/modules/codec/aes3.c @@ -37,7 +37,6 @@ */ static int OpenDecoder ( vlc_object_t * ); static int OpenPacketizer( vlc_object_t * ); -static void Close ( vlc_object_t * ); vlc_module_begin () @@ -45,12 +44,12 @@ vlc_module_begin () set_subcategory( SUBCAT_INPUT_ACODEC ) set_description( N_("AES3/SMPTE 302M audio decoder") ) set_capability( "audio decoder", 100 ) -set_callbacks( OpenDecoder, Close ) +set_callback( OpenDecoder ) add_submodule () set_description( N_("AES3/SMPTE 302M audio packetizer") ) set_capability( "packetizer", 100 ) -set_callbacks( OpenPacketizer, Close ) +set_callback( OpenPacketizer ) vlc_module_end () @@ -95,15 +94,6 @@ static int OpenPacketizer( vlc_object_t *p_this ) return Open( p_dec, true ); } -/* - * Close : aes3 decoder destruction - */ -static void Close( vlc_object_t *p_this ) -{ -decoder_t *p_dec = (decoder_t*)p_this; -free( p_dec->p_sys ); -} - static const uint8_t reverse[256] = { 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, @@ -271,7 +261,7 @@ static int Open( decoder_t *p_dec, bool b_packetizer ) return VLC_EGENERIC; /* Allocate the memory needed to store the decoder's structure */ -p_dec->p_sys = p_sys = malloc( sizeof(decoder_sys_t) ); +p_sys = vlc_obj_malloc( VLC_OBJECT(p_dec), sizeof(*p_sys) ); if( unlikely( !p_sys ) ) return VLC_EGENERIC; @@ -297,6 +287,7 @@ static int Open( decoder_t *p_dec, bool b_packetizer ) p_dec->pf_decode= Decode; } p_dec->pf_flush= Flush; +p_dec->p_sys = p_sys; return VLC_SUCCESS; } ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] remap: use vlc_obj_malloc() and simplify
vlc | branch: master | Rémi Denis-Courmont | Fri Sep 25 16:27:51 2020 +0300| [4cb742715a6bb44fc94680c4f3f317a10926e9a5] | committer: Rémi Denis-Courmont remap: use vlc_obj_malloc() and simplify > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4cb742715a6bb44fc94680c4f3f317a10926e9a5 --- modules/audio_filter/channel_mixer/remap.c | 17 ++--- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/modules/audio_filter/channel_mixer/remap.c b/modules/audio_filter/channel_mixer/remap.c index a259939ba6..8c49a5f1ae 100644 --- a/modules/audio_filter/channel_mixer/remap.c +++ b/modules/audio_filter/channel_mixer/remap.c @@ -38,7 +38,6 @@ * Module descriptor */ static int OpenFilter( vlc_object_t * ); -static void CloseFilter( vlc_object_t * ); #define REMAP_CFG "aout-remap-" @@ -75,7 +74,7 @@ vlc_module_begin () set_capability( "audio filter", 0 ) set_category( CAT_AUDIO ) set_subcategory( SUBCAT_AUDIO_AFILTER ) -set_callbacks( OpenFilter, CloseFilter ) +set_callback( OpenFilter ) set_shortname( "Remap" ) #define CHANNEL( idx ) \ @@ -272,7 +271,7 @@ static int OpenFilter( vlc_object_t *p_this ) audio_format_t *audio_out = _filter->fmt_out.audio; /* Allocate the memory needed to store the module's structure */ -p_sys = p_filter->p_sys = malloc( sizeof(filter_sys_t) ); +p_sys = p_filter->p_sys = vlc_obj_malloc( p_this, sizeof(filter_sys_t) ); if( unlikely( p_sys == NULL ) ) return VLC_ENOMEM; @@ -304,7 +303,6 @@ static int OpenFilter( vlc_object_t *p_this ) if (val >= AOUT_CHAN_MAX) { msg_Err( p_filter, "invalid channel index" ); -free( p_sys ); return VLC_EGENERIC; } if (val < 0) @@ -353,7 +351,6 @@ static int OpenFilter( vlc_object_t *p_this ) if( !p_sys->pf_remap ) { msg_Err( p_filter, "Could not decide on %s remap function", b_multiple ? "an add" : "a copy" ); -free( p_sys ); return VLC_EGENERIC; } @@ -373,16 +370,6 @@ static int OpenFilter( vlc_object_t *p_this ) return VLC_SUCCESS; } -/* - * CloseFilter: - */ -static void CloseFilter( vlc_object_t *p_this ) -{ -filter_t *p_filter = (filter_t *) p_this; -filter_sys_t *p_sys = p_filter->p_sys; -free( p_sys ); -} - /* * Remap: */ ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] uleaddvaudio: use vlc_obj_malloc() and simplify
vlc | branch: master | Rémi Denis-Courmont | Fri Sep 25 16:45:02 2020 +0300| [e33c290b36af06dd587bf64ac659b1fd820535cf] | committer: Rémi Denis-Courmont uleaddvaudio: use vlc_obj_malloc() and simplify > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e33c290b36af06dd587bf64ac659b1fd820535cf --- modules/codec/uleaddvaudio.c | 13 ++--- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/modules/codec/uleaddvaudio.c b/modules/codec/uleaddvaudio.c index 4d80908703..5b91c2e972 100644 --- a/modules/codec/uleaddvaudio.c +++ b/modules/codec/uleaddvaudio.c @@ -34,14 +34,13 @@ * Module descriptor */ static int Open(vlc_object_t *); -static void Close(vlc_object_t *); vlc_module_begin() set_description(N_("Ulead DV audio decoder")) set_capability("audio decoder", 50) set_category(CAT_INPUT) set_subcategory(SUBCAT_INPUT_ACODEC) -set_callbacks(Open, Close) +set_callback(Open) vlc_module_end() typedef struct @@ -146,7 +145,7 @@ static int Open(vlc_object_t *object) if (dec->fmt_in.audio.i_rate <= 0) return VLC_EGENERIC; -decoder_sys_t *sys = dec->p_sys = malloc(sizeof(*sys)); +decoder_sys_t *sys = dec->p_sys = vlc_obj_malloc(object, sizeof(*sys)); if (!sys) return VLC_ENOMEM; @@ -172,11 +171,3 @@ static int Open(vlc_object_t *object) return VLC_SUCCESS; } - -static void Close(vlc_object_t *object) -{ -decoder_t *dec = (decoder_t *)object; - -free(dec->p_sys); -} - ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] lpcm: use vlc_obj_malloc() and simplify
vlc | branch: master | Rémi Denis-Courmont | Fri Sep 25 16:29:53 2020 +0300| [67286d95df4154334d6a3aab64c3d4388442099d] | committer: Rémi Denis-Courmont lpcm: use vlc_obj_malloc() and simplify > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=67286d95df4154334d6a3aab64c3d4388442099d --- modules/codec/lpcm.c | 19 +-- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/modules/codec/lpcm.c b/modules/codec/lpcm.c index 38a3e9fcbf..f698c5195e 100644 --- a/modules/codec/lpcm.c +++ b/modules/codec/lpcm.c @@ -44,7 +44,6 @@ */ static int OpenDecoder ( vlc_object_t * ); static int OpenPacketizer( vlc_object_t * ); -static void CloseCommon ( vlc_object_t * ); #ifdef ENABLE_SOUT static int OpenEncoder ( vlc_object_t * ); @@ -58,12 +57,12 @@ vlc_module_begin () set_subcategory( SUBCAT_INPUT_ACODEC ) set_description( N_("Linear PCM audio decoder") ) set_capability( "audio decoder", 100 ) -set_callbacks( OpenDecoder, CloseCommon ) +set_callback( OpenDecoder ) add_submodule () set_description( N_("Linear PCM audio packetizer") ) set_capability( "packetizer", 100 ) -set_callbacks( OpenPacketizer, CloseCommon ) +set_callback( OpenPacketizer ) #ifdef ENABLE_SOUT add_submodule () @@ -246,7 +245,8 @@ static int OpenCommon( decoder_t *p_dec, bool b_packetizer ) } /* Allocate the memory needed to store the decoder's structure */ -if( ( p_dec->p_sys = p_sys = malloc(sizeof(decoder_sys_t)) ) == NULL ) +p_sys = vlc_obj_malloc(VLC_OBJECT(p_dec), sizeof (*p_sys)); +if (unlikely(p_sys == NULL)) return VLC_ENOMEM; /* Misc init */ @@ -299,7 +299,7 @@ static int OpenCommon( decoder_t *p_dec, bool b_packetizer ) else p_dec->pf_packetize = Packetize; p_dec->pf_flush = Flush; - +p_dec->p_sys = p_sys; return VLC_SUCCESS; } static int OpenDecoder( vlc_object_t *p_this ) @@ -509,15 +509,6 @@ static int DecodeFrame( decoder_t *p_dec, block_t *p_block ) return VLCDEC_SUCCESS; } -/* - * CloseCommon : lpcm decoder destruction - */ -static void CloseCommon( vlc_object_t *p_this ) -{ -decoder_t *p_dec = (decoder_t*)p_this; -free( p_dec->p_sys ); -} - #ifdef ENABLE_SOUT /* * OpenEncoder: lpcm encoder construction ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] cdg: use vlc_obj_calloc() and simplify
vlc | branch: master | Rémi Denis-Courmont | Fri Sep 25 16:29:53 2020 +0300| [fd62bed4e0436febd3be1c3a87e08c99f2ea41ec] | committer: Rémi Denis-Courmont cdg: use vlc_obj_calloc() and simplify > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fd62bed4e0436febd3be1c3a87e08c99f2ea41ec --- modules/codec/cdg.c | 16 ++-- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/modules/codec/cdg.c b/modules/codec/cdg.c index 0fdfc56f9d..14ece81267 100644 --- a/modules/codec/cdg.c +++ b/modules/codec/cdg.c @@ -70,7 +70,6 @@ typedef struct * Local prototypes */ static int Open ( vlc_object_t * ); -static void Close( vlc_object_t * ); static int Decode( decoder_t *, block_t * ); @@ -86,7 +85,7 @@ vlc_module_begin () set_subcategory( SUBCAT_INPUT_VCODEC ) set_description( N_("CDG video decoder") ) set_capability( "video decoder", 1000 ) -set_callbacks( Open, Close ) +set_callback( Open ) add_shortcut( "cdg" ) vlc_module_end () @@ -102,7 +101,7 @@ static int Open( vlc_object_t *p_this ) return VLC_EGENERIC; /* Allocate the memory needed to store the decoder's structure */ -p_dec->p_sys = p_sys = calloc( 1, sizeof(decoder_sys_t) ); +p_dec->p_sys = p_sys = vlc_obj_calloc( p_this, 1, sizeof(decoder_sys_t) ); if( !p_sys ) return VLC_ENOMEM; @@ -186,17 +185,6 @@ exit: return VLCDEC_SUCCESS; } -/* - * Close: decoder destruction - */ -static void Close( vlc_object_t *p_this ) -{ -decoder_t *p_dec = (decoder_t *)p_this; -decoder_sys_t *p_sys = p_dec->p_sys; - -free( p_sys ); -} - /* * Decoder */ ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] Don't build spawn.c on non-POSIX
vlc | branch: master | Rémi Denis-Courmont | Fri Sep 25 14:40:27 2020 +0300| [9c5e964b79539b35c5895621c79930d50ad2e183] | committer: Rémi Denis-Courmont Don't build spawn.c on non-POSIX > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9c5e964b79539b35c5895621c79930d50ad2e183 --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index d8196fca61..73ff1b4934 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -479,7 +479,6 @@ libvlccore_la_SOURCES += \ posix/filesystem.c \ posix/plugin.c \ posix/rand.c \ - posix/spawn.c \ posix/timer.c if !HAVE_LINUX libvlccore_la_SOURCES += posix/wait.c @@ -494,6 +493,7 @@ libvlccore_la_SOURCES += \ posix/error.c \ posix/netconf.c \ posix/picture.c \ + posix/spawn.c \ posix/specific.c if HAVE_LIBANL libvlccore_la_SOURCES += \ ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] m3u: Expose playlist title
vlc/vlc-3.0 | branch: master | Hugo Beauzée-Luyssen | Mon Sep 21 15:45:48 2020 +0200| [9d8051a4a8208dfc58c0dd06f689b8cdac21948f] | committer: Felix Paul Kühne m3u: Expose playlist title (cherry picked from commit 8f26c795b8329219acaad18a5d98a58678799f59) Signed-off-by: Felix Paul Kühne > http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=9d8051a4a8208dfc58c0dd06f689b8cdac21948f --- modules/demux/playlist/m3u.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/modules/demux/playlist/m3u.c b/modules/demux/playlist/m3u.c index 9bd2537979..0463f6e97a 100644 --- a/modules/demux/playlist/m3u.c +++ b/modules/demux/playlist/m3u.c @@ -281,6 +281,12 @@ static int ReadDir( stream_t *p_demux, input_item_node_t *p_subitems ) free( psz_album_art ); psz_album_art = pf_dup( psz_parse ); } +else if ( !strncasecmp( psz_parse, "PLAYLIST:", + sizeof( "PLAYLIST:" ) - 1 ) ) +{ +psz_parse += sizeof( "PLAYLIST:" ) - 1; +input_item_SetTitle( p_demux->p_input_item, psz_parse ); +} } else if( !strncasecmp( psz_parse, "RTSPtext", sizeof("RTSPtext") -1 ) ) { ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] contrib: disable rust for the 32bit Intel iOS simulator
vlc | branch: master | Felix Paul Kühne | Thu Sep 24 22:05:34 2020 +0200| [c1d34ae51c0a5509410e1f01385bc7923d36592d] | committer: Felix Paul Kühne contrib: disable rust for the 32bit Intel iOS simulator > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c1d34ae51c0a5509410e1f01385bc7923d36592d --- contrib/src/main-rust.mak | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/src/main-rust.mak b/contrib/src/main-rust.mak index edd9c47467..36ca76d8ef 100644 --- a/contrib/src/main-rust.mak +++ b/contrib/src/main-rust.mak @@ -15,10 +15,12 @@ else ifdef HAVE_ANDROID RUST_TARGET = $(HOST) else ifdef HAVE_IOS ifneq ($(ARCH),arm) # iOS 32bit is Tier 3 +ifneq ($(ARCH),i386) # iOS 32bit is Tier 3 ifndef HAVE_TVOS # tvOS is Tier 3 RUST_TARGET = $(ARCH)-apple-ios endif endif +endif else ifdef HAVE_MACOSX RUST_TARGET = $(ARCH)-apple-darwin else ifdef HAVE_SOLARIS ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] qt: fix incorrect param type
vlc | branch: master | Lyndon Brown | Sat Sep 5 19:10:53 2020 +0100| [4c75da934016f67a9bc6334e67959b3615ee6c6d] | committer: Pierre Lamot qt: fix incorrect param type which was causing a whole bunch of "'< 0' is always false" warnings. review of the original fix ([1]) indicated that in fact the parameter was wrong rather than the checks within the function being out of step with the final design of the function interface, since apparently callers are in fact passing in a signed index, where a negative represents an invalid index which the function is expected to handle appropriately. [1]: https://mailman.videolan.org/pipermail/vlc-devel/2020-September/137711.html Co-authored-by: Pierre Lamot Signed-off-by: Pierre Lamot > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4c75da934016f67a9bc6334e67959b3615ee6c6d --- modules/gui/qt/medialibrary/mlalbummodel.cpp| 2 +- modules/gui/qt/medialibrary/mlalbumtrackmodel.cpp | 2 +- modules/gui/qt/medialibrary/mlartistmodel.cpp | 2 +- modules/gui/qt/medialibrary/mlbasemodel.hpp | 12 modules/gui/qt/medialibrary/mlgenremodel.cpp| 2 +- modules/gui/qt/medialibrary/mlrecentsvideomodel.cpp | 2 +- modules/gui/qt/medialibrary/mlvideomodel.cpp| 2 +- 7 files changed, 14 insertions(+), 10 deletions(-) diff --git a/modules/gui/qt/medialibrary/mlalbummodel.cpp b/modules/gui/qt/medialibrary/mlalbummodel.cpp index dc044c28ef..2326c43718 100644 --- a/modules/gui/qt/medialibrary/mlalbummodel.cpp +++ b/modules/gui/qt/medialibrary/mlalbummodel.cpp @@ -38,7 +38,7 @@ QVariant MLAlbumModel::data(const QModelIndex , int role) const if (!index.isValid() || index.row() < 0) return QVariant(); -const MLAlbum* ml_item = item(static_cast(index.row())); +const MLAlbum* ml_item = item(index.row()); if ( ml_item == NULL ) return QVariant(); diff --git a/modules/gui/qt/medialibrary/mlalbumtrackmodel.cpp b/modules/gui/qt/medialibrary/mlalbumtrackmodel.cpp index ed4c63de7a..36db52cb26 100644 --- a/modules/gui/qt/medialibrary/mlalbumtrackmodel.cpp +++ b/modules/gui/qt/medialibrary/mlalbumtrackmodel.cpp @@ -59,7 +59,7 @@ QVariant MLAlbumTrackModel::data(const QModelIndex , int role) const if (!index.isValid() || index.row() < 0) return QVariant(); -const MLAlbumTrack* ml_track = item(static_cast(index.row())); +const MLAlbumTrack* ml_track = item(index.row()); if ( !ml_track ) return QVariant(); diff --git a/modules/gui/qt/medialibrary/mlartistmodel.cpp b/modules/gui/qt/medialibrary/mlartistmodel.cpp index ec87c17b0c..ebb30d23e2 100644 --- a/modules/gui/qt/medialibrary/mlartistmodel.cpp +++ b/modules/gui/qt/medialibrary/mlartistmodel.cpp @@ -44,7 +44,7 @@ QVariant MLArtistModel::data(const QModelIndex , int role) const if (!index.isValid() || index.row() < 0) return QVariant(); -const MLArtist* ml_artist = item(static_cast(index.row())); +const MLArtist* ml_artist = item(index.row()); if ( !ml_artist ) return QVariant(); diff --git a/modules/gui/qt/medialibrary/mlbasemodel.hpp b/modules/gui/qt/medialibrary/mlbasemodel.hpp index bbedc6c26e..326bd14117 100644 --- a/modules/gui/qt/medialibrary/mlbasemodel.hpp +++ b/modules/gui/qt/medialibrary/mlbasemodel.hpp @@ -162,7 +162,7 @@ public: return m_total_count; } -virtual T* get(unsigned int idx) const +virtual T* get(int idx) const { vlc_mutex_locker lock( _item_lock ); T* obj = item( idx ); @@ -239,8 +239,12 @@ public: } protected: -T* item(unsigned int idx) const +T* item(int signedidx) const { +if (signedidx < 0) +return nullptr; + +unsigned int idx = static_cast(signedidx); // Must be called in a locked context if ( m_initialized == false ) { @@ -251,7 +255,7 @@ protected: emit countChanged( static_cast(m_total_count) ); } -if ( m_total_count == 0 || idx >= m_total_count || idx < 0 ) +if ( m_total_count == 0 || idx >= m_total_count ) return nullptr; if ( idx < m_query_param.i_offset || idx >= m_query_param.i_offset + m_item_list.size() ) @@ -264,7 +268,7 @@ protected: } //db has changed -if ( idx - m_query_param.i_offset >= m_item_list.size() || idx - m_query_param.i_offset < 0 ) +if ( idx - m_query_param.i_offset >= m_item_list.size() || idx < m_query_param.i_offset ) return nullptr; return m_item_list[idx - m_query_param.i_offset].get(); } diff --git a/modules/gui/qt/medialibrary/mlgenremodel.cpp b/modules/gui/qt/medialibrary/mlgenremodel.cpp index a3f9a2dec6..639ce2e8ae 100644 --- a/modules/gui/qt/medialibrary/mlgenremodel.cpp +++ b/modules/gui/qt/medialibrary/mlgenremodel.cpp @@ -47,7 +47,7 @@ QVariant MLGenreModel::data(const QModelIndex , int role) const if (!index.isValid() ||
[vlc-commits] qt: remove unneccessary translation
vlc | branch: master | Lyndon Brown | Sat May 25 20:31:16 2019 +0100| [d02ebebfe80abee5bcf578a5141f004f2e192139] | committer: Pierre Lamot qt: remove unneccessary translation Signed-off-by: Pierre Lamot > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d02ebebfe80abee5bcf578a5141f004f2e192139 --- modules/gui/qt/dialogs/open/open_panels.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gui/qt/dialogs/open/open_panels.cpp b/modules/gui/qt/dialogs/open/open_panels.cpp index 3bdaaf5328..d2be788cf8 100644 --- a/modules/gui/qt/dialogs/open/open_panels.cpp +++ b/modules/gui/qt/dialogs/open/open_panels.cpp @@ -906,7 +906,7 @@ void CaptureOpenPanel::initialize() QLabel *jackPortsLabel = new QLabel( qtr( "Selected ports:" ) ); jackDevLayout->addWidget( jackPortsLabel, 0 , 0 ); -jackPortsSelected = new QLineEdit( qtr( ".*") ); +jackPortsSelected = new QLineEdit( qfu( ".*" ) ); jackPortsSelected->setAlignment( Qt::AlignRight ); jackDevLayout->addWidget( jackPortsSelected, 0, 1 ); ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] qt: fix and simplify module lookup in preferences search
vlc | branch: master | Lyndon Brown | Fri Apr 19 04:03:35 2019 +0100| [eb7c25a7e29632ffe8f68bcfa649ab216c12148a] | committer: Pierre Lamot qt: fix and simplify module lookup in preferences search 1) for module (plugin) tree nodes, the object already holds a pointer to the associated module object is was created for, so we can use that directly instead of wastefully doing a module_find() search. 2) the module_find() search actually is unreliable; modules can be mis-identified through it. to explain the second point: from investigating a crash with the Qt prefs search facility, in relation to a commit that happens to expand the number of plugins with empty config sets, a flaw was identified (fixed separately) relating to the search code not getting the NULL pointer it was expecting in the case of empty module sets, however it did not explain why the search code was actually encountering modules with empty option sets in the first place, since only plugins with non-empty sets were being added to the prefs tree; digging into this, an example module where this was the case was an 'a52' module; the one being looked at by the search code was the packetizer one, which has no options, but the entry in the tree for which the code was working on was the codec one, which has an option; it turned out that the search code was wrongly assessing the option set of the packetizer 'a52' module instead of the codec one because the module_search() call had pointed to the wrong 'a52' module. Signed-off-by: Pierre Lamot > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=eb7c25a7e29632ffe8f68bcfa649ab216c12148a --- modules/gui/qt/dialogs/preferences/complete_preferences.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gui/qt/dialogs/preferences/complete_preferences.cpp b/modules/gui/qt/dialogs/preferences/complete_preferences.cpp index e6b7c6677d..dc02c1a6f1 100644 --- a/modules/gui/qt/dialogs/preferences/complete_preferences.cpp +++ b/modules/gui/qt/dialogs/preferences/complete_preferences.cpp @@ -496,7 +496,7 @@ bool PrefsItemData::contains( const QString , Qt::CaseSensitivity cs ) if( this->i_type == TYPE_CATEGORY ) return false; else if( this->i_type == TYPE_MODULE ) -p_module = module_find( this->psz_shortcut ); +p_module = this->p_module; else { p_module = module_get_main(); ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] config: add missing subcat lookup table entries
vlc | branch: master | Lyndon Brown | Sat May 25 20:04:06 2019 +0100| [47e85ec553897b63949709a67600ca4e8b2bd778] | committer: Pierre Lamot config: add missing subcat lookup table entries Signed-off-by: Pierre Lamot > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=47e85ec553897b63949709a67600ca4e8b2bd778 --- include/vlc_config_cat.h | 12 1 file changed, 12 insertions(+) diff --git a/include/vlc_config_cat.h b/include/vlc_config_cat.h index 608d80eb4d..cd99bfaaa5 100644 --- a/include/vlc_config_cat.h +++ b/include/vlc_config_cat.h @@ -158,6 +158,9 @@ "You should probably not do that.\n" \ "You can also set default parameters for each packetizer." ) +#define SOUT_RENDER_TITLE N_( "Renderers" ) +#define SOUT_RENDER_HELP N_( "External renderer discovery related settings." ) + #define SOUT_STREAM_TITLE N_("Sout stream") #define SOUT_STREAM_HELP N_( "Sout stream modules allow to build a sout " \ "processing chain. Please refer to the Streaming Howto for " \ @@ -179,12 +182,18 @@ #define SD_HELP N_("Services discovery modules are facilities "\ "that automatically add items to playlist.") +#define PEXPORT_TITLE N_( "Export" ) +#define PEXPORT_HELP N_( "Settings relating to exporting playlists." ) + /* Advanced */ #define AADVANCED_TITLE N_( "Advanced" ) #define AADVANCED_HELP N_( "Advanced settings. Use with care...") #define MISC_TITLE N_( "Advanced settings" ) +#define ANETWORK_TITLE N_( "Network" ) +#define ANETWORK_HELP N_( "Advanced network settings." ) + /* This function is deprecated and is kept only for compatibility */ static const struct config_category_t categories_array[] = { @@ -225,14 +234,17 @@ static const struct config_category_t categories_array[] = { SUBCAT_SOUT_MUX, SOUT_MUX_TITLE, SOUT_MUX_HELP }, { SUBCAT_SOUT_ACO, SOUT_ACO_TITLE, SOUT_ACO_HELP }, { SUBCAT_SOUT_PACKETIZER, SOUT_PACKET_TITLE, SOUT_PACKET_HELP }, +{ SUBCAT_SOUT_RENDERER, SOUT_RENDER_TITLE, SOUT_RENDER_HELP }, { SUBCAT_SOUT_VOD, SOUT_VOD_TITLE, SOUT_VOD_HELP }, { CAT_PLAYLIST, PLAYLIST_TITLE , PLAYLIST_HELP }, { SUBCAT_PLAYLIST_GENERAL, PLAYLIST_TITLE, PGENERAL_HELP }, +{ SUBCAT_PLAYLIST_EXPORT, PEXPORT_TITLE, PEXPORT_HELP }, { SUBCAT_PLAYLIST_SD, SD_TITLE, SD_HELP }, { CAT_ADVANCED, AADVANCED_TITLE, AADVANCED_HELP }, { SUBCAT_ADVANCED_MISC, MISC_TITLE, AADVANCED_HELP }, +{ SUBCAT_ADVANCED_NETWORK, ANETWORK_TITLE, ANETWORK_HELP }, { -1, NULL, NULL } }; ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] qt: translate a couple of additional strings
vlc | branch: master | Lyndon Brown | Sat May 25 20:47:11 2019 +0100| [2d0927a36615c159c67129e9dac43dd692737090] | committer: Pierre Lamot qt: translate a couple of additional strings Signed-off-by: Pierre Lamot > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2d0927a36615c159c67129e9dac43dd692737090 --- modules/gui/qt/dialogs/messages/messages.cpp | 2 +- modules/gui/qt/dialogs/vlm/vlm.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/gui/qt/dialogs/messages/messages.cpp b/modules/gui/qt/dialogs/messages/messages.cpp index f0bedeadd6..abd0d5f7f2 100644 --- a/modules/gui/qt/dialogs/messages/messages.cpp +++ b/modules/gui/qt/dialogs/messages/messages.cpp @@ -93,7 +93,7 @@ MessagesDialog::MessagesDialog( intf_thread_t *_p_intf) changeVerbosity( i_verbosity ); ui.verbosityBox->setValue( qMin( i_verbosity, 2 ) ); -getSettings()->beginGroup( "Messages" ); +getSettings()->beginGroup( qtr("Messages") ); ui.filterEdit->setText( getSettings()->value( "messages-filter" ).toString() ); getSettings()->endGroup(); diff --git a/modules/gui/qt/dialogs/vlm/vlm.cpp b/modules/gui/qt/dialogs/vlm/vlm.cpp index ce24eefa44..2b21d52f91 100644 --- a/modules/gui/qt/dialogs/vlm/vlm.cpp +++ b/modules/gui/qt/dialogs/vlm/vlm.cpp @@ -468,7 +468,7 @@ VLMAWidget::VLMAWidget( VLMWrapper *_vlm, const QString& _name, QToolButton *deleteButton = new QToolButton; deleteButton->setIcon( QIcon( ":/toolbar/clear.svg" ) ); -deleteButton->setToolTip("Delete"); +deleteButton->setToolTip( qtr("Delete") ); objLayout->addWidget( deleteButton, 0, 6 ); BUTTONACT( modifyButton, modify() ); ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] qt: fix double translation of subcats in advanced prefs
vlc | branch: master | Lyndon Brown | Sat May 25 19:12:23 2019 +0100| [63dc2d5e741d21393bdfae637079ba268cc6ca29] | committer: Pierre Lamot qt: fix double translation of subcats in advanced prefs the config_CategoryNameGet() and config_CategoryHelpGet() functions already perform translation, so the use of qtr() instead of qfu() on the result of calling those functions is an undesirable double translation. this issue, combined with two others, results in a null dereference crash (simply opening the advanced preferences view in the Qt GUI) under conditions that arose in some work i was doing. those other issues specifically are: 1) the lookup table used by those functions is incomplete, missing records for a few subcats, thus a null is returned when looking them up. (this is addressed in a follow up commit). 2) the vlc gettext wrappers crash when given a null pointer. (the subject of a separate patch discussion). the explicit null check for help text has been removed here, since every subcat should have help text along with a name in the lookup tables. Signed-off-by: Pierre Lamot > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=63dc2d5e741d21393bdfae637079ba268cc6ca29 --- .../dialogs/preferences/complete_preferences.cpp | 25 ++ 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/modules/gui/qt/dialogs/preferences/complete_preferences.cpp b/modules/gui/qt/dialogs/preferences/complete_preferences.cpp index eb8a3e0bff..e6b7c6677d 100644 --- a/modules/gui/qt/dialogs/preferences/complete_preferences.cpp +++ b/modules/gui/qt/dialogs/preferences/complete_preferences.cpp @@ -88,7 +88,6 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent, /* Go through the list of conf */ for( size_t i = 0; i < confsize; i++ ) { -const char *psz_help; QIcon icon; /* Work on a new item */ @@ -102,12 +101,8 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent, /* PrefsItemData Init */ data = new PrefsItemData( this ); -data->name = qtr( config_CategoryNameGet( p_item->value.i ) ); -psz_help = config_CategoryHelpGet( p_item->value.i ); -if( psz_help ) -data->help = qtr( psz_help ); -else -data->help.clear(); +data->name = qfu( config_CategoryNameGet( p_item->value.i ) ); +data->help = qfu( config_CategoryHelpGet( p_item->value.i ) ); data->i_type = PrefsItemData::TYPE_CATEGORY; data->i_object_id = p_item->value.i; @@ -153,12 +148,8 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent, /* Data still contains the correct thing */ data->i_type = PrefsItemData::TYPE_CATSUBCAT; data->i_subcat_id = p_item->value.i; -data->name = qtr( config_CategoryNameGet( p_item->value.i ) ); -psz_help = config_CategoryHelpGet( p_item->value.i ); -if( psz_help ) -data->help = qtr( psz_help ); -else -data->help.clear(); +data->name = qfu( config_CategoryNameGet( p_item->value.i ) ); +data->help = qfu( config_CategoryHelpGet( p_item->value.i ) ); current_item->setData( 0, Qt::UserRole, QVariant::fromValue( data ) ); continue; @@ -168,12 +159,8 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent, /* Process the Data */ data_sub = new PrefsItemData( this ); -data_sub->name = qtr( config_CategoryNameGet( p_item->value.i) ); -psz_help = config_CategoryHelpGet( p_item->value.i ); -if( psz_help ) -data_sub->help = qtr( psz_help ); -else -data_sub->help.clear(); +data_sub->name = qfu( config_CategoryNameGet( p_item->value.i) ); +data_sub->help = qfu( config_CategoryHelpGet( p_item->value.i ) ); data_sub->i_type = PrefsItemData::TYPE_SUBCATEGORY; data_sub->i_object_id = p_item->value.i; ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits