private void FixSoundReference_Codec(int originalIndex, IWriter buffer)
        {
            var codec = _container.FindSoundCodec(originalIndex);

            int newIndex;

            if (!_soundCodecs.TryGetValue(codec, out newIndex))
            {
                newIndex = _soundResources.Codecs.FindIndex(c => c.Equals(codec.Source));
                if (newIndex == -1)
                {
                    newIndex = _soundResources.Codecs.Count;
                    _soundResources.Codecs.Add(codec.Source);
                }
                _soundCodecs[codec] = newIndex;
            }
            buffer.SeekTo(_soundLayout.GetFieldOffset("codec index"));
            buffer.WriteInt16((short)newIndex);
        }