[vlc-commits] demux: adaptive: set EsOut stream priority

Francois Cartegnie git at videolan.org
Fri May 17 20:35:00 CEST 2019


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed May 15 15:50:27 2019 +0200| [271b64aba1d456a45edabae3c51dc49fc1fac0ef] | committer: Francois Cartegnie

demux: adaptive: set EsOut stream priority

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

 modules/demux/adaptive/SegmentTracker.cpp | 5 +++++
 modules/demux/adaptive/SegmentTracker.hpp | 2 ++
 modules/demux/adaptive/Streams.cpp        | 5 +++++
 3 files changed, 12 insertions(+)

diff --git a/modules/demux/adaptive/SegmentTracker.cpp b/modules/demux/adaptive/SegmentTracker.cpp
index be7554aee1..8b2ab7c79e 100644
--- a/modules/demux/adaptive/SegmentTracker.cpp
+++ b/modules/demux/adaptive/SegmentTracker.cpp
@@ -117,6 +117,11 @@ StreamFormat SegmentTracker::getCurrentFormat() const
     return StreamFormat();
 }
 
+const Role & SegmentTracker::getStreamRole() const
+{
+    return adaptationSet->getRole();
+}
+
 bool SegmentTracker::segmentsListReady() const
 {
     BaseRepresentation *rep = curRepresentation;
diff --git a/modules/demux/adaptive/SegmentTracker.hpp b/modules/demux/adaptive/SegmentTracker.hpp
index 03dafa2e53..925b265e28 100644
--- a/modules/demux/adaptive/SegmentTracker.hpp
+++ b/modules/demux/adaptive/SegmentTracker.hpp
@@ -21,6 +21,7 @@
 #define SEGMENTTRACKER_HPP
 
 #include "StreamFormat.hpp"
+#include "playlist/Role.hpp"
 
 #include <vlc_common.h>
 #include <list>
@@ -118,6 +119,7 @@ namespace adaptive
             ~SegmentTracker();
 
             StreamFormat getCurrentFormat() const;
+            const Role & getStreamRole() const;
             bool segmentsListReady() const;
             void reset();
             SegmentChunk* getNextChunk(bool, AbstractConnectionManager *);
diff --git a/modules/demux/adaptive/Streams.cpp b/modules/demux/adaptive/Streams.cpp
index dda8c101f6..bcc1f6aa96 100644
--- a/modules/demux/adaptive/Streams.cpp
+++ b/modules/demux/adaptive/Streams.cpp
@@ -79,6 +79,11 @@ bool AbstractStream::init(const StreamFormat &format_, SegmentTracker *tracker,
                 {
                     /* All successfull */
                     fakeesout->setExtraInfoProvider( this );
+                    const Role & streamRole = tracker->getStreamRole();
+                    if(streamRole.isDefault() && streamRole.autoSelectable())
+                        fakeesout->setPriority(ES_PRIORITY_MIN + 10);
+                    else if(!streamRole.autoSelectable())
+                        fakeesout->setPriority(ES_PRIORITY_NOT_DEFAULTABLE);
                     format = format_;
                     segmentTracker = tracker;
                     segmentTracker->registerListener(this);



More information about the vlc-commits mailing list