Commit 7656b3b4 authored by Francois Cartegnie's avatar Francois Cartegnie

stream_filter: smooth: allow pausing

parent d99bf09b
...@@ -604,6 +604,7 @@ void* sms_Thread( void *p_this ) ...@@ -604,6 +604,7 @@ void* sms_Thread( void *p_this )
* the n+1^th advertised audio chunk or vice versa */ * the n+1^th advertised audio chunk or vice versa */
uint64_t start_time = 0, lead = 0; uint64_t start_time = 0, lead = 0;
int64_t i_pts_delay;
for( int i = 0; i < 3; i++ ) for( int i = 0; i < 3; i++ )
{ {
...@@ -634,7 +635,13 @@ void* sms_Thread( void *p_this ) ...@@ -634,7 +635,13 @@ void* sms_Thread( void *p_this )
lead = get_lead( s ); lead = get_lead( s );
while( lead > 10 * p_sys->timescale + start_time || NO_MORE_CHUNKS ) if ( stream_Control( s, STREAM_GET_PTS_DELAY, &i_pts_delay ) != VLC_SUCCESS ||
i_pts_delay < 1 )
{
i_pts_delay = 10 * p_sys->timescale + start_time;
}
while( lead > (uint64_t) i_pts_delay || NO_MORE_CHUNKS )
{ {
vlc_cond_wait( &p_sys->download.wait, &p_sys->download.lock_wait ); vlc_cond_wait( &p_sys->download.wait, &p_sys->download.lock_wait );
lead = get_lead( s ); lead = get_lead( s );
......
...@@ -773,9 +773,9 @@ static int Control( stream_t *s, int i_query, va_list args ) ...@@ -773,9 +773,9 @@ static int Control( stream_t *s, int i_query, va_list args )
*(va_arg( args, bool * )) = true; *(va_arg( args, bool * )) = true;
break; break;
case STREAM_CAN_FASTSEEK: case STREAM_CAN_FASTSEEK:
case STREAM_CAN_PAUSE: /* TODO */
*(va_arg( args, bool * )) = false; *(va_arg( args, bool * )) = false;
break; break;
case STREAM_CAN_PAUSE: /* TODO */
case STREAM_CAN_CONTROL_PACE: case STREAM_CAN_CONTROL_PACE:
*(va_arg( args, bool * )) = !p_sys->b_live; *(va_arg( args, bool * )) = !p_sys->b_live;
break; break;
...@@ -798,6 +798,9 @@ static int Control( stream_t *s, int i_query, va_list args ) ...@@ -798,6 +798,9 @@ static int Control( stream_t *s, int i_query, va_list args )
*va_arg (args, int64_t *) = INT64_C(1000) * *va_arg (args, int64_t *) = INT64_C(1000) *
var_InheritInteger(s, "network-caching"); var_InheritInteger(s, "network-caching");
break; break;
case STREAM_SET_PAUSE_STATE:
return (p_sys->b_live) ? VLC_EGENERIC : VLC_SUCCESS;
break;
default: default:
return VLC_EGENERIC; return VLC_EGENERIC;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment