Bug 938512 - HTMLMediaElement does not fire loadedmetadata. r=sworkman

This commit is contained in:
Ethan Tseng 2013-11-26 17:25:40 +08:00
Родитель a7eedb66a5
Коммит b53b5b0d01
2 изменённых файлов: 21 добавлений и 0 удалений

Просмотреть файл

@ -421,6 +421,18 @@ bool OmxDecoder::TryLoad() {
// read audio metadata
if (mAudioSource.get()) {
// For RTSP, we don't read the audio source for now.
// The metadata of RTSP will be obtained through SDP at connection time.
if (mResource->GetRtspPointer()) {
sp<MetaData> meta = mAudioSource->getFormat();
if (!meta->findInt32(kKeyChannelCount, &mAudioChannels) ||
!meta->findInt32(kKeySampleRate, &mAudioSampleRate)) {
NS_WARNING("Couldn't get audio metadata from OMX decoder");
return false;
}
return true;
}
// To reliably get the channel and sample rate data we need to read from the
// audio source until we get a INFO_FORMAT_CHANGE status
status_t err = mAudioSource->read(&mAudioBuffer);

Просмотреть файл

@ -62,6 +62,15 @@ public:
return NS_OK;
}
// Override FindStartTime() to return null pointer.
// For Rtsp, we don't have the first video frame in DECODING_METADATA state.
// It will be available until player request Play() and media decoder enters
// DECODING state.
virtual VideoData* FindStartTime(int64_t& aOutStartTime)
MOZ_FINAL MOZ_OVERRIDE {
return nullptr;
}
private:
// A pointer to RtspMediaResource for calling the Rtsp specific function.
// The lifetime of mRtspResource is controlled by MediaDecoder. MediaDecoder