[vlc-commits] chromecast: EOF when finished or Error

Thomas Guillem git at videolan.org
Thu Feb 1 11:26:25 CET 2018


vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Jan 29 16:18:06 2018 +0100| [64a07e5f2453ff38d736238d28fe9f48c4fd258b] | committer: Thomas Guillem

chromecast: EOF when finished or Error

Avoid false positives.

(cherry picked from commit 6839ba7a8d600e7fc05723bf2a946e7063fdc570)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=64a07e5f2453ff38d736238d28fe9f48c4fd258b
---

 modules/stream_out/chromecast/chromecast_ctrl.cpp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/modules/stream_out/chromecast/chromecast_ctrl.cpp b/modules/stream_out/chromecast/chromecast_ctrl.cpp
index e059392c9f..1976b51b80 100644
--- a/modules/stream_out/chromecast/chromecast_ctrl.cpp
+++ b/modules/stream_out/chromecast/chromecast_ctrl.cpp
@@ -455,7 +455,11 @@ void intf_sys_t::processMediaMessage( const castchannel::CastMessage& msg )
                 if ( m_state == Buffering )
                     setState( LoadFailed );
                 else
+                {
+                    if (idleReason == "FINISHED")
+                        m_eof = true;
                     setState( Ready );
+                }
             }
         }
         else
@@ -480,7 +484,6 @@ void intf_sys_t::processMediaMessage( const castchannel::CastMessage& msg )
                 {
                     /* TODO reset demux PCR ? */
                     m_time_playback_started = mdate();
-                    m_eof = false;
                     setState( Playing );
                 }
             }
@@ -493,8 +496,6 @@ void intf_sys_t::processMediaMessage( const castchannel::CastMessage& msg )
                      * request more input) but this state is fetched only when
                      * the input has reached EOF. */
 
-                    if( m_state == Playing )
-                        m_eof = true;
                     m_time_playback_started = VLC_TS_INVALID;
                     setState( Buffering );
                 }
@@ -727,7 +728,7 @@ void intf_sys_t::waitSeekDone()
 bool intf_sys_t::isFinishedPlaying()
 {
     vlc_mutex_locker locker(&m_lock);
-    return m_state == Ready || m_state == LoadFailed || m_state == Dead || m_eof;
+    return m_state == LoadFailed || m_state == Dead || m_eof;
 }
 
 void intf_sys_t::setTitle(const char* psz_title)



More information about the vlc-commits mailing list