private void ReadDvbSBlock(ref int off) { int blockSize; if (!IsDvbsBlock(ref off, out blockSize)) return; this.dvbsBlockSize = blockSize; this.dvbsBlockOffset = off; off += 4; this.satConfig = this.satConfigs.TryGet(blockSize); if (satConfig != null) this.ReadDvbsSubblocks(ref off); else { this.DataRoot.Warnings.AppendFormat("DVB-S data format is not supported (size={0})\n", blockSize); off += blockSize; } }
private bool IsDvbsBlock(ref int off, out int blockSize) { blockSize = 0; if (off >= fileContent.Length) return false; blockSize = this.GetBlockSize(off); if (blockSize < 12) return false; long blockId = BitConverter.ToInt64(fileContent, off + 8); if (blockId == DVBS_S2) return true; // LW4500, LW5400, LMxxxT and maybe other models with bogus DVB-S block if (blockId == -1) { this.satConfig = satConfigs.TryGet(blockSize); if (this.satConfig != null) { this.dvbsBlockSize = blockSize; this.dvbsBlockOffset = off; off += 4 + blockSize; } } return false; }