]> git.sesse.net Git - mlt/commitdiff
Fix audio_index=all when stream not stereo.
authorDan Dennedy <dan@dennedy.org>
Sun, 13 Dec 2009 21:26:08 +0000 (13:26 -0800)
committerDan Dennedy <dan@dennedy.org>
Sun, 13 Dec 2009 21:26:08 +0000 (13:26 -0800)
src/modules/avformat/producer_avformat.c

index f076aa712ac7d99848f03166e3970841ba6c8861..aa9fa9542b4899aa286563a456c1b7676b7c92e9 100644 (file)
@@ -1692,7 +1692,10 @@ static int producer_get_audio( mlt_frame frame, void **buffer, mlt_audio_format
                        // We only deal with audio from the selected audio index
                        if ( ret >= 0 && pkt.data && pkt.size > 0 && ( pkt.stream_index == this->audio_index ||
                                 ( this->audio_index == INT_MAX && context->streams[ pkt.stream_index ]->codec->codec_type == CODEC_TYPE_AUDIO ) ) )
-                               ret = decode_audio( this, &ignore, &pkt, *channels, *samples, real_timecode, source_fps );
+                       {
+                               int channels2 = this->audio_index == INT_MAX ? this->audio_codec[pkt.stream_index]->channels : *channels;
+                               ret = decode_audio( this, &ignore, &pkt, channels2, *samples, real_timecode, source_fps );
+                       }
                        av_free_packet( &pkt );
 
                        if ( this->audio_index == INT_MAX && ret >= 0 )