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

Unified Diff: media/base/android/test_data_factory.cc

Issue 1254293003: MediaCodecPlayer implementation (stage 4 - preroll) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mtplayer-browserseek
Patch Set: Rebased Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/android/test_data_factory.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/android/test_data_factory.cc
diff --git a/media/base/android/test_data_factory.cc b/media/base/android/test_data_factory.cc
index 0bf3782c306bdd1c89c37677434eeac599ddfdb2..cc434a82c712d450644db1fa9f4f37c5f65764f9 100644
--- a/media/base/android/test_data_factory.cc
+++ b/media/base/android/test_data_factory.cc
@@ -60,7 +60,8 @@ TestDataFactory::TestDataFactory(const char* file_name_template,
base::TimeDelta frame_period)
: duration_(duration),
frame_period_(frame_period),
- starvation_mode_(false) {
+ starvation_mode_(false),
+ eos_reached_(false) {
LoadPackets(file_name_template);
}
@@ -70,6 +71,9 @@ bool TestDataFactory::CreateChunk(DemuxerData* chunk, base::TimeDelta* delay) {
DCHECK(chunk);
DCHECK(delay);
+ if (eos_reached_)
+ return false;
+
*delay = base::TimeDelta();
for (int i = 0; i < 4; ++i) {
@@ -85,6 +89,7 @@ bool TestDataFactory::CreateChunk(DemuxerData* chunk, base::TimeDelta* delay) {
return false;
unit.is_end_of_stream = true;
+ eos_reached_ = true;
break; // EOS units have no data.
}
@@ -104,6 +109,7 @@ bool TestDataFactory::CreateChunk(DemuxerData* chunk, base::TimeDelta* delay) {
void TestDataFactory::SeekTo(const base::TimeDelta& seek_time) {
regular_pts_ = seek_time;
last_pts_ = base::TimeDelta();
+ eos_reached_ = false;
}
void TestDataFactory::LoadPackets(const char* file_name_template) {
« no previous file with comments | « media/base/android/test_data_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698