/// <summary> /// Parse the section. /// </summary> /// <param name="byteData">The MPEG2 section containing the section.</param> /// <param name="index">Index of the first byte of the title section in the MPEG2 section.</param> /// <returns>True if the section is an MHW2 title section; false otherwise.</returns> internal bool Process(byte[] byteData, int index) { lastIndex = index; /*int checkIndex = 18; * bool process = false; * * while (checkIndex < byteData.Length) * { * process = false; * checkIndex += 7; * * if (checkIndex < byteData.Length) * { * checkIndex += 3; * * if (checkIndex < byteData.Length) * { * if (byteData[checkIndex] > 0xc0) * { * checkIndex += (byteData[checkIndex] - 0xc0); * checkIndex += 4; * * if (checkIndex < byteData.Length) * { * if (byteData[checkIndex] == 0xff) * { * checkIndex += 1; * process = true; * } * } * } * } * } * } * * if (!process) * return (false);*/ /*Logger.Instance.Dump("Title Section", byteData, byteData.Length);*/ unknown = Utils.GetBytes(byteData, lastIndex, 15); lastIndex += unknown.Length; while (lastIndex < byteData.Length) { MediaHighway2TitleData title = new MediaHighway2TitleData(); title.Process(byteData, lastIndex); titles.Add(title); lastIndex = title.Index; } return(true); }
/// <summary> /// Parse the section. /// </summary> /// <param name="byteData">The MPEG2 section containing the section.</param> /// <param name="index">Index of the first byte of the title section in the MPEG2 section.</param> /// <returns>True if the section is an MHW2 title section; false otherwise.</returns> internal bool Process(byte[] byteData, int index) { lastIndex = index; /*int checkIndex = 18; bool process = false; while (checkIndex < byteData.Length) { process = false; checkIndex += 7; if (checkIndex < byteData.Length) { checkIndex += 3; if (checkIndex < byteData.Length) { if (byteData[checkIndex] > 0xc0) { checkIndex += (byteData[checkIndex] - 0xc0); checkIndex += 4; if (checkIndex < byteData.Length) { if (byteData[checkIndex] == 0xff) { checkIndex += 1; process = true; } } } } } } if (!process) return (false);*/ /*Logger.Instance.Dump("Title Section", byteData, byteData.Length);*/ unknown = Utils.GetBytes(byteData, lastIndex, 15); lastIndex += unknown.Length; while (lastIndex < byteData.Length) { MediaHighway2TitleData title = new MediaHighway2TitleData(); title.Process(byteData, lastIndex); titles.Add(title); lastIndex = title.Index; } return (true); }