Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: media/formats/mp2t/es_parser_mpeg1audio_unittest.cc

Issue 646673002: Skip audio frames with unknown timestamp in MPEG2TS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/skip/skipping/ Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/formats/mp2t/es_parser_mpeg1audio.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « media/formats/mp2t/es_parser_mpeg1audio.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698