private bool DecodePsPacket()
        {
            MpegStream.ReadTransactionBegin();
            try
            {
                if (MpegPsDemuxer.HasMorePackets)
                {
                    var Packet = MpegPsDemuxer.ReadPacketizedElementaryStreamHeader();
                    var Info   = MpegPsDemuxer.ParsePacketizedStream(Packet.Stream);

                    //ConsoleUtils.SaveRestoreConsoleColor(ConsoleColor.Green, () => { Console.WriteLine("DecodePsPacket: {0}:{1:X4}: {2}", Packet.Type, (int)Packet.Type, Info); });

                    switch (Packet.Type)
                    {
                    case Formats.video.MpegPsDemuxer.ChunkType.ST_Video1:
                        UpdateAuFromPacketInfo(AvcAu, Info);
                        if (DumpStreams)
                        {
                            FileUtils.CreateAndAppendStream(@"c:\isos\psp\out\video.stream", Info.Stream.Slice());
                        }
                        Info.Stream.Slice().CopyToFast(VideoStream);
                        break;

                    case Formats.video.MpegPsDemuxer.ChunkType.ST_Private1:
                        if (DumpStreams)
                        {
                            FileUtils.CreateAndAppendStream(@"c:\isos\psp\out\audio.stream", Info.Stream.Slice());
                        }
                        UpdateAuFromPacketInfo(AtracAu, Info);
                        Info.Stream.Slice().CopyToFast(AudioStream);
                        break;

                    default:
                        ConsoleUtils.SaveRestoreConsoleColor(ConsoleColor.Red,
                                                             () => { Console.WriteLine("Unknown PacketType: {0}", Packet.Type); });
                        break;
                    }
                }

                MpegStream.ReadTransactionCommit();
                return(true);
            }
            catch (EndOfStreamException EndOfStreamException)
            {
                MpegStream.ReadTransactionRevert();
                return(false);
            }
        }
        public void ReadPacketizedElementaryStreamHeaderTest()
        {
            MpegPsDemuxer.Packet packet;
            var mpegPsDemuxer = new MpegPsDemuxer(File.OpenRead("../../../TestInput/test.pmf").SliceWithLength(0x800));

            for (int n = 0; n < 32; n++)
            {
                packet = mpegPsDemuxer.ReadPacketizedElementaryStreamHeader();
                //if ((Packet.Type & 0xFF0) == 0x1E0)
                //if (Packet.Type == 0x1E0)
                {
                    Console.WriteLine("0x{0:X}", packet.Type);
                    mpegPsDemuxer.ParsePacketizedStream(packet.Stream);
                }
            }
        }