Bug 853325 - Improve buffered time ranges accuracy with the GStreamer media backend r=doublec

This commit is contained in:
Alessandro Decina 2013-04-11 20:46:47 +12:00
parent 38fc3c583a
commit c0db923166

View File

@ -711,12 +711,15 @@ int64_t GStreamerReader::QueryDuration()
}
}
/*if (mDecoder->mDuration != -1 &&
mDecoder->mDuration > duration) {
// We decoded more than the reported duration (which could be estimated)
LOG(PR_LOG_DEBUG, ("mDuration > duration"));
duration = mDecoder->mDuration;
}*/
{
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
int64_t media_duration = mDecoder->GetMediaDuration();
if (media_duration != -1 && media_duration > duration) {
// We decoded more than the reported duration (which could be estimated)
LOG(PR_LOG_DEBUG, ("decoded duration > estimated duration"));
duration = media_duration;
}
}
return duration;
}