[vlc-commits] demux: adaptive: pass and handle priority in FakeESOut
Francois Cartegnie
git at videolan.org
Mon Mar 30 16:15:36 CEST 2020
vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed May 15 15:49:50 2019 +0200| [e9fdcdcc1beef61d99a7785c3842c6223204aab1] | committer: Francois Cartegnie
demux: adaptive: pass and handle priority in FakeESOut
(cherry picked from commit f3d0962319fb69c721d0feaa5efe0470001eaadd)
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=e9fdcdcc1beef61d99a7785c3842c6223204aab1
---
modules/demux/adaptive/plumbing/FakeESOut.cpp | 18 ++++++++++++++++--
modules/demux/adaptive/plumbing/FakeESOut.hpp | 2 ++
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/modules/demux/adaptive/plumbing/FakeESOut.cpp b/modules/demux/adaptive/plumbing/FakeESOut.cpp
index a74eb765be..dba993f81a 100644
--- a/modules/demux/adaptive/plumbing/FakeESOut.cpp
+++ b/modules/demux/adaptive/plumbing/FakeESOut.cpp
@@ -67,6 +67,7 @@ FakeESOut::FakeESOut( es_out_t *es, CommandsQueue *queue )
fakeesout->pf_destroy = esOutDestroy_Callback;
fakeesout->pf_send = esOutSend_Callback;
fakeesout->p_sys = (es_out_sys_t*) this;
+ priority = ES_PRIORITY_SELECTABLE_MIN;
vlc_mutex_init(&lock);
}
@@ -122,6 +123,8 @@ FakeESOutID * FakeESOut::createNewID( const es_format_t *p_fmt )
fmtcopy.i_group = 0; /* Always ignore group for adaptive */
fmtcopy.i_id = -1;
+ fmtcopy.i_priority = priority;
+
if( extrainfo )
extrainfo->fillExtraFMTInfo( &fmtcopy );
@@ -162,14 +165,25 @@ void FakeESOut::createOrRecycleRealEsID( FakeESOutID *es_id )
if( !realid )
{
- realid = es_out_Add( real_es_out, es_id->getFmt() );
- if( b_select )
+ es_format_t fmt;
+ es_format_Copy( &fmt, es_id->getFmt() );
+ if( b_preexisting && !b_select ) /* was not previously selected on other format */
+ fmt.i_priority = ES_PRIORITY_NOT_DEFAULTABLE;
+ else
+ fmt.i_priority = priority;//ES_PRIORITY_SELECTABLE_MIN;
+ realid = es_out_Add( real_es_out, &fmt );
+ if( b_preexisting && b_select ) /* was previously selected on other format */
es_out_Control( real_es_out, ES_OUT_SET_ES, realid );
}
es_id->setRealESID( realid );
}
+void FakeESOut::setPriority(int p)
+{
+ priority = p;
+}
+
mtime_t FakeESOut::getTimestampOffset() const
{
mtime_t time = timestamps_offset;
diff --git a/modules/demux/adaptive/plumbing/FakeESOut.hpp b/modules/demux/adaptive/plumbing/FakeESOut.hpp
index b6d812c445..1106c936c6 100644
--- a/modules/demux/adaptive/plumbing/FakeESOut.hpp
+++ b/modules/demux/adaptive/plumbing/FakeESOut.hpp
@@ -65,6 +65,7 @@ namespace adaptive
/* Used by FakeES ID */
void recycle( FakeESOutID *id );
void createOrRecycleRealEsID( FakeESOutID * );
+ void setPriority(int);
/**/
void schedulePCRReset();
@@ -91,6 +92,7 @@ namespace adaptive
mtime_t timestamps_offset;
mtime_t timestamps_expected;
bool timestamps_check_done;
+ int priority;
std::list<FakeESOutID *> fakeesidlist;
std::list<FakeESOutID *> recycle_candidates;
};
More information about the vlc-commits
mailing list