Bug 821396 - Fix warnings in DASHDecoder.cpp and DASHRepDecoder.cpp. r=cpearce
authorIordache Catalin <catalinn.iordache@gmail.com>
Sun, 23 Dec 2012 11:19:15 -0500
changeset 126069 ba26ddd4739b881441c72c4472d6be60e6a30707
parent 126068 1035217debb38b90381b131e41b0d9d99e5038c1
child 126070 8a7d18f51175812450a8bd9f3a3dffd1929e68ee
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs821396
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 821396 - Fix warnings in DASHDecoder.cpp and DASHRepDecoder.cpp. r=cpearce
content/media/dash/DASHDecoder.cpp
content/media/dash/DASHRepDecoder.cpp
--- a/content/media/dash/DASHDecoder.cpp
+++ b/content/media/dash/DASHDecoder.cpp
@@ -388,22 +388,22 @@ DASHDecoder::CreateRepDecoders()
 
   // Global settings for the presentation.
   int64_t startTime = mMPDManager->GetStartTime();
   mDuration = mMPDManager->GetDuration();
   NS_ENSURE_TRUE(startTime >= 0 && mDuration > 0, NS_ERROR_ILLEGAL_VALUE);
 
   // For each audio/video stream, create a |ChannelMediaResource| object.
 
-  for (int i = 0; i < mMPDManager->GetNumAdaptationSets(); i++) {
+  for (uint32_t i = 0; i < mMPDManager->GetNumAdaptationSets(); i++) {
     IMPDManager::AdaptationSetType asType = mMPDManager->GetAdaptationSetType(i);
     if (asType == IMPDManager::DASH_VIDEO_STREAM) {
       mVideoAdaptSetIdx = i;
     }
-    for (int j = 0; j < mMPDManager->GetNumRepresentations(i); j++) {
+    for (uint32_t j = 0; j < mMPDManager->GetNumRepresentations(i); j++) {
       // Get URL string.
       nsAutoString segmentUrl;
       nsresult rv = mMPDManager->GetFirstSegmentUrl(i, j, segmentUrl);
       NS_ENSURE_SUCCESS(rv, rv);
 
       // Get segment |nsIURI|; use MPD's base URI in case of relative paths.
       nsCOMPtr<nsIURI> url;
       rv = NS_NewURI(getter_AddRefs(url), segmentUrl, nullptr, mResource->URI());
@@ -699,17 +699,17 @@ DASHDecoder::NotifyDownloadEnded(DASHRep
         IncrementSubsegmentIndex(aRepDecoder);
       } else {
         return;
       }
 
       // Do Stream Switching here before loading next bytes.
       // Audio stream switching not supported.
       if (aRepDecoder == VideoRepDecoder() &&
-          mVideoSubsegmentIdx < VideoRepDecoder()->GetNumDataByteRanges()) {
+          (uint32_t)mVideoSubsegmentIdx < VideoRepDecoder()->GetNumDataByteRanges()) {
         nsresult rv = PossiblySwitchDecoder(aRepDecoder);
         if (NS_FAILED(rv)) {
           LOG("Failed possibly switching decoder rv[0x%x]", rv);
           DecodeError();
           return;
         }
         decoder = VideoRepDecoder();
       }
@@ -956,17 +956,17 @@ DASHDecoder::PossiblySwitchDecoder(DASHR
       toDecoderIdx = betterRepIdx;
     }
   }
 
   NS_ENSURE_TRUE(toDecoderIdx < mVideoRepDecoders.Length(),
                  NS_ERROR_ILLEGAL_VALUE);
 
   // Notify reader and sub decoders and do the switch.
-  if (toDecoderIdx != mVideoRepDecoderIdx) {
+  if (toDecoderIdx != (uint32_t)mVideoRepDecoderIdx) {
     LOG("*** Switching video decoder from [%d] [%p] to [%d] [%p] at "
         "subsegment [%d]", mVideoRepDecoderIdx, VideoRepDecoder(),
         toDecoderIdx, mVideoRepDecoders[toDecoderIdx].get(),
         mVideoSubsegmentIdx);
 
     // Tell main reader to switch subreaders at |subsegmentIdx| - equates to
     // switching data source for reading.
     mDASHReader->RequestVideoReaderSwitch(mVideoRepDecoderIdx, toDecoderIdx,
--- a/content/media/dash/DASHRepDecoder.cpp
+++ b/content/media/dash/DASHRepDecoder.cpp
@@ -316,17 +316,17 @@ DASHRepDecoder::GetByteRangeForSeek(int6
                                     MediaByteRange& aByteRange)
 {
   NS_ASSERTION(NS_IsMainThread(), "Should be on main thread.");
 
   // Only check data ranges if they're available and if this decoder is active,
   // i.e. inactive rep decoders should only load metadata.
   ReentrantMonitorAutoEnter mon(GetReentrantMonitor());
 
-  for (int i = 0; i < mByteRanges.Length(); i++) {
+  for (uint32_t i = 0; i < mByteRanges.Length(); i++) {
     NS_ENSURE_FALSE(mByteRanges[i].IsNull(), NS_ERROR_NOT_INITIALIZED);
     // Check if |aOffset| lies within the current data range.
     if (mByteRanges[i].mStart <= aOffset && aOffset <= mByteRanges[i].mEnd) {
       if (mMainDecoder->IsDecoderAllowedToDownloadSubsegment(this, i)) {
         mCurrentByteRange = aByteRange = mByteRanges[i];
         mSubsegmentIdx = i;
         // XXX Hack: should be setting subsegment outside this function, but
         // need to review seeking for multiple switches anyhow.