Bug 1314529. Part 2 - remove MediaDecoder::SetMediaSeekable().
MozReview-Commit-ID: 6JJrKi3KTll
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -777,17 +777,17 @@ MediaDecoder::MetadataLoaded(nsAutoPtr<M
{
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(!IsShutdown());
DECODER_LOG("MetadataLoaded, channels=%u rate=%u hasAudio=%d hasVideo=%d",
aInfo->mAudio.mChannels, aInfo->mAudio.mRate,
aInfo->HasAudio(), aInfo->HasVideo());
- SetMediaSeekable(aInfo->mMediaSeekable);
+ mMediaSeekable = aInfo->mMediaSeekable;
SetMediaSeekableOnlyInBufferedRanges(aInfo->mMediaSeekableOnlyInBufferedRanges);
mInfo = aInfo.forget();
ConstructMediaTracks();
// Make sure the element and the frame (if any) are told about
// our new size.
if (aEventVisibility != MediaDecoderEventVisibility::Suppressed) {
mFiredMetadataLoaded = true;
@@ -1275,22 +1275,16 @@ MediaDecoder::UpdateEstimatedMediaDurati
mozilla::Abs(mEstimatedDuration.Ref().ref().ToMicroseconds() - aDuration) < ESTIMATED_DURATION_FUZZ_FACTOR_USECS) {
return;
}
mEstimatedDuration = Some(TimeUnit::FromMicroseconds(aDuration));
}
void
-MediaDecoder::SetMediaSeekable(bool aMediaSeekable) {
- MOZ_ASSERT(NS_IsMainThread());
- mMediaSeekable = aMediaSeekable;
-}
-
-void
MediaDecoder::SetMediaSeekableOnlyInBufferedRanges(bool aMediaSeekableOnlyInBufferedRanges){
MOZ_ASSERT(NS_IsMainThread());
mMediaSeekableOnlyInBufferedRanges = aMediaSeekableOnlyInBufferedRanges;
}
bool
MediaDecoder::IsTransportSeekable()
{
--- a/dom/media/MediaDecoder.h
+++ b/dom/media/MediaDecoder.h
@@ -246,18 +246,16 @@ protected:
// instability is expected; if the incoming duration is not significantly
// different from the existing duration, the change request is ignored.
// If the incoming duration is significantly different, the duration is
// changed, this causes a durationchanged event to fire to the media
// element.
void UpdateEstimatedMediaDuration(int64_t aDuration) override;
public:
- // Set a flag indicating whether random seeking is supported
- void SetMediaSeekable(bool aMediaSeekable);
// Set a flag indicating whether seeking is supported only in buffered ranges
void SetMediaSeekableOnlyInBufferedRanges(bool aMediaSeekableOnlyInBufferedRanges);
// Returns true if this media supports random seeking. False for example with
// chained ogg files.
bool IsMediaSeekable();
// Returns true if this media supports seeking only in buffered ranges. True
// for example in WebMs with no cues
@@ -567,17 +565,17 @@ private:
void OnPlaybackEvent(MediaEventType aEvent);
void OnPlaybackErrorEvent(const MediaResult& aError);
void OnDecoderDoctorEvent(DecoderDoctorEvent aEvent);
void OnMediaNotSeekable()
{
- SetMediaSeekable(false);
+ mMediaSeekable = false;
}
void FinishShutdown();
void ConnectMirrors(MediaDecoderStateMachine* aObject);
void DisconnectMirrors();
MediaEventProducer<void> mDataArrivedEvent;