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

Side by Side Diff: media/formats/mp2t/es_parser_adts_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_adts.cc ('k') | media/formats/mp2t/es_parser_mpeg1audio.cc » ('j') | 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 29 matching lines...) Expand all
40 EsParserAdts es_parser( 40 EsParserAdts es_parser(
41 base::Bind(&EsParserAdtsTest::NewAudioConfig, base::Unretained(this)), 41 base::Bind(&EsParserAdtsTest::NewAudioConfig, base::Unretained(this)),
42 base::Bind(&EsParserAdtsTest::EmitBuffer, base::Unretained(this)), 42 base::Bind(&EsParserAdtsTest::EmitBuffer, base::Unretained(this)),
43 false); 43 false);
44 return ProcessPesPackets(&es_parser, pes_packets, force_timing); 44 return ProcessPesPackets(&es_parser, pes_packets, force_timing);
45 } 45 }
46 46
47 TEST_F(EsParserAdtsTest, NoInitialPts) { 47 TEST_F(EsParserAdtsTest, NoInitialPts) {
48 LoadStream("bear.adts"); 48 LoadStream("bear.adts");
49 std::vector<Packet> pes_packets = GenerateFixedSizePesPacket(512); 49 std::vector<Packet> pes_packets = GenerateFixedSizePesPacket(512);
50 EXPECT_FALSE(Process(pes_packets, false)); 50 // Process should succeed even without timing info, we should just skip the
51 // audio frames without timing info, but still should be able to parse and
52 // play the stream after that.
53 EXPECT_TRUE(Process(pes_packets, false));
54 EXPECT_EQ(1u, config_count_);
51 EXPECT_EQ(0u, buffer_count_); 55 EXPECT_EQ(0u, buffer_count_);
52 } 56 }
53 57
54 TEST_F(EsParserAdtsTest, SinglePts) { 58 TEST_F(EsParserAdtsTest, SinglePts) {
55 LoadStream("bear.adts"); 59 LoadStream("bear.adts");
56 60
57 std::vector<Packet> pes_packets = GenerateFixedSizePesPacket(512); 61 std::vector<Packet> pes_packets = GenerateFixedSizePesPacket(512);
58 pes_packets.front().pts = base::TimeDelta::FromSeconds(10); 62 pes_packets.front().pts = base::TimeDelta::FromSeconds(10);
59 63
60 EXPECT_TRUE(Process(pes_packets, false)); 64 EXPECT_TRUE(Process(pes_packets, false));
61 EXPECT_EQ(1u, config_count_); 65 EXPECT_EQ(1u, config_count_);
62 EXPECT_EQ(45u, buffer_count_); 66 EXPECT_EQ(45u, buffer_count_);
63 } 67 }
64 68
65 } // namespace mp2t 69 } // namespace mp2t
66 } // namespace media 70 } // namespace media
67 71
OLDNEW
« no previous file with comments | « media/formats/mp2t/es_parser_adts.cc ('k') | media/formats/mp2t/es_parser_mpeg1audio.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698