[vlc-commits] demux: adaptive: add preparsing case
Francois Cartegnie
git at videolan.org
Thu Mar 4 18:27:13 UTC 2021
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Nov 30 20:20:01 2020 +0100| [8450f76040f6ab59f278ca873fa4681088ea4b91] | committer: Francois Cartegnie
demux: adaptive: add preparsing case
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8450f76040f6ab59f278ca873fa4681088ea4b91
---
modules/demux/adaptive/PlaylistManager.cpp | 7 +++++--
modules/demux/adaptive/PlaylistManager.h | 3 ++-
modules/demux/adaptive/adaptive.cpp | 4 ++--
3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/modules/demux/adaptive/PlaylistManager.cpp b/modules/demux/adaptive/PlaylistManager.cpp
index cc5106d013..e38e4d2fd6 100644
--- a/modules/demux/adaptive/PlaylistManager.cpp
+++ b/modules/demux/adaptive/PlaylistManager.cpp
@@ -71,6 +71,7 @@ PlaylistManager::PlaylistManager( demux_t *p_demux_,
b_thread = false;
b_buffering = false;
b_canceled = false;
+ b_preparsing = false;
nextPlaylistupdate = 0;
demux.i_nzpcr = VLC_TICK_INVALID;
demux.i_firstpcr = VLC_TICK_INVALID;
@@ -147,8 +148,10 @@ bool PlaylistManager::setupPeriod()
return true;
}
-bool PlaylistManager::init()
+bool PlaylistManager::init(bool b_preparsing)
{
+ this->b_preparsing = b_preparsing;
+
if(!setupPeriod())
return false;
@@ -162,7 +165,7 @@ bool PlaylistManager::init()
bool PlaylistManager::start()
{
- if(b_thread)
+ if(b_thread || b_preparsing)
return false;
b_thread = !vlc_clone(&thread, managerThread,
diff --git a/modules/demux/adaptive/PlaylistManager.h b/modules/demux/adaptive/PlaylistManager.h
index 5ed5899e28..67a0a837c4 100644
--- a/modules/demux/adaptive/PlaylistManager.h
+++ b/modules/demux/adaptive/PlaylistManager.h
@@ -54,7 +54,7 @@ namespace adaptive
AbstractAdaptationLogic::LogicType type );
virtual ~PlaylistManager ();
- bool init();
+ bool init(bool = false);
bool start();
bool started() const;
void stop();
@@ -151,6 +151,7 @@ namespace adaptive
bool b_buffering;
bool b_canceled;
vlc_tick_t pause_start;
+ bool b_preparsing;
};
}
diff --git a/modules/demux/adaptive/adaptive.cpp b/modules/demux/adaptive/adaptive.cpp
index 53eaff9529..5f72e6129e 100644
--- a/modules/demux/adaptive/adaptive.cpp
+++ b/modules/demux/adaptive/adaptive.cpp
@@ -165,7 +165,7 @@ static int Open(vlc_object_t *p_obj)
{
demux_t *p_demux = (demux_t*) p_obj;
- if(!p_demux->s->psz_url || p_demux->s->b_preparsing)
+ if(!p_demux->s->psz_url)
return VLC_EGENERIC;
std::string mimeType;
@@ -246,7 +246,7 @@ static int Open(vlc_object_t *p_obj)
}
}
- if(!p_manager || !p_manager->init())
+ if(!p_manager || !p_manager->init(p_demux->b_preparsing))
{
delete p_manager;
return VLC_EGENERIC;
More information about the vlc-commits
mailing list