| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "media/base/buffers.h" | 10 #include "media/base/buffers.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 // Offset of frames in the file: | 61 // Offset of frames in the file: |
| 62 // {0x20, 0x1c1, 0x277, 0x2f9, 0x3fd, 0x47f, 0x501, 0x583, | 62 // {0x20, 0x1c1, 0x277, 0x2f9, 0x3fd, 0x47f, 0x501, 0x583, |
| 63 // 0x605, 0x687, 0x73d, 0x7a5, 0x80d} | 63 // 0x605, 0x687, 0x73d, 0x7a5, 0x80d} |
| 64 // TODO(damienv): find a file that would be more relevant for Mpeg1 audio | 64 // TODO(damienv): find a file that would be more relevant for Mpeg1 audio |
| 65 // as part of Mpeg2 TS. | 65 // as part of Mpeg2 TS. |
| 66 EXPECT_TRUE(Process(pes_packets, false)); | 66 EXPECT_TRUE(Process(pes_packets, false)); |
| 67 EXPECT_EQ(1u, config_count_); | 67 EXPECT_EQ(1u, config_count_); |
| 68 EXPECT_EQ(12u, buffer_count_); | 68 EXPECT_EQ(12u, buffer_count_); |
| 69 } | 69 } |
| 70 | 70 |
| 71 TEST_F(EsParserMpeg1AudioTest, NoTimingInfo) { |
| 72 LoadStream("sfx.mp3"); |
| 73 std::vector<Packet> pes_packets = GenerateFixedSizePesPacket(512); |
| 74 |
| 75 // Process should succeed even without timing info, we should just skip the |
| 76 // audio frames without timing info, but still should be able to parse and |
| 77 // play the stream after that. |
| 78 EXPECT_TRUE(Process(pes_packets, false)); |
| 79 EXPECT_EQ(1u, config_count_); |
| 80 EXPECT_EQ(0u, buffer_count_); |
| 81 } |
| 82 |
| 71 } // namespace mp2t | 83 } // namespace mp2t |
| 72 } // namespace media | 84 } // namespace media |
| OLD | NEW |