Commit 7b5bff3d authored by Francois Cartegnie's avatar Francois Cartegnie

demux: adaptative: fix unsupported format regression

Due to hls we we waiting for demuxer to start, which would
load the demuxer source (sub playlist then) and from that
file we would have the format and change the demux if
required.

The problem is that any unsupported format (like split subtitles)
is now being to be demuxed and gets probed and demuxed.
parent 7661da70
...@@ -72,6 +72,16 @@ void SegmentTracker::setAdaptationLogic(AbstractAdaptationLogic *logic_) ...@@ -72,6 +72,16 @@ void SegmentTracker::setAdaptationLogic(AbstractAdaptationLogic *logic_)
registerListener(logic); registerListener(logic);
} }
StreamFormat SegmentTracker::initialFormat() const
{
BaseRepresentation *rep = curRepresentation;
if(!rep)
rep = logic->getNextRepresentation(adaptationSet, NULL);
if(rep)
return rep->getStreamFormat();
return StreamFormat();
}
bool SegmentTracker::segmentsListReady() const bool SegmentTracker::segmentsListReady() const
{ {
BaseRepresentation *rep = curRepresentation; BaseRepresentation *rep = curRepresentation;
......
...@@ -95,6 +95,7 @@ namespace adaptative ...@@ -95,6 +95,7 @@ namespace adaptative
~SegmentTracker(); ~SegmentTracker();
void setAdaptationLogic(AbstractAdaptationLogic *); void setAdaptationLogic(AbstractAdaptationLogic *);
StreamFormat initialFormat() const;
bool segmentsListReady() const; bool segmentsListReady() const;
void reset(); void reset();
SegmentChunk* getNextChunk(bool, HTTPConnectionManager *); SegmentChunk* getNextChunk(bool, HTTPConnectionManager *);
......
...@@ -40,6 +40,8 @@ std::string StreamFormat::str() const ...@@ -40,6 +40,8 @@ std::string StreamFormat::str() const
return "Timed Text"; return "Timed Text";
case PACKEDAAC: case PACKEDAAC:
return "Packed AAC"; return "Packed AAC";
case UNSUPPORTED:
return "Unsupported";
default: default:
case UNKNOWN: case UNKNOWN:
return "Unknown"; return "Unknown";
......
...@@ -228,19 +228,23 @@ AbstractStream::status AbstractStream::demux(mtime_t nz_deadline, bool send) ...@@ -228,19 +228,23 @@ AbstractStream::status AbstractStream::demux(mtime_t nz_deadline, bool send)
return AbstractStream::status_dis; return AbstractStream::status_dis;
} }
if(!demuxer && !startDemux()) if(!demuxer)
{ {
/* If demux fails because of probing failure / wrong format*/ format = segmentTracker->initialFormat();
if(discontinuity) if(!startDemux())
{ {
msg_Dbg( p_realdemux, "Flushing on format change" ); /* If demux fails because of probing failure / wrong format*/
prepareFormatChange(); if(discontinuity)
discontinuity = false; {
flushing = true; msg_Dbg( p_realdemux, "Flushing on format change" );
return AbstractStream::status_buffering; prepareFormatChange();
discontinuity = false;
flushing = true;
return AbstractStream::status_buffering;
}
dead = true; /* Prevent further retries */
return AbstractStream::status_eof;
} }
dead = true; /* Prevent further retries */
return AbstractStream::status_eof;
} }
if(nz_deadline + VLC_TS_0 > getBufferingLevel()) /* not already demuxed */ if(nz_deadline + VLC_TS_0 > getBufferingLevel()) /* not already demuxed */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment