A side effect of this bug was a big memory consumption. This occurs
mostly commonly when using 5.1 audio sources such as AVCHD or DVD and
encoding to 44.1 KHz.
AVPacket pkt;
av_init_packet( &pkt );
+
+ // If not resampling, give consumer more than requested.
+ // It requested number samples based on requested frame rate.
+ // Do not clean this up with a samples *= ...!
+ if ( this->audio_index != INT_MAX && ! this->audio_resample[ this->audio_index ] )
+ *samples = *samples * this->audio_codec[ this->audio_index ]->sample_rate / *frequency;
while ( ret >= 0 && !got_audio )
{