[vlc-devel] [PATCH 5/6] demux: adaptive: interrupt connection manager when

Zhao Zhili quinkblack at foxmail.com
Wed Sep 20 05:52:06 CEST 2017


---
  modules/demux/adaptive/PlaylistManager.cpp | 16 ++++++++++++++++
  1 file changed, 16 insertions(+)

diff --git a/modules/demux/adaptive/PlaylistManager.cpp 
b/modules/demux/adaptive/PlaylistManager.cpp
index 96a0a57..fced732 100644
--- a/modules/demux/adaptive/PlaylistManager.cpp
+++ b/modules/demux/adaptive/PlaylistManager.cpp
@@ -179,6 +179,8 @@ void PlaylistManager::stop()
  {
      if(b_thread)
      {
+        if(conManager)
+            conManager->interrupt();
          vlc_cancel(thread);
          vlc_join(thread, NULL);
          b_thread = false;
@@ -452,7 +454,10 @@ int PlaylistManager::doDemux(int64_t increment)
              /* might be end of current period */
              if(currentPeriod)
              {
+                void *data[2] = {NULL, NULL};
+                conManager->interrupt_forward_start(data);
                  setBufferingRunState(false);
+                conManager->interrupt_forward_stop(data);
                  BasePeriod *nextPeriod = 
playlist->getNextPeriod(currentPeriod);
                  if(!nextPeriod)
                      return VLC_DEMUXER_EOF;
@@ -559,12 +564,15 @@ int PlaylistManager::doControl(int i_query, 
va_list args)

          case DEMUX_SET_POSITION:
          {
+            void *data[2] = {NULL, NULL};
+            conManager->interrupt_forward_start(data);
              setBufferingRunState(false); /* stop downloader first */

              const mtime_t i_duration = getDuration();
              if(i_duration == 0) /* == playlist->isLive() */
              {
                  setBufferingRunState(true);
+                conManager->interrupt_forward_stop(data);
                  return VLC_EGENERIC;
              }

@@ -574,20 +582,26 @@ int PlaylistManager::doControl(int i_query, 
va_list args)
              if(!setPosition(time))
              {
                  setBufferingRunState(true);
+                conManager->interrupt_forward_stop(data);
                  return VLC_EGENERIC;
              }

              demux.i_nzpcr = VLC_TS_INVALID;
              setBufferingRunState(true);
+            conManager->interrupt_forward_stop(data);
              break;
          }

          case DEMUX_SET_TIME:
          {
+            void *data[2] = {NULL, NULL};
+            conManager->interrupt_forward_start(data);
              setBufferingRunState(false); /* stop downloader first */
+
              if(playlist->isLive())
              {
                  setBufferingRunState(true);
+                conManager->interrupt_forward_stop(data);
                  return VLC_EGENERIC;
              }

@@ -595,11 +609,13 @@ int PlaylistManager::doControl(int i_query, 
va_list args)
              if(!setPosition(time))
              {
                  setBufferingRunState(true);
+                conManager->interrupt_forward_stop(data);
                  return VLC_EGENERIC;
              }

              demux.i_nzpcr = VLC_TS_INVALID;
              setBufferingRunState(true);
+            conManager->interrupt_forward_stop(data);
              break;
          }

-- 
2.7.4

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-demux-adaptive-interrupt-connection-manager-when-nec.patch
Type: text/x-patch
Size: 3284 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20170920/4491ba96/attachment.bin>


More information about the vlc-devel mailing list