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

Unified Diff: media/filters/chunk_demuxer.cc

Issue 374203003: Invoke the seek callback during abort if needed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | « no previous file | media/filters/chunk_demuxer_unittest.cc » ('j') | media/filters/chunk_demuxer_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/chunk_demuxer.cc
diff --git a/media/filters/chunk_demuxer.cc b/media/filters/chunk_demuxer.cc
index b83199caad504b213f4e10a39c05a2430e630180..657859ab34b6c7463ba5580524a1ff857ab24bdc 100644
--- a/media/filters/chunk_demuxer.cc
+++ b/media/filters/chunk_demuxer.cc
@@ -1304,9 +1304,16 @@ void ChunkDemuxer::Abort(const std::string& id,
base::AutoLock auto_lock(lock_);
DCHECK(!id.empty());
CHECK(IsValidId(id));
+ bool old_waiting_for_data = IsSeekWaitingForData_Locked();
source_state_map_[id]->Abort(append_window_start,
append_window_end,
timestamp_offset);
+ // Abort can possibly emit some buffers.
+ // Need to check whether seeking can be completed.
+ if (old_waiting_for_data && !IsSeekWaitingForData_Locked() &&
+ !seek_cb_.is_null()) {
+ base::ResetAndReturn(&seek_cb_).Run(PIPELINE_OK);
+ }
}
void ChunkDemuxer::Remove(const std::string& id, TimeDelta start,
« no previous file with comments | « no previous file | media/filters/chunk_demuxer_unittest.cc » ('j') | media/filters/chunk_demuxer_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698