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

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

Issue 50433007: Allow simultaneous audio and video config change (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address acolwell's comment from PS2 Created 7 years, 1 month 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/media_source_player.h ('k') | media/base/android/media_source_player_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/android/media_source_player.cc
diff --git a/media/base/android/media_source_player.cc b/media/base/android/media_source_player.cc
index da4b55f47ed3d40cc5b2ee1494a34df58886217d..478fbe5e11877fed68e5ed16eb2ac8082fc5603d 100644
--- a/media/base/android/media_source_player.cc
+++ b/media/base/android/media_source_player.cc
@@ -655,7 +655,16 @@ void MediaSourcePlayer::DecodeMoreAudio() {
// Failed to start the next decode.
// Wait for demuxer ready message.
+ DCHECK(!reconfig_audio_decoder_);
reconfig_audio_decoder_ = true;
+
+ // Config change may have just been detected on the other stream. If so,
+ // don't send a duplicate demuxer config request.
+ if (IsEventPending(CONFIG_CHANGE_EVENT_PENDING)) {
+ DCHECK(reconfig_video_decoder_);
xhwang 2013/11/04 21:55:48 hmm, isn't this always true given line 659? Or are
wolenetz 2013/11/04 22:00:55 This DCHECK is to ensure that the CONFIG_CHANGE_EV
xhwang1 2013/11/05 02:30:21 Oh, I didn't realize it's "video", not "audio". So
+ return;
+ }
+
SetPendingEvent(CONFIG_CHANGE_EVENT_PENDING);
ProcessPendingEvents();
}
@@ -675,12 +684,21 @@ void MediaSourcePlayer::DecodeMoreVideo() {
// Failed to start the next decode.
// Wait for demuxer ready message.
- reconfig_video_decoder_ = true;
// After this detection of video config change, next video data received
// will begin with I-frame.
next_video_data_is_iframe_ = true;
+ DCHECK(!reconfig_video_decoder_);
+ reconfig_video_decoder_ = true;
+
+ // Config change may have just been detected on the other stream. If so,
+ // don't send a duplicate demuxer config request.
+ if (IsEventPending(CONFIG_CHANGE_EVENT_PENDING)) {
+ DCHECK(reconfig_audio_decoder_);
+ return;
+ }
+
SetPendingEvent(CONFIG_CHANGE_EVENT_PENDING);
ProcessPendingEvents();
}
« no previous file with comments | « media/base/android/media_source_player.h ('k') | media/base/android/media_source_player_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698