]> git.sesse.net Git - vlc/commitdiff
stream_filter: dash: evaluate correctly live stream
authorFrancois Cartegnie <fcvlcdev@free.fr>
Wed, 10 Dec 2014 13:47:02 +0000 (14:47 +0100)
committerFrancois Cartegnie <fcvlcdev@free.fr>
Thu, 18 Dec 2014 20:23:50 +0000 (21:23 +0100)
Live profile can be replayed as static after broadcast.

modules/stream_filter/dash/mpd/BasicCMParser.cpp
modules/stream_filter/dash/mpd/IsoffMainParser.cpp
modules/stream_filter/dash/mpd/MPD.cpp
modules/stream_filter/dash/mpd/MPD.h

index f18058534a50cc6fce00899740b225e89fc27521..18284122f7890d5f34a97551f98170c9388c56b8 100644 (file)
@@ -71,7 +71,7 @@ bool    BasicCMParser::parse                (Profile profile)
         Standard specifies a default of "On-Demand",
         so anything that is not "Live" is "On-Demand"
     */
-    this->mpd->setLive( it != attr.end() && it->second == "Live" );
+
     it = attr.find( "availabilityStartTime" );
     if ( it == attr.end() && this->mpd->isLive() == true )
     {
index 4f751a24e04eeed575eac0253af5c420b0a4ffa7..fe8f98a6091611a1004b0b1e3366e27d94fa536b 100644 (file)
@@ -67,6 +67,9 @@ void    IsoffMainParser::setMPDAttributes   ()
     if(it != attr.end())
         this->mpd->setMinBufferTime(str_duration( it->second.c_str()));
 
+    it = attr.find("type");
+    if(it != attr.end())
+        mpd->setType(it->second);
 }
 
 void    IsoffMainParser::setAdaptationSets  (Node *periodNode, Period *period)
index 80d7f29335d4a64fec959d39c1214fe9c8a9a36b..12befa34efb64b6be7309d7abbad46618235be9b 100644 (file)
@@ -35,7 +35,6 @@ MPD::MPD (stream_t *stream_, Profile profile_) :
     ICanonicalUrl(),
     stream(stream_),
     profile( profile_ ),
-    live( false ),
     availabilityStartTime( -1 ),
     availabilityEndTime( -1 ),
     duration( -1 ),
@@ -126,12 +125,18 @@ void                    MPD::setProgramInformation  (ProgramInformation *progInf
 
 bool                    MPD::isLive() const
 {
-    return this->live;
+    if(type.empty())
+    {
+        Profile live(Profile::ISOLive);
+        return profile == live;
+    }
+    else
+        return (type != "static");
 }
 
-void                    MPD::setLive( bool live )
+void MPD::setType(const std::string &type_)
 {
-    this->live = live;
+    type = type_;
 }
 
 time_t MPD::getAvailabilityStartTime() const
index e3e04dc4747d766302fdeadff33c2eacb2c13be5..b9f961b84688c3a5ca661e6f0b31d22e2c863469 100644 (file)
@@ -47,11 +47,11 @@ namespace dash
 
                 Profile                         getProfile() const;
                 bool                            isLive() const;
-                void                            setLive( bool live );
                 time_t                          getAvailabilityStartTime() const;
                 void                            setAvailabilityStartTime( time_t time );
                 time_t                          getAvailabilityEndTime() const;
                 void                            setAvailabilityEndTime( time_t time );
+                void                            setType(const std::string &);
                 time_t                          getDuration() const;
                 void                            setDuration( time_t duration );
                 time_t                          getMinUpdatePeriod() const;
@@ -76,7 +76,6 @@ namespace dash
             private:
                 stream_t                           *stream;
                 Profile                             profile;
-                bool                                live;
                 time_t                              availabilityStartTime;
                 time_t                              availabilityEndTime;
                 time_t                              duration;
@@ -86,6 +85,7 @@ namespace dash
                 std::vector<Period *>               periods;
                 std::vector<BaseUrl *>              baseUrls;
                 ProgramInformation                  *programInfo;
+                std::string                         type;
         };
     }
 }