Commit 23d44ceb authored by Francois Cartegnie's avatar Francois Cartegnie

demux: adaptative: handle end of period

parent cccdd7e3
...@@ -157,6 +157,14 @@ Stream::status PlaylistManager::demux(mtime_t nzdeadline, bool send) ...@@ -157,6 +157,14 @@ Stream::status PlaylistManager::demux(mtime_t nzdeadline, bool send)
} }
} }
/* might be end of current period */
if(i_return == Stream::status_eof && currentPeriod)
{
unsetPeriod();
currentPeriod = playlist->getNextPeriod(currentPeriod);
i_return = (setupPeriod()) ? Stream::status_eop : Stream::status_eof;
}
return i_return; return i_return;
} }
......
...@@ -77,7 +77,7 @@ namespace adaptative ...@@ -77,7 +77,7 @@ namespace adaptative
bool isSelected() const; bool isSelected() const;
bool reactivate(mtime_t); bool reactivate(mtime_t);
bool isDisabled() const; bool isDisabled() const;
typedef enum {status_eof, status_buffering, status_demuxed} status; typedef enum {status_eof, status_eop, status_buffering, status_demuxed} status;
status demux(HTTPConnectionManager *, mtime_t, bool); status demux(HTTPConnectionManager *, mtime_t, bool);
bool setPosition(mtime_t, bool); bool setPosition(mtime_t, bool);
mtime_t getPosition() const; mtime_t getPosition() const;
......
...@@ -197,12 +197,17 @@ static int Demux(demux_t *p_demux) ...@@ -197,12 +197,17 @@ static int Demux(demux_t *p_demux)
Stream::status status = Stream::status status =
p_sys->p_dashManager->demux(p_sys->i_nzpcr + DEMUX_INCREMENT, true); p_sys->p_dashManager->demux(p_sys->i_nzpcr + DEMUX_INCREMENT, true);
switch(status) switch(status)
{ {
case Stream::status_eof: case Stream::status_eof:
return VLC_DEMUXER_EOF; return VLC_DEMUXER_EOF;
case Stream::status_buffering: case Stream::status_buffering:
break; break;
case Stream::status_eop:
p_sys->i_nzpcr = VLC_TS_INVALID;
es_out_Control(p_demux->out, ES_OUT_RESET_PCR);
break;
case Stream::status_demuxed: case Stream::status_demuxed:
if( p_sys->i_nzpcr != VLC_TS_INVALID ) if( p_sys->i_nzpcr != VLC_TS_INVALID )
{ {
......
...@@ -241,6 +241,10 @@ static int Demux(demux_t *p_demux) ...@@ -241,6 +241,10 @@ static int Demux(demux_t *p_demux)
return VLC_DEMUXER_EOF; return VLC_DEMUXER_EOF;
case Stream::status_buffering: case Stream::status_buffering:
break; break;
case Stream::status_eop:
p_sys->i_nzpcr = VLC_TS_INVALID;
es_out_Control(p_demux->out, ES_OUT_RESET_PCR);
break;
case Stream::status_demuxed: case Stream::status_demuxed:
if( p_sys->i_nzpcr != VLC_TS_INVALID ) if( p_sys->i_nzpcr != VLC_TS_INVALID )
{ {
......
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