]> git.sesse.net Git - mlt/commitdiff
Vorbis should set correct values in frame for audio channels and frequency.
authorj-b-m <j-b-m@d19143bc-622f-0410-bfdd-b5b2a6649095>
Sun, 31 Dec 2006 15:29:19 +0000 (15:29 +0000)
committerj-b-m <j-b-m@d19143bc-622f-0410-bfdd-b5b2a6649095>
Sun, 31 Dec 2006 15:29:19 +0000 (15:29 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@942 d19143bc-622f-0410-bfdd-b5b2a6649095

src/modules/vorbis/producer_vorbis.c

index e7dd3669327b3c432a3c94ace9611088110f80d8..d69fc82a75501870267bd6c4bb087ad9c466c58e 100644 (file)
@@ -129,6 +129,11 @@ static int producer_open( mlt_producer this, char *file )
                                // Set out and length of file
                                mlt_properties_set_position( properties, "out", ( length * fps ) - 1 );
                                mlt_properties_set_position( properties, "length", ( length * fps ) );
+
+                               // Get the vorbis info
+                               vorbis_info *vi = ov_info( ov, -1 );
+                               mlt_properties_set_int( properties, "frequency", (int) vi->rate );
+                               mlt_properties_set_int( properties, "channels", vi->channels );
                        }
                }
                else
@@ -310,12 +315,16 @@ static int producer_get_frame( mlt_producer this, mlt_frame_ptr frame, int index
        mlt_frame_set_position( *frame, mlt_producer_position( this ) );
 
        // Set the position of this producer
-       mlt_properties_set_position( MLT_FRAME_PROPERTIES( *frame ), "vorbis_position", mlt_producer_frame( this ) );
+       mlt_properties frame_properties = MLT_FRAME_PROPERTIES( *frame );
+       mlt_properties_set_position( frame_properties, "vorbis_position", mlt_producer_frame( this ) );
 
        // Set up the audio
        mlt_frame_push_audio( *frame, this );
        mlt_frame_push_audio( *frame, producer_get_audio );
 
+       // Pass audio properties to the frame
+       mlt_properties_pass_list( frame_properties, MLT_PRODUCER_PROPERTIES( this ), "frequency, channels" );
+
        // Calculate the next timecode
        mlt_producer_prepare_next( this );