>From ae6325554fdead7c7d4189c40b725ccf13c5e51c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tobias=20G=C3=BCntner?= <fatbull@web.de>
Date: Sun, 6 Mar 2011 12:03:50 +0100
Subject: [PATCH] Enable timeshift for some HTTP streams.

---
 modules/access/http.c        |    4 ++++
 src/input/es_out_timeshift.c |    6 +++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/modules/access/http.c b/modules/access/http.c
index 926435d..3b28282 100644
--- a/modules/access/http.c
+++ b/modules/access/http.c
@@ -1065,6 +1065,10 @@ static int Control( access_t *p_access, int i_query, va_list args )
             *pb_bool = false;
             break;
         case ACCESS_CAN_PAUSE:
+            pb_bool = va_arg( args, bool* );
+            /* If the length is unknown, this is probably a live stream. */
+            *pb_bool = p_sys->b_has_size;
+            break;
         case ACCESS_CAN_CONTROL_PACE:
             pb_bool = (bool*)va_arg( args, bool* );
 
diff --git a/src/input/es_out_timeshift.c b/src/input/es_out_timeshift.c
index b83d720..2ad0e52 100644
--- a/src/input/es_out_timeshift.c
+++ b/src/input/es_out_timeshift.c
@@ -463,7 +463,7 @@ static int ControlLockedGetWakeup( es_out_t *p_out, mtime_t *pi_wakeup )
 
     if( p_sys->b_delayed )
     {
-        assert( !p_sys->p_input->p->b_can_pace_control );
+        assert( !p_sys->p_input->p->b_can_pace_control || !p_sys->p_input->p->b_can_pause );
         *pi_wakeup = 0;
     }
     else
@@ -496,7 +496,7 @@ static int ControlLockedSetPauseState( es_out_t *p_out, bool b_source_paused, bo
     else
     {
         i_ret = VLC_EGENERIC;
-        if( !p_sys->p_input->p->b_can_pace_control )
+        if( !p_sys->p_input->p->b_can_pace_control || !p_sys->p_input->p->b_can_pause )
         {
             if( !p_sys->b_delayed )
                 TsStart( p_out );
@@ -531,7 +531,7 @@ static int ControlLockedSetRate( es_out_t *p_out, int i_src_rate, int i_rate )
     else
     {
         i_ret = VLC_EGENERIC;
-        if( !p_sys->p_input->p->b_can_pace_control )
+        if( !p_sys->p_input->p->b_can_pace_control || !p_sys->p_input->p->b_can_pause )
         {
             if( !p_sys->b_delayed )
                 TsStart( p_out );
-- 
1.6.5.1.1367.gcd48

