summaryrefslogtreecommitdiffstats
path: root/media/base
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-23 14:41:34 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-23 14:41:34 +0000
commit5e18d6ccc3fe668c6d47fbaafa6c603038d0be4c (patch)
treeeb013f8fdaaf4c44259f624a79e1053e89c1f25c /media/base
parent91a3e71461cfd94dbccc6c1e3d223962b43c284f (diff)
downloadchromium_src-5e18d6ccc3fe668c6d47fbaafa6c603038d0be4c.zip
chromium_src-5e18d6ccc3fe668c6d47fbaafa6c603038d0be4c.tar.gz
chromium_src-5e18d6ccc3fe668c6d47fbaafa6c603038d0be4c.tar.bz2
Revert 201791 "Fix various MediaSource related crashes on Android."
> 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/15754004 TBR=acolwell@chromium.org Review URL: https://codereview.chromium.org/15838006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201797 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base')
-rw-r--r--media/base/android/demuxer_stream_player_params.cc4
-rw-r--r--media/base/android/media_source_player.cc9
2 files changed, 5 insertions, 8 deletions
diff --git a/media/base/android/demuxer_stream_player_params.cc b/media/base/android/demuxer_stream_player_params.cc
index 3ed1a8c..ab9fcaf 100644
--- a/media/base/android/demuxer_stream_player_params.cc
+++ b/media/base/android/demuxer_stream_player_params.cc
@@ -8,11 +8,9 @@ namespace media {
MediaPlayerHostMsg_DemuxerReady_Params::
MediaPlayerHostMsg_DemuxerReady_Params()
- : audio_codec(kUnknownAudioCodec),
- audio_channels(0),
+ : 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 f6cbd48..b29d182 100644
--- a/media/base/android/media_source_player.cc
+++ b/media/base/android/media_source_player.cc
@@ -208,6 +208,7 @@ MediaSourcePlayer::MediaSourcePlayer(
waiting_for_audio_data_(false),
waiting_for_video_data_(false),
weak_this_(this) {
+ OnMediaMetadataChanged(duration_, width_, height_, false);
}
MediaSourcePlayer::~MediaSourcePlayer() {
@@ -220,11 +221,9 @@ void MediaSourcePlayer::SetVideoSurface(jobject surface) {
return;
}
- if (HasVideo()) {
- video_decoder_job_.reset(new VideoDecoderJob(
- base::MessageLoopProxy::current(), video_codec_,
- gfx::Size(width_, height_), surface));
- }
+ video_decoder_job_.reset(new VideoDecoderJob(
+ base::MessageLoopProxy::current(), video_codec_,
+ gfx::Size(width_, height_), surface));
if (pending_play_)
StartInternal();