Chromium Code Reviews| 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 8e23a91629331fc6f8df18098a23ee69d37915d2..822b86d898315a240a53b16c222a3b0c08e6963e 100644 |
| --- a/media/base/android/media_source_player.cc |
| +++ b/media/base/android/media_source_player.cc |
| @@ -603,14 +603,14 @@ void MediaSourcePlayer::MediaDecoderCallback( |
| } |
| if (is_audio) { |
| - DecodeMoreAudio(); |
| + DecodeMoreAudio(false); |
| return; |
| } |
| - DecodeMoreVideo(); |
| + DecodeMoreVideo(false); |
| } |
| -void MediaSourcePlayer::DecodeMoreAudio() { |
| +void MediaSourcePlayer::DecodeMoreAudio(bool video_change_already_pending) { |
| DVLOG(1) << __FUNCTION__; |
| DCHECK(!audio_decoder_job_->is_decoding()); |
| @@ -625,12 +625,19 @@ void MediaSourcePlayer::DecodeMoreAudio() { |
| // Failed to start the next decode. |
| // Wait for demuxer ready message. |
| + DCHECK(!reconfig_audio_decoder_); |
| reconfig_audio_decoder_ = true; |
| + if (video_change_already_pending) { |
|
acolwell GONE FROM CHROMIUM
2013/11/04 18:42:07
I don't think the xxx_change_already_pending param
wolenetz
2013/11/04 19:30:25
Done. Thank you for the rapid CR :)
|
| + DCHECK(reconfig_video_decoder_ && |
| + IsEventPending(CONFIG_CHANGE_EVENT_PENDING)); |
| + return; |
| + } |
| + |
| SetPendingEvent(CONFIG_CHANGE_EVENT_PENDING); |
| ProcessPendingEvents(); |
| } |
| -void MediaSourcePlayer::DecodeMoreVideo() { |
| +void MediaSourcePlayer::DecodeMoreVideo(bool audio_change_already_pending) { |
| DVLOG(1) << __FUNCTION__; |
| DCHECK(!video_decoder_job_->is_decoding()); |
| @@ -645,12 +652,19 @@ 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; |
| + if (audio_change_already_pending) { |
| + DCHECK(reconfig_audio_decoder_ && |
| + IsEventPending(CONFIG_CHANGE_EVENT_PENDING)); |
| + return; |
| + } |
| + |
| SetPendingEvent(CONFIG_CHANGE_EVENT_PENDING); |
| ProcessPendingEvents(); |
| } |
| @@ -850,9 +864,9 @@ void MediaSourcePlayer::OnPrefetchDone() { |
| clock_.Play(); |
| if (audio_decoder_job_) |
| - DecodeMoreAudio(); |
| + DecodeMoreAudio(false); |
| if (video_decoder_job_) |
| - DecodeMoreVideo(); |
| + DecodeMoreVideo(IsEventPending(CONFIG_CHANGE_EVENT_PENDING)); |
| } |
| const char* MediaSourcePlayer::GetEventName(PendingEventFlags event) { |