[vlc-commits] chromecast: don't wait for seek if it failed

Thomas Guillem git at videolan.org
Wed Feb 7 23:45:47 CET 2018


vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Feb  7 13:52:10 2018 +0100| [3a6db5e9b0ae7695109f538bd68ad964ffb08985] | committer: Jean-Baptiste Kempf

chromecast: don't wait for seek if it failed

This happened when seeking on start.

(cherry picked from commit 4f449f4925007f01d749e55bd0c3c82f983734f3)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/stream_out/chromecast/cast.cpp            | 4 +++-
 modules/stream_out/chromecast/chromecast.h        | 2 +-
 modules/stream_out/chromecast/chromecast_ctrl.cpp | 6 ++++--
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/modules/stream_out/chromecast/cast.cpp b/modules/stream_out/chromecast/cast.cpp
index aa322c5b64..8da2170a28 100644
--- a/modules/stream_out/chromecast/cast.cpp
+++ b/modules/stream_out/chromecast/cast.cpp
@@ -494,8 +494,10 @@ static ssize_t AccessWrite(sout_access_out_t *p_access, block_t *p_block)
 
         vlc_fifo_Unlock(p_sys->m_fifo);
         /* TODO: put better timestamp */
-        p_sys->m_intf->requestPlayerSeek(mdate() + INT64_C(1000000));
+        bool success = p_sys->m_intf->requestPlayerSeek(mdate() + INT64_C(1000000));
         vlc_fifo_Lock(p_sys->m_fifo);
+        if (!success)
+            p_sys->m_seeking = false;
     }
 
     bool do_pace = false;
diff --git a/modules/stream_out/chromecast/chromecast.h b/modules/stream_out/chromecast/chromecast.h
index 3a66a0234f..920b679c76 100644
--- a/modules/stream_out/chromecast/chromecast.h
+++ b/modules/stream_out/chromecast/chromecast.h
@@ -168,7 +168,7 @@ struct intf_sys_t
 
     void setHasInput(const std::string mime_type = "");
 
-    void requestPlayerSeek(mtime_t pos);
+    bool requestPlayerSeek(mtime_t pos);
     void setOnSeekDoneCb(on_seek_done_itf on_seek_done, void *on_seek_done_data);
     void setOnPausedChangedCb(on_paused_changed_itf on_paused_changed,
                               void *on_paused_changed_data);
diff --git a/modules/stream_out/chromecast/chromecast_ctrl.cpp b/modules/stream_out/chromecast/chromecast_ctrl.cpp
index 3762853b0e..e78b05f040 100644
--- a/modules/stream_out/chromecast/chromecast_ctrl.cpp
+++ b/modules/stream_out/chromecast/chromecast_ctrl.cpp
@@ -912,13 +912,15 @@ States intf_sys_t::state() const
     return m_state;
 }
 
-void intf_sys_t::requestPlayerSeek(mtime_t pos)
+bool intf_sys_t::requestPlayerSeek(mtime_t pos)
 {
     vlc_mutex_locker locker(&m_lock);
     if( !isStatePlaying() || m_mediaSessionId == 0 )
-        return;
+        return false;
     m_ts_seek = pos;
     queueMessage( Seek );
+
+    return true;
 }
 
 void intf_sys_t::setOnSeekDoneCb(on_seek_done_itf on_seek_done, void *on_seek_done_data)



More information about the vlc-commits mailing list