Commit b78ea82b authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

smooth: remove failure-prone peek callback

parent f6777083
......@@ -60,7 +60,6 @@ vlc_module_begin()
vlc_module_end()
static int Read( stream_t *, void *, unsigned );
static int Peek( stream_t *, const uint8_t **, unsigned );
static int Control( stream_t *, int , va_list );
static bool isSmoothStreaming( stream_t *s )
......@@ -536,7 +535,6 @@ static int Open( vlc_object_t *p_this )
/* */
s->pf_read = Read;
s->pf_peek = Peek;
s->pf_control = Control;
if( vlc_clone( &p_sys->download.thread, sms_Thread, s, VLC_THREAD_PRIORITY_INPUT ) )
......@@ -779,32 +777,6 @@ static int Read( stream_t *s, void *buffer, unsigned i_read )
return length;
}
/* The MP4 demux should never have to to peek outside the current chunk */
static int Peek( stream_t *s, const uint8_t **pp_peek, unsigned i_peek )
{
chunk_t *chunk = get_chunk( s, true, NULL );
if( !chunk || !chunk->data )
{
if(!chunk)
msg_Err( s, "cannot peek: no data" );
else
msg_Err( s, "cannot peek: chunk pos %"PRIu64"", chunk->read_pos );
return 0;
}
int bytes = chunk->size - chunk->read_pos;
assert( bytes > 0 );
if( (unsigned)bytes < i_peek )
{
msg_Err( s, "could not peek %u bytes, only %i!", i_peek, bytes );
}
msg_Dbg( s, "peeking at chunk %"PRIu64, chunk->start_time );
*pp_peek = chunk->data + chunk->read_pos;
return bytes;
}
/* Normaly a stream_filter is not able to provide *time* seeking, since a
* stream_filter operates on a byte stream. Thus, in order to circumvent this
* limitation, I treat a STREAM_SET_POSITION request which value "pos" is less
......
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