Fixed a few bitwise & confusions with logical &...

This commit is contained in:
niksedk 2014-09-06 15:19:21 +02:00
parent c0685940cd
commit 5261d5d410
3 changed files with 8 additions and 8 deletions

View File

@ -92,7 +92,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
buffer = new byte[] { 0x14, 0x2F, 0x0D, 0x0A, 0xFE, 0x30, 0x30, 0x32, 0x30 };
fs.Write(buffer, 0, buffer.Length);
WriteTime(fs, p.EndTime, true);
buffer = new byte[] { 0x14, 0x2C };
// buffer = new byte[] { 0x14, 0x2C };
}
fs.Close();
}

View File

@ -57,13 +57,13 @@ namespace Nikse.SubtitleEdit.Logic.TransportStream
{
Length = packetBuffer[4];
DiscontinuityIndicator = 1 == packetBuffer[5] >> 7;
RandomAccessIndicator = 1 == (packetBuffer[5] & 64); // and with 01000000 to get second byte
ElementaryStreamPriorityIndicator = 1 == (packetBuffer[5] & 32); // and with 00100000 to get third byte
RandomAccessIndicator = (packetBuffer[5] & 64) > 0; // and with 01000000 to get second byte
ElementaryStreamPriorityIndicator = (packetBuffer[5] & 32) > 0; // and with 00100000 to get third byte
PcrFlag = (packetBuffer[5] & 16) > 0; // and with 00010000 to get fourth byte
OpcrFlag = (packetBuffer[5] & 8) > 0; // and with 00001000 to get fifth byte
SplicingPointFlag = 1 == (packetBuffer[5] & 4); // and with 00000100 to get sixth byte
TransportPrivateDataFlag = 1 == (packetBuffer[5] & 2); // and with 00000100 to get seventh byte
AdaptationFieldExtensionFlag = 1 == (packetBuffer[5] & 1); // and with 00000010 to get 8th byte
SplicingPointFlag = (packetBuffer[5] & 4) > 0; // and with 00000100 to get sixth byte
TransportPrivateDataFlag = (packetBuffer[5] & 2) > 0; // and with 00000100 to get seventh byte
AdaptationFieldExtensionFlag = (packetBuffer[5] & 1) > 0; // and with 00000010 to get 8th byte
int index = 6;
if (PcrFlag)

View File

@ -1283,7 +1283,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoFormats
numberOfFrames = (byte)_f.ReadByte();
numberOfFrames++;
for (int i = 1; i <= numberOfFrames; i++)
b = (byte)_f.ReadByte(); // frames
_f.ReadByte(); // frames
break;
case 6: System.Diagnostics.Debug.Print("EBML"); // 6 = 00000110 = EMBL
numberOfFrames = (byte)_f.ReadByte();
@ -1339,7 +1339,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoFormats
numberOfFrames = (byte)_f.ReadByte();
numberOfFrames++;
for (int i = 1; i <= numberOfFrames; i++)
b = (byte)_f.ReadByte(); // frames
_f.ReadByte(); // frames
break;
case 6: System.Diagnostics.Debug.Print("EBML"); // 6 = 00000110 = EMBL
numberOfFrames = (byte)_f.ReadByte();