]> git.sesse.net Git - mlt/commitdiff
Fix metadata for avformat demuxer/device-specific options.
authorDan Dennedy <dan@dennedy.org>
Tue, 5 Jul 2011 02:40:10 +0000 (19:40 -0700)
committerDan Dennedy <dan@dennedy.org>
Tue, 5 Jul 2011 02:40:10 +0000 (19:40 -0700)
src/modules/avformat/factory.c

index ab62007b12c699768d457b15c737a97815a20e18..e411798c851c86b85d2ed5b79ed01480a60d5ae2 100644 (file)
@@ -316,10 +316,20 @@ static mlt_properties avformat_metadata( mlt_service_type type, const char *id,
                add_parameters( params, avformat, flags, NULL, NULL );
 #if LIBAVFORMAT_VERSION_MAJOR > 52
                avformat_init();
-               AVOutputFormat *f = NULL;
-               while ( ( f = av_oformat_next( f ) ) )
-                       if ( f->priv_class )
-                               add_parameters( params, &f->priv_class, flags, NULL, f->name );
+               if ( type == producer_type )
+               {
+                       AVInputFormat *f = NULL;
+                       while ( ( f = av_iformat_next( f ) ) )
+                               if ( f->priv_class )
+                                       add_parameters( params, &f->priv_class, flags, NULL, f->name );
+               }
+               else
+               {
+                       AVOutputFormat *f = NULL;
+                       while ( ( f = av_oformat_next( f ) ) )
+                               if ( f->priv_class )
+                                       add_parameters( params, &f->priv_class, flags, NULL, f->name );
+               }
 #endif
 
                add_parameters( params, avcodec, flags, NULL, NULL );