]> git.sesse.net Git - mlt/commitdiff
Support streamtype-specific AVOptions (-vb)
authorDan Dennedy <dan@dennedy.org>
Wed, 21 Sep 2011 06:14:31 +0000 (23:14 -0700)
committerDan Dennedy <dan@dennedy.org>
Wed, 21 Sep 2011 06:14:31 +0000 (23:14 -0700)
src/modules/avformat/consumer_avformat.c
src/modules/avformat/consumer_avformat.yml

index 293e778f70cf35e3f67b9c41cb3e9d40076bbb30..a22202b21f461b46c3dfadb9090dcc012b95a789 100644 (file)
@@ -409,7 +409,13 @@ static void apply_properties( void *obj, mlt_properties properties, int flags )
                const char *opt_name = mlt_properties_get_name( properties, i );
                const AVOption *opt = av_find_opt( obj, opt_name, NULL, flags, flags );
 
-               if ( opt != NULL )
+               // If option not found, see if it was prefixed with a or v (-vb)
+               if ( !opt && (
+                       opt_name[0] == 'v' && ( flags & AV_OPT_FLAG_VIDEO_PARAM ) ||
+                       opt_name[0] == 'a' && ( flags & AV_OPT_FLAG_AUDIO_PARAM ) ) )
+                       opt = av_find_opt( obj, ++opt_name, NULL, flags, flags );
+               // Apply option if found
+               if ( opt )
 #if LIBAVCODEC_VERSION_INT >= ((52<<16)+(7<<8)+0)
                        av_set_string3( obj, opt_name, mlt_properties_get_value( properties, i), alloc, NULL );
 #elif LIBAVCODEC_VERSION_INT >= ((51<<16)+(59<<8)+0)
index 317f821f697bd3ffd04cbf595c4906bf97d7d22d..a0cb43f87aedfef41063678067022dae489e213a 100644 (file)
@@ -2,7 +2,7 @@ schema_version: 0.1
 type: consumer
 identifier: avformat
 title: FFmpeg Output
-version: 1
+version: 2
 copyright: Copyright (C) 2003-2011 Ushodaya Enterprises Limited
 license: LGPL
 language: en
@@ -362,7 +362,7 @@ parameters:
   - identifier: passlogfile
     title: Two-pass log file
     type: string
-  - identifier: b
+  - identifier: vb
     title: Video bitrate
     type: string
     unit: bits/second