[vlc-commits] demux: adaptive: evaluate unknown demux restart condition on switch event

Francois Cartegnie git at videolan.org
Tue Mar 2 23:44:58 UTC 2021


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Feb 26 17:55:55 2021 +0100| [854f425603c01dc2aaf124420104a21f561e594d] | committer: Francois Cartegnie

demux: adaptive: evaluate unknown demux restart condition on switch event

Format change needs a restart, but when demuxer has been probed, we
only need to handle restart/reprobing when switching variants.

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

 modules/demux/adaptive/Streams.cpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/demux/adaptive/Streams.cpp b/modules/demux/adaptive/Streams.cpp
index 51d48524d5..88dcb3b929 100644
--- a/modules/demux/adaptive/Streams.cpp
+++ b/modules/demux/adaptive/Streams.cpp
@@ -665,15 +665,13 @@ void AbstractStream::trackerEvent(const TrackerEvent &ev)
             const FormatChangedEvent &event =
                     static_cast<const FormatChangedEvent &>(ev);
             /* Check if our current demux is still valid */
-            if(*event.format != format || format == StreamFormat(StreamFormat::UNKNOWN))
+            if(*event.format != format)
             {
                 /* Format has changed between segments, we need to drain and change demux */
                 msg_Info(p_realdemux, "Changing stream format %s -> %s",
                          format.str().c_str(), event.format->str().c_str());
                 format = *event.format;
-
-                /* This is an implict discontinuity */
-                discontinuity = true;
+                needrestart = true;
             }
         }
             break;
@@ -682,9 +680,11 @@ void AbstractStream::trackerEvent(const TrackerEvent &ev)
         {
             const RepresentationSwitchEvent &event =
                     static_cast<const RepresentationSwitchEvent &>(ev);
-            if(demuxer && !inrestart)
+            if(demuxer && !inrestart && event.prev)
             {
                 if(!demuxer->bitstreamSwitchCompatible() ||
+                   /* HLS variants can move from TS to Raw AAC */
+                   format == StreamFormat(StreamFormat::UNKNOWN) ||
                    (event.next &&
                    !event.next->getAdaptationSet()->isBitSwitchable()))
                     needrestart = true;



More information about the vlc-commits mailing list