diff --git a/content/media/gstreamer/GStreamerReader.cpp b/content/media/gstreamer/GStreamerReader.cpp index b64ef9daefc4..df908bc853d8 100644 --- a/content/media/gstreamer/GStreamerReader.cpp +++ b/content/media/gstreamer/GStreamerReader.cpp @@ -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; }