[vlc-commits] demux: adaptive: fix regression with unknown/probed formats
Francois Cartegnie
git at videolan.org
Mon Feb 17 19:26:06 CET 2020
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Feb 17 17:38:34 2020 +0100| [4616f0780fa1f630b70fabd2dfc1190a4b415901] | committer: Francois Cartegnie
demux: adaptive: fix regression with unknown/probed formats
For HLS, format is now probed in demux when unknown, but it
can still change before the demuxer starts due to getMimeType
ref #24237
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4616f0780fa1f630b70fabd2dfc1190a4b415901
---
modules/demux/adaptive/SegmentTracker.cpp | 7 +++++++
modules/demux/adaptive/Streams.cpp | 2 +-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/modules/demux/adaptive/SegmentTracker.cpp b/modules/demux/adaptive/SegmentTracker.cpp
index 583d977681..f896c5fc18 100644
--- a/modules/demux/adaptive/SegmentTracker.cpp
+++ b/modules/demux/adaptive/SegmentTracker.cpp
@@ -233,6 +233,13 @@ SegmentChunk * SegmentTracker::getNextChunk(bool switch_allowed,
return NULL; /* Force current demux to end */
}
}
+ else if(format == StreamFormat(StreamFormat::UNKNOWN) && prevRep && prevRep != rep)
+ {
+ /* Handle the corner case when only the demuxer can know the format and
+ * demuxer starts after the format change (Probe != buffering) */
+ notify(SegmentTrackerEvent(&format)); /* Notify new demux format */
+ return NULL; /* Force current demux to end */
+ }
if(format == StreamFormat(StreamFormat::UNSUPPORTED))
{
diff --git a/modules/demux/adaptive/Streams.cpp b/modules/demux/adaptive/Streams.cpp
index 0ccaec35b4..c4119da5d8 100644
--- a/modules/demux/adaptive/Streams.cpp
+++ b/modules/demux/adaptive/Streams.cpp
@@ -637,7 +637,7 @@ void AbstractStream::trackerEvent(const SegmentTrackerEvent &event)
case SegmentTrackerEvent::FORMATCHANGE:
/* Check if our current demux is still valid */
- if(*event.u.format.f != format)
+ if(*event.u.format.f != format || format == StreamFormat(StreamFormat::UNKNOWN))
{
/* Format has changed between segments, we need to drain and change demux */
msg_Info(p_realdemux, "Changing stream format %s -> %s",
More information about the vlc-commits
mailing list