[vlc-commits] sout: chromecast: fix seek after EOF
Thomas Guillem
git at videolan.org
Fri Jan 18 17:54:00 CET 2019
vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Jan 18 15:22:54 2019 +0100| [0cde951ebc25463b1ecf4e5a751918ffac9186be] | 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).
Signed-off-by: Thomas Guillem <thomas at gllm.fr>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=0cde951ebc25463b1ecf4e5a751918ffac9186be
---
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 c85b3d8db4..673b7c3bf4 100644
--- a/modules/stream_out/chromecast/cast.cpp
+++ b/modules/stream_out/chromecast/cast.cpp
@@ -90,6 +90,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 )
@@ -137,6 +138,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;
@@ -1301,7 +1303,7 @@ static int Send(sout_stream_t *p_stream, sout_stream_id_sys_t *id,
sout_stream_sys_t *p_sys = p_stream->p_sys;
vlc_mutex_locker locker(&p_sys->lock);
- if( p_sys->isFlushing( p_stream ) )
+ if( p_sys->isFlushing( p_stream ) || p_sys->cc_eof )
{
block_Release( p_buffer );
return VLC_SUCCESS;
@@ -1360,7 +1362,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