public override bool EndOfStream(int inputIndex)
        {
            if (inputIndex == _audioInputIndex && !_audioEos)
            {
                _audioEncoder.EndOfStream(0);
                _audioEos = true;
            }

            if (inputIndex == _videoInputIndex && !_videoEos)
            {
                _videoEncoder.EndOfStream(0);
                _videoEos = true;
            }

            if (_audioEos && _videoEos)
            {
                return(Drain());
            }

            return(true);
        }