[vlc-commits] dash: removing useless loop

Hugo Beauzée-Luyssen git at videolan.org
Thu Feb 2 14:40:25 CET 2012


vlc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Wed Feb  1 11:08:23 2012 +0100| [f9d613c5131b21cedb7af906a9db39e74a23093e] | committer: Hugo Beauzée-Luyssen

dash: removing useless loop

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

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

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



More information about the vlc-commits mailing list