From: j-b-m Date: Sun, 31 Dec 2006 15:29:19 +0000 (+0000) Subject: Vorbis should set correct values in frame for audio channels and frequency. X-Git-Url: http://research.m1stereo.tv/gitweb?a=commitdiff_plain;h=a5b82fc0a3bb42bd849c8c82e3418402cc2fe9d9;p=melted Vorbis should set correct values in frame for audio channels and frequency. git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@942 d19143bc-622f-0410-bfdd-b5b2a6649095 --- diff --git a/src/modules/vorbis/producer_vorbis.c b/src/modules/vorbis/producer_vorbis.c index e7dd366..d69fc82 100644 --- a/src/modules/vorbis/producer_vorbis.c +++ b/src/modules/vorbis/producer_vorbis.c @@ -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 );