summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authoracolwell@chromium.org <acolwell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-24 07:58:52 +0000
committeracolwell@chromium.org <acolwell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-24 07:58:52 +0000
commit34e4b51c367c86330f011d1803a1c9c0338d4f33 (patch)
tree7793ab46441669b6729e72952d7305acf1a62669 /media
parent4d954397c8ae3cb05535c402c237821c506bf465 (diff)
downloadchromium_src-34e4b51c367c86330f011d1803a1c9c0338d4f33.zip
chromium_src-34e4b51c367c86330f011d1803a1c9c0338d4f33.tar.gz
chromium_src-34e4b51c367c86330f011d1803a1c9c0338d4f33.tar.bz2
Fix various MediaSource related crashes on Android.
This change fixes several issues that were causing crashes. - MediaPlayerHostMsg_DemuxerReady_Params was not initializing the xxx_codec member variables so audio-only or video-only content would randomly be flagged as A/V content with a random codec ID. - ChunkDemuxer::Stop() was not being called which could cause the delegate to be accessed after it was destroyed. - MediaSourceDelegate was signalling that it had metadata before the ChunkDemuxer was even initialized. This caused the HTMLMediaElement to signal that the load completed way too early and caused play() to be called when the delegate wasn't ready. BUG=233420 TEST=webkitmediasource-play.html LayoutTest reliably runs w/o crashing now. Review URL: https://chromiumcodereview.appspot.com/15898002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202019 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r--media/base/android/demuxer_stream_player_params.cc4
-rw-r--r--media/base/android/media_source_player.cc9
2 files changed, 8 insertions, 5 deletions
diff --git a/media/base/android/demuxer_stream_player_params.cc b/media/base/android/demuxer_stream_player_params.cc
index ab9fcaf..3ed1a8c 100644
--- a/media/base/android/demuxer_stream_player_params.cc
+++ b/media/base/android/demuxer_stream_player_params.cc
@@ -8,9 +8,11 @@ namespace media {
MediaPlayerHostMsg_DemuxerReady_Params::
MediaPlayerHostMsg_DemuxerReady_Params()
- : audio_channels(0),
+ : audio_codec(kUnknownAudioCodec),
+ audio_channels(0),
audio_sampling_rate(0),
is_audio_encrypted(false),
+ video_codec(kUnknownVideoCodec),
is_video_encrypted(false),
duration_ms(0) {}
diff --git a/media/base/android/media_source_player.cc b/media/base/android/media_source_player.cc
index b29d182..f6cbd48 100644
--- a/media/base/android/media_source_player.cc
+++ b/media/base/android/media_source_player.cc
@@ -208,7 +208,6 @@ MediaSourcePlayer::MediaSourcePlayer(
waiting_for_audio_data_(false),
waiting_for_video_data_(false),
weak_this_(this) {
- OnMediaMetadataChanged(duration_, width_, height_, false);
}
MediaSourcePlayer::~MediaSourcePlayer() {
@@ -221,9 +220,11 @@ void MediaSourcePlayer::SetVideoSurface(jobject surface) {
return;
}
- video_decoder_job_.reset(new VideoDecoderJob(
- base::MessageLoopProxy::current(), video_codec_,
- gfx::Size(width_, height_), surface));
+ if (HasVideo()) {
+ video_decoder_job_.reset(new VideoDecoderJob(
+ base::MessageLoopProxy::current(), video_codec_,
+ gfx::Size(width_, height_), surface));
+ }
if (pending_play_)
StartInternal();