mirror of
https://github.com/PredatH0r/ChanSort.git
synced 2026-01-14 19:32:04 +01:00
Panasonic: fixed byte-order detection for symbol rate and satellite orbital position
This commit is contained in:
@@ -98,23 +98,33 @@ namespace ChanSort.Loader.Panasonic
|
||||
this.FreqInMhz = freq/10;
|
||||
// ReSharper restore PossibleLossOfFraction
|
||||
|
||||
if (deliveryLength == 17) // files of this version also include an additional "cicam_identifier" column
|
||||
if (deliveryLength >= 12)
|
||||
{
|
||||
// 50 94 14 01 90 99 21 00 22 31 92 01 00 00 00 00 00
|
||||
this.SymbolRate = (delivery[6] >> 4) * 10000 + (delivery[6] & 0x0F) * 1000 +
|
||||
(delivery[5] >> 4) * 100 + (delivery[5] & 0x0F) * 10;
|
||||
this.SatPosition = ((decimal)((delivery[11] >> 4) * 1000 + (delivery[11] & 0x0F) * 100 +
|
||||
(delivery[10] >> 4) * 10 + (delivery[10] & 0x0F)) / 10).ToString("n1"); // 92 01 => 19.2
|
||||
this.Satellite = this.SatPosition;
|
||||
}
|
||||
else if (deliveryLength == 15)
|
||||
{
|
||||
// 01 14 92 99 00 21 99 90 02 31 01 92 00 00 00
|
||||
this.SymbolRate = (delivery[5] >> 4) * 10000 + (delivery[5] & 0x0F) * 1000 +
|
||||
(delivery[6] >> 4) * 100 + (delivery[6] & 0x0F) * 10;
|
||||
this.SatPosition = ((decimal)((delivery[10] >> 4) * 1000 + (delivery[10] & 0x0F) * 100 + (delivery[11] >> 4) * 10 +
|
||||
(delivery[11] & 0x0F)) / 10).ToString("n1"); // 01 92 => 19.2
|
||||
this.Satellite = this.SatPosition;
|
||||
// byte 5 and 6 contain hex-encoded decimal digits for symbol rate divided by 10. bytes 10 and 11 are the sat orbital position
|
||||
// however there are some files that swap the bytes with no clear indication what format is used by the TV.
|
||||
// we use a heuristic approach whether byte 0 or byte 3 is 0x01
|
||||
|
||||
if (delivery[3] == 0x01)
|
||||
{
|
||||
// 50 94 14 01 90 99 21 00 22 31 92 01 00 00 00 00 00
|
||||
// 04 54 10 01 10 50 27 00 04 09 30 01 00 00 00
|
||||
|
||||
this.SymbolRate = (delivery[6] >> 4) * 10000 + (delivery[6] & 0x0F) * 1000 +
|
||||
(delivery[5] >> 4) * 100 + (delivery[5] & 0x0F) * 10;
|
||||
this.SatPosition = ((decimal)((delivery[11] >> 4) * 1000 + (delivery[11] & 0x0F) * 100 + // 99 21 => 21990, 50 27 => 27500
|
||||
(delivery[10] >> 4) * 10 + (delivery[10] & 0x0F)) / 10).ToString("n1"); // 92 01 => 19.2
|
||||
this.Satellite = this.SatPosition;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 01 14 92 99 00 21 99 90 02 31 01 92 00 00 00
|
||||
|
||||
this.SymbolRate = (delivery[5] >> 4) * 10000 + (delivery[5] & 0x0F) * 1000 + // 21 99 => 21990
|
||||
(delivery[6] >> 4) * 100 + (delivery[6] & 0x0F) * 10;
|
||||
this.SatPosition = ((decimal)((delivery[10] >> 4) * 1000 + (delivery[10] & 0x0F) * 100 + (delivery[11] >> 4) * 10 +
|
||||
(delivery[11] & 0x0F)) / 10).ToString("n1"); // 01 92 => 19.2
|
||||
this.Satellite = this.SatPosition;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user