]> git.sesse.net Git - mlt/commitdiff
Support standard query syntax on avformat URL.
authorDan Dennedy <dan@dennedy.org>
Mon, 4 Jul 2011 18:08:31 +0000 (11:08 -0700)
committerDan Dennedy <dan@dennedy.org>
Mon, 4 Jul 2011 18:08:31 +0000 (11:08 -0700)
src/modules/avformat/producer_avformat.c
src/modules/avformat/producer_avformat.yml
src/modules/melt/producer_melt.c

index 027a39417b730bb55c6dad9d3a4139569f80b188..3a25eab7590d6dd5bd1e5d1fb5db25c836a99f04 100644 (file)
@@ -583,7 +583,10 @@ static char* parse_url( mlt_profile profile, const char* URL, AVInputFormat **fo
                        {
                                url[0] = 0;
                                char *name = strdup( ++url );
-                               char *value = strchr( name, ':' );
+                               char *value = strchr( name, '=' );
+                               if ( !value )
+                                       // Also accept : as delimiter for backwards compatibility.
+                                       value = strchr( name, ':' );
                                if ( value )
                                {
                                        value[0] = 0;
index df28a6f07f8e5ebfe11b4ad41b2c192cdf54e736..21571a395583c411d6b4a1356648e558b7d009fa 100644 (file)
@@ -30,9 +30,8 @@ parameters:
     description: |
       A file name specification or URL in the form:
       [{protocol}|{format}]:{resource}[?{format-parameter}[&{format-parameter}...]]
-      For example, video4linux:/dev/video1?width:320&height:240
+      For example, video4linux2:/dev/video1?width=320&height=240
       Note: on the bash command line, & must be escaped as '\&'.
-      Also, note the use of ':' instead of '=' for parameters.
       Use 'f-list' to see a list of supported file formats.
       Use 'vcodec-list' to see a list of supported video decoders.
       Use 'acodec-list' to see a list of supported audio decoders.
index 05c9ea8636e6805d812454a69ced7133377270c5..69bcad8c0a1cdeb9993e56838bcae849232e61bf 100644 (file)
@@ -404,7 +404,10 @@ mlt_producer producer_melt_init( mlt_profile profile, mlt_service_type type, con
                                        mlt_properties_set_int( properties, "hide", 2 );
                        }
                }
-               else if ( strchr( argv[ i ], '=' ) && strstr( argv[ i ], "<?xml" ) != argv[ i ] )
+               else if ( strchr( argv[ i ], '=' ) && strstr( argv[ i ], "<?xml" ) != argv[ i ] &&
+                       // Prevent interpreting URL with parameters as a property.
+                       // This does not support property names containing a colon.
+                       ( !strchr( argv[ i ], ':' ) || strchr( argv[ i ], ':' ) > strchr( argv[ i ], '=' ) ) )
                {
                        mlt_properties_parse( properties, argv[ i ] );
                }