*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include <stdlib.h>
if( !b_aseek )
{
- msg_Err( s, "backward seek impossible (access non seekable)" );
+ msg_Err( s, "backward seeking impossible (access not seekable)" );
return VLC_EGENERIC;
}
}
else
{
- /* Read enought data */
+ /* Read enough data */
while( p_sys->block.i_start + p_sys->block.i_size < i_pos )
{
if( AStreamRefillBlock( s ) )
#ifdef STREAM_DEBUG
msg_Dbg( s, "AStreamSeekStream: to "I64Fd" pos="I64Fd
- "tk=%d start="I64Fd" offset=%d end="I64Fd,
+ " tk=%d start="I64Fd" offset=%d end="I64Fd,
i_pos, p_sys->i_pos, p_sys->stream.i_tk,
p_sys->stream.tk[p_sys->stream.i_tk].i_start,
p_sys->stream.i_offset,
if( p_sys->stream.i_used < STREAM_READ_ATONCE / 2 )
{
p_sys->stream.i_used = STREAM_READ_ATONCE / 2 ;
- if( AStreamRefillStream( s ) )
- return VLC_EGENERIC;
+ AStreamRefillStream( s );
}
}
return VLC_SUCCESS;
( (p_access->info.i_title > 1 || p_access->info.i_seekpoint > 1) ?
STREAM_CACHE_PREBUFFER_SIZE : STREAM_CACHE_TRACK_SIZE / 3 );
- msg_Dbg( s, "pre buffering" );
+ msg_Dbg( s, "pre-buffering..." );
i_start = mdate();
for( ;; )
{
i_byterate = ( I64C(1000000) * p_sys->stat.i_bytes ) /
(p_sys->stat.i_read_time+1);
- msg_Dbg( s, "prebuffering done "I64Fd" bytes in "I64Fd"s - "
+ msg_Dbg( s, "pre-buffering done "I64Fd" bytes in "I64Fd"s - "
I64Fd" kbytes/s",
p_sys->stat.i_bytes,
p_sys->stat.i_read_time / I64C(1000000),
/* Open the converter if we need it */
if( psz_encoding != NULL )
{
+ input_thread_t *p_input;
msg_Dbg( s, "%s BOM detected", psz_encoding );
if( s->i_char_width > 1 )
{
{
msg_Err( s, "iconv_open failed" );
}
+ var_Create( s->p_parent->p_parent, "subsdec-encoding", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
+ var_SetString( s->p_parent->p_parent, "subsdec-encoding", "UTF-8" );
+ }
+ p_input = (input_thread_t *)vlc_object_find( s, VLC_OBJECT_INPUT, FIND_PARENT );
+ if( p_input != NULL)
+ {
+ var_Create( p_input, "subsdec-encoding", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
+ var_SetString( p_input, "subsdec-encoding", "UTF-8" );
+ vlc_object_release( p_input );
}
if( psz_encoding ) free( psz_encoding );
}
if( s->i_char_width > 1 )
{
size_t i_in = 0, i_out = 0;
- char * p_in = NULL;
+ const char * p_in = NULL;
char * p_out = NULL;
char * psz_new_line = NULL;
stream_sys_t *p_sys = s->p_sys;
access_t *p_access = p_sys->p_access;
int i_read_orig = i_read;
+ int i_total;
if( !p_sys->i_list )
{
i_read = p_access->pf_read( p_access, p_read, i_read );
+ stats_UpdateInteger( s->p_parent->p_parent , STATS_READ_BYTES, i_read,
+ &i_total );
+ stats_UpdateFloat( s->p_parent->p_parent , STATS_INPUT_BITRATE,
+ (float)i_total, NULL );
+ stats_UpdateInteger( s->p_parent->p_parent , STATS_READ_PACKETS, 1,
+ NULL );
return i_read;
}
return AReadStream( s, p_read, i_read_orig );
}
+ /* Update read bytes in input */
+ stats_UpdateInteger( s->p_parent->p_parent , STATS_READ_BYTES, i_read,
+ &i_total );
+ stats_UpdateFloat( s->p_parent->p_parent , STATS_INPUT_BITRATE,
+ (float)i_total, NULL );
+ stats_UpdateInteger( s->p_parent->p_parent , STATS_READ_PACKETS, 1, NULL );
return i_read;
}
access_t *p_access = p_sys->p_access;
block_t *p_block;
vlc_bool_t b_eof;
+ int i_total;
if( !p_sys->i_list )
{
p_block = p_access->pf_block( p_access );
if( pb_eof ) *pb_eof = p_access->info.b_eof;
+ if( p_block && p_access->p_libvlc->b_stats )
+ {
+ stats_UpdateInteger( s->p_parent->p_parent, STATS_READ_BYTES,
+ p_block->i_buffer, &i_total );
+ stats_UpdateFloat( s->p_parent->p_parent , STATS_INPUT_BITRATE,
+ (float)i_total, NULL );
+ stats_UpdateInteger( s->p_parent->p_parent , STATS_READ_PACKETS, 1, NULL );
+ }
return p_block;
}
/* We have to read some data */
return AReadBlock( s, pb_eof );
}
+ if( p_block )
+ {
+ stats_UpdateInteger( s->p_parent->p_parent, STATS_READ_BYTES,
+ p_block->i_buffer, &i_total );
+ stats_UpdateFloat( s->p_parent->p_parent , STATS_INPUT_BITRATE,
+ (float)i_total, NULL );
+ stats_UpdateInteger( s->p_parent->p_parent , STATS_READ_PACKETS,
+ 1 , NULL);
+ }
return p_block;
}