From 4096b0935736f1db9d0438eaa0250cf1fce27e13 Mon Sep 17 00:00:00 2001
From: Pierre d'Herbemont <pdherbemont@videolan.org>
Date: Sun, 6 Jan 2008 12:31:24 +0000
Subject: [PATCH] ccess/ftp.c: Fix ftp pausing. Patch by Andrew Zaikin
 <andrew.zaikin at gmail.com>. Full comment below: I can see that if you are
 watching video over ftp and you are pausing playback for a couple of minutes,
 VLC is unable to resume playback, because corresponding FTP data connection
 is closed (getting "connection reset by peer" error). To solve this issue I
 would propose to seek to the current position when VLC is resuming playback.
 Seek operation in ftp re-open data connection - that is exactly what we need
 here.

---
 modules/access/ftp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/access/ftp.c b/modules/access/ftp.c
index cb7f639fdad6..fd8abeb6ca1d 100644
--- a/modules/access/ftp.c
+++ b/modules/access/ftp.c
@@ -550,7 +550,9 @@ static int Control( access_t *p_access, int i_query, va_list args )
 
         /* */
         case ACCESS_SET_PAUSE_STATE:
-            /* Nothing to do */
+            pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t* );
+            if ( !pb_bool )
+              return Seek( p_access, p_access->info.i_pos );
             break;
 
         case ACCESS_GET_TITLE_INFO:
-- 
GitLab