[vlc-commits] sout: chromecast: fix seek after EOF
Thomas Guillem
git at videolan.org
Fri Jan 18 15:29:07 CET 2019
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Jan 18 15:22:54 2019 +0100| [04e3a46cf918ec1d56cd9ab401d3a90f73f14e51] | committer: Thomas Guillem
sout: chromecast: fix seek after EOF
On EOF, the sout can receive one last block, the drained one. In that case,
GetSubId() will fail since the sout chain is already stopped (in order to
drain). The decoder_t error state was set to true in that case, and next flush
calls were ignored.
Yes, this is an other hack and the chromecast is always dropping the last
drained buffer (it was already the case before). For the moment, I can't find a
proper solution without modyfing heavily the demux filter API (so no 3.0
backport).
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=04e3a46cf918ec1d56cd9ab401d3a90f73f14e51
---
modules/stream_out/chromecast/cast.cpp | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/modules/stream_out/chromecast/cast.cpp b/modules/stream_out/chromecast/cast.cpp
index 2837e2e361..99b0a51132 100644
--- a/modules/stream_out/chromecast/cast.cpp
+++ b/modules/stream_out/chromecast/cast.cpp
@@ -100,6 +100,7 @@ struct sout_stream_sys_t
, cc_has_input( false )
, cc_reload( false )
, cc_flushing( false )
+ , cc_eof( false )
, has_video( false )
, out_force_reload( false )
, perf_warning_shown( false )
@@ -147,6 +148,7 @@ struct sout_stream_sys_t
bool cc_has_input;
bool cc_reload;
bool cc_flushing;
+ bool cc_eof;
bool has_video;
bool out_force_reload;
bool perf_warning_shown;
@@ -1143,7 +1145,7 @@ static int Send(sout_stream_t *p_stream, void *_id, block_t *p_buffer)
sout_stream_id_sys_t *id = reinterpret_cast<sout_stream_id_sys_t *>( _id );
vlc_mutex_locker locker(&p_sys->lock);
- if( p_sys->isFlushing( p_stream ) )
+ if( p_sys->isFlushing( p_stream ) || p_sys->cc_eof )
{
block_ChainRelease( p_buffer );
return VLC_SUCCESS;
@@ -1203,7 +1205,8 @@ static void on_input_event_cb(void *data, enum cc_input_event event, union cc_in
/* In case of EOF: stop the sout chain in order to drain all
* sout/demuxers/access. If EOF changes to false, reset es_changed
* in order to reload the sout from next Send calls. */
- if( arg.eof )
+ p_sys->cc_eof = arg.eof;
+ if( p_sys->cc_eof )
p_sys->stopSoutChain( p_stream );
else
p_sys->out_force_reload = p_sys->es_changed = true;
More information about the vlc-commits
mailing list