[vlc-commits] dash: RateBasedAdaptationLogic: Removing useless loop.

Hugo Beauzée-Luyssen git at videolan.org
Thu Nov 24 18:14:56 CET 2011


vlc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Thu Nov 24 16:33:20 2011 +0100| [1f72229677fa80f9af594c984afc9e32ea917d6e] | committer: Rémi Denis-Courmont

dash: RateBasedAdaptationLogic: Removing useless loop.

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1f72229677fa80f9af594c984afc9e32ea917d6e
---

 .../adaptationlogic/RateBasedAdaptationLogic.cpp   |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.cpp b/modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.cpp
index 498c7df..03a3f8e 100644
--- a/modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.cpp
+++ b/modules/stream_filter/dash/adaptationlogic/RateBasedAdaptationLogic.cpp
@@ -67,15 +67,12 @@ Chunk*  RateBasedAdaptationLogic::getNextChunk () throw(EOFException)
         return this->getNextChunk();
     }
 
-    for(size_t i = 0; i < segments.size(); i++)
+    if ( segments.size() > this->count )
     {
-        if(i == this->count)
-        {
-            this->count++;
-            Chunk *chunk = new Chunk();
-            chunk->setUrl(segments.at(i)->getSourceUrl());
-            return chunk;
-        }
+        Chunk *chunk = new Chunk;
+        chunk->setUrl( segments.at( this->count )->getSourceUrl() );
+        this->count++;
+        return chunk;
     }
     return NULL;
 }



More information about the vlc-commits mailing list