#include "input_internal.h"
-#undef STREAM_DEBUG
+// #define STREAM_DEBUG 1
/* TODO:
* - tune the 2 methods (block/stream)
vlc_iconv_close( s->p_text->conv );
free( s->p_text );
}
+ free( s->psz_path );
vlc_object_release( s );
}
if( !s )
return NULL;
+ s->psz_path = strdup( p_access->psz_path );
s->p_sys = p_sys = malloc( sizeof( *p_sys ) );
- if( !p_sys )
+ if( !s->psz_path || !s->p_sys )
{
stream_CommonDelete( s );
return NULL;
static int AStreamRefillBlock( stream_t *s )
{
stream_sys_t *p_sys = s->p_sys;
- int64_t i_start, i_stop;
block_t *b;
/* Release data */
}
/* Now read a new block */
- i_start = mdate();
+ const int64_t i_start = mdate();
for( ;; )
{
bool b_eof;
return VLC_EGENERIC;
}
+ p_sys->stat.i_read_time += mdate() - i_start;
while( b )
{
- i_stop = mdate();
-
/* Append the block */
p_sys->block.i_size += b->i_buffer;
*p_sys->block.pp_last = b;
/* Update stat */
p_sys->stat.i_bytes += b->i_buffer;
- p_sys->stat.i_read_time += i_stop - i_start;
p_sys->stat.i_read_count++;
b = b->p_next;
- i_start = mdate();
}
return VLC_SUCCESS;
}