Commit 470b47fe authored by Clément Stenac's avatar Clément Stenac

String fixes in src (Refs:#438)

parent 4dfd839a
...@@ -166,14 +166,14 @@ int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input ) ...@@ -166,14 +166,14 @@ int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input )
if( psz_parser == NULL || !*psz_parser ) if( psz_parser == NULL || !*psz_parser )
continue; continue;
while( psz_parser && *psz_parser ) while( psz_parser && *psz_parser )
{ {
aout_filter_t * p_filter = NULL; aout_filter_t * p_filter = NULL;
if( p_input->i_nb_filters >= AOUT_MAX_FILTERS ) if( p_input->i_nb_filters >= AOUT_MAX_FILTERS )
{ {
msg_Dbg( p_aout, "max filter reached (%d)", AOUT_MAX_FILTERS ); msg_Dbg( p_aout, "max filters reached (%d)", AOUT_MAX_FILTERS );
break; break;
} }
...@@ -210,7 +210,7 @@ int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input ) ...@@ -210,7 +210,7 @@ int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input )
sizeof(audio_sample_format_t) ); sizeof(audio_sample_format_t) );
memcpy( &p_filter->output, &chain_output_format, memcpy( &p_filter->output, &chain_output_format,
sizeof(audio_sample_format_t) ); sizeof(audio_sample_format_t) );
p_filter->p_module = module_Need( p_filter, "visualization", p_filter->p_module = module_Need( p_filter, "visualization",
psz_parser, VLC_TRUE ); psz_parser, VLC_TRUE );
} }
...@@ -235,7 +235,8 @@ int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input ) ...@@ -235,7 +235,8 @@ int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input )
{ {
aout_FormatPrepare( &p_filter->input ); aout_FormatPrepare( &p_filter->input );
aout_FormatPrepare( &p_filter->output ); aout_FormatPrepare( &p_filter->output );
p_filter->p_module = module_Need( p_filter, "audio filter", p_filter->p_module = module_Need( p_filter,
"audio filter",
psz_parser, VLC_TRUE ); psz_parser, VLC_TRUE );
} }
/* try visual filters */ /* try visual filters */
...@@ -245,7 +246,8 @@ int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input ) ...@@ -245,7 +246,8 @@ int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input )
sizeof(audio_sample_format_t) ); sizeof(audio_sample_format_t) );
memcpy( &p_filter->output, &chain_output_format, memcpy( &p_filter->output, &chain_output_format,
sizeof(audio_sample_format_t) ); sizeof(audio_sample_format_t) );
p_filter->p_module = module_Need( p_filter, "visualization", p_filter->p_module = module_Need( p_filter,
"visualization",
psz_parser, VLC_TRUE ); psz_parser, VLC_TRUE );
} }
} }
...@@ -460,8 +462,8 @@ int aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input, ...@@ -460,8 +462,8 @@ int aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input,
mdate() - p_buffer->start_date ); mdate() - p_buffer->start_date );
if( p_input->p_input_thread ) if( p_input->p_input_thread )
{ {
stats_UpdateInteger( p_input->p_input_thread, STATS_LOST_ABUFFERS, 1, stats_UpdateInteger( p_input->p_input_thread, STATS_LOST_ABUFFERS,
NULL ); 1, NULL );
} }
aout_BufferFree( p_buffer ); aout_BufferFree( p_buffer );
p_input->i_resampling_type = AOUT_RESAMPLING_NONE; p_input->i_resampling_type = AOUT_RESAMPLING_NONE;
...@@ -502,8 +504,8 @@ int aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input, ...@@ -502,8 +504,8 @@ int aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input,
aout_BufferFree( p_buffer ); aout_BufferFree( p_buffer );
if( p_input->p_input_thread ) if( p_input->p_input_thread )
{ {
stats_UpdateInteger( p_input->p_input_thread, STATS_LOST_ABUFFERS, 1, stats_UpdateInteger( p_input->p_input_thread, STATS_LOST_ABUFFERS,
NULL ); 1, NULL );
} }
return 0; return 0;
} }
......
...@@ -158,7 +158,8 @@ int __aout_VolumeUp( vlc_object_t * p_object, int i_nb_steps, ...@@ -158,7 +158,8 @@ int __aout_VolumeUp( vlc_object_t * p_object, int i_nb_steps,
} }
config_PutInt( p_object, "volume", i_volume ); config_PutInt( p_object, "volume", i_volume );
var_Create( p_object->p_libvlc, "saved-volume", VLC_VAR_INTEGER ); var_Create( p_object->p_libvlc, "saved-volume", VLC_VAR_INTEGER );
var_SetInteger( p_object->p_libvlc, "saved-volume" , (audio_volume_t) i_volume ); var_SetInteger( p_object->p_libvlc, "saved-volume" ,
(audio_volume_t) i_volume );
if ( pi_volume != NULL ) *pi_volume = (audio_volume_t) i_volume; if ( pi_volume != NULL ) *pi_volume = (audio_volume_t) i_volume;
if ( p_aout == NULL ) return 0; if ( p_aout == NULL ) return 0;
...@@ -166,7 +167,8 @@ int __aout_VolumeUp( vlc_object_t * p_object, int i_nb_steps, ...@@ -166,7 +167,8 @@ int __aout_VolumeUp( vlc_object_t * p_object, int i_nb_steps,
vlc_mutex_lock( &p_aout->mixer_lock ); vlc_mutex_lock( &p_aout->mixer_lock );
if ( !p_aout->mixer.b_error ) if ( !p_aout->mixer.b_error )
{ {
i_result = p_aout->output.pf_volume_set( p_aout, (audio_volume_t) i_volume ); i_result = p_aout->output.pf_volume_set( p_aout,
(audio_volume_t) i_volume );
} }
vlc_mutex_unlock( &p_aout->mixer_lock ); vlc_mutex_unlock( &p_aout->mixer_lock );
......
...@@ -46,7 +46,7 @@ int aout_MixerNew( aout_instance_t * p_aout ) ...@@ -46,7 +46,7 @@ int aout_MixerNew( aout_instance_t * p_aout )
p_aout->mixer.p_module = module_Need( p_aout, "audio mixer", NULL, 0 ); p_aout->mixer.p_module = module_Need( p_aout, "audio mixer", NULL, 0 );
if ( p_aout->mixer.p_module == NULL ) if ( p_aout->mixer.p_module == NULL )
{ {
msg_Err( p_aout, "no suitable aout mixer" ); msg_Err( p_aout, "no suitable audio mixer" );
return -1; return -1;
} }
p_aout->mixer.b_error = 0; p_aout->mixer.b_error = 0;
......
...@@ -57,7 +57,7 @@ int aout_OutputNew( aout_instance_t * p_aout, ...@@ -57,7 +57,7 @@ int aout_OutputNew( aout_instance_t * p_aout,
p_aout->output.p_module = module_Need( p_aout, "audio output", "$aout", 0); p_aout->output.p_module = module_Need( p_aout, "audio output", "$aout", 0);
if ( p_aout->output.p_module == NULL ) if ( p_aout->output.p_module == NULL )
{ {
msg_Err( p_aout, "no suitable aout module" ); msg_Err( p_aout, "no suitable audio output module" );
vlc_mutex_unlock( &p_aout->output_fifo_lock ); vlc_mutex_unlock( &p_aout->output_fifo_lock );
return -1; return -1;
} }
...@@ -195,7 +195,7 @@ int aout_OutputNew( aout_instance_t * p_aout, ...@@ -195,7 +195,7 @@ int aout_OutputNew( aout_instance_t * p_aout,
&p_aout->mixer.mixer, &p_aout->mixer.mixer,
&p_aout->output.output ) < 0 ) &p_aout->output.output ) < 0 )
{ {
msg_Err( p_aout, "couldn't set an output pipeline" ); msg_Err( p_aout, "couldn't create audio output pipeline" );
module_Unneed( p_aout, p_aout->output.p_module ); module_Unneed( p_aout, p_aout->output.p_module );
return -1; return -1;
} }
......
...@@ -97,7 +97,7 @@ mediacontrol_snapshot( mediacontrol_Instance *self, ...@@ -97,7 +97,7 @@ mediacontrol_snapshot( mediacontrol_Instance *self,
{ {
p_pic = _mediacontrol_createRGBPicture( p_snapshot->i_width, p_pic = _mediacontrol_createRGBPicture( p_snapshot->i_width,
p_snapshot->i_height, p_snapshot->i_height,
VLC_FOURCC( 'p','n','g',' ' ), VLC_FOURCC( 'p','n','g',' ' ),
p_snapshot->date, p_snapshot->date,
p_snapshot->p_data, p_snapshot->p_data,
p_snapshot->i_datasize ); p_snapshot->i_datasize );
...@@ -199,10 +199,11 @@ mediacontrol_display_text( mediacontrol_Instance *self, ...@@ -199,10 +199,11 @@ mediacontrol_display_text( mediacontrol_Instance *self,
mtime_t i_duration = 0; mtime_t i_duration = 0;
mtime_t i_now = mdate(); mtime_t i_now = mdate();
i_duration = 1000 * mediacontrol_unit_convert( self->p_playlist->p_input, i_duration = 1000 * mediacontrol_unit_convert(
end->key, self->p_playlist->p_input,
mediacontrol_MediaTime, end->key,
end->value ); mediacontrol_MediaTime,
end->value );
mediacontrol_showtext( p_vout, DEFAULT_CHAN, psz_message, NULL, mediacontrol_showtext( p_vout, DEFAULT_CHAN, psz_message, NULL,
OSD_ALIGN_BOTTOM | OSD_ALIGN_LEFT, 0, 0, OSD_ALIGN_BOTTOM | OSD_ALIGN_LEFT, 0, 0,
...@@ -225,11 +226,11 @@ mediacontrol_display_text( mediacontrol_Instance *self, ...@@ -225,11 +226,11 @@ mediacontrol_display_text( mediacontrol_Instance *self,
i_now = mdate(); i_now = mdate();
i_debut = mediacontrol_position2microsecond( p_input, i_debut = mediacontrol_position2microsecond( p_input,
( mediacontrol_Position* ) begin ); ( mediacontrol_Position* ) begin );
i_debut += i_now; i_debut += i_now;
i_fin = mediacontrol_position2microsecond( p_input, i_fin = mediacontrol_position2microsecond( p_input,
( mediacontrol_Position * ) end ); ( mediacontrol_Position * ) end );
i_fin += i_now; i_fin += i_now;
vout_ShowTextAbsolute( p_vout, DEFAULT_CHAN, psz_message, NULL, vout_ShowTextAbsolute( p_vout, DEFAULT_CHAN, psz_message, NULL,
......
...@@ -123,7 +123,8 @@ mediacontrol_get_media_position( mediacontrol_Instance *self, ...@@ -123,7 +123,8 @@ mediacontrol_get_media_position( mediacontrol_Instance *self,
if( an_origin != mediacontrol_AbsolutePosition ) if( an_origin != mediacontrol_AbsolutePosition )
{ {
/* Relative or ModuloPosition make no sense */ /* Relative or ModuloPosition make no sense */
RAISE( mediacontrol_PositionOriginNotSupported, "Only absolute position is valid." ); RAISE( mediacontrol_PositionOriginNotSupported,
"Only absolute position is valid." );
return NULL; return NULL;
} }
...@@ -364,7 +365,8 @@ mediacontrol_get_stream_information( mediacontrol_Instance *self, ...@@ -364,7 +365,8 @@ mediacontrol_get_stream_information( mediacontrol_Instance *self,
input_thread_t *p_input = self->p_playlist->p_input; input_thread_t *p_input = self->p_playlist->p_input;
vlc_value_t val; vlc_value_t val;
retval = ( mediacontrol_StreamInformation* )malloc( sizeof( mediacontrol_StreamInformation ) ); retval = ( mediacontrol_StreamInformation* )
malloc( sizeof( mediacontrol_StreamInformation ) );
if( ! retval ) if( ! retval )
{ {
RAISE( mediacontrol_InternalException, "Out of memory" ); RAISE( mediacontrol_InternalException, "Out of memory" );
...@@ -410,11 +412,11 @@ mediacontrol_get_stream_information( mediacontrol_Instance *self, ...@@ -410,11 +412,11 @@ mediacontrol_get_stream_information( mediacontrol_Instance *self,
retval->length = val.i_time / 1000; retval->length = val.i_time / 1000;
retval->position = mediacontrol_unit_convert( p_input, retval->position = mediacontrol_unit_convert( p_input,
mediacontrol_MediaTime, a_key, mediacontrol_MediaTime, a_key,
retval->position ); retval->position );
retval->length = mediacontrol_unit_convert( p_input, retval->length = mediacontrol_unit_convert( p_input,
mediacontrol_MediaTime, a_key, mediacontrol_MediaTime, a_key,
retval->length ); retval->length );
} }
return retval; return retval;
} }
...@@ -96,7 +96,8 @@ vlc_int64_t mediacontrol_unit_convert( input_thread_t *p_input, ...@@ -96,7 +96,8 @@ vlc_int64_t mediacontrol_unit_convert( input_thread_t *p_input,
{ {
double f_fps; double f_fps;
if( demux2_Control( p_input->input.p_demux, DEMUX_GET_FPS, &f_fps ) || f_fps < 0.1 ) if( demux2_Control( p_input->input.p_demux, DEMUX_GET_FPS, &f_fps ) ||
f_fps < 0.1 )
return 0; return 0;
if( to == mediacontrol_ByteCount ) if( to == mediacontrol_ByteCount )
......
...@@ -896,7 +896,7 @@ int __vlc_execve( vlc_object_t *p_object, int i_argc, char **ppsz_argv, ...@@ -896,7 +896,7 @@ int __vlc_execve( vlc_object_t *p_object, int i_argc, char **ppsz_argv,
tv.tv_sec = 0; tv.tv_sec = 0;
tv.tv_usec = 10000; tv.tv_usec = 10000;
i_ret = select( pi_stdin[0] > pi_stdout[0] ? pi_stdin[0] + 1 : i_ret = select( pi_stdin[0] > pi_stdout[0] ? pi_stdin[0] + 1 :
pi_stdout[0] + 1, &readfds, &writefds, NULL, &tv ); pi_stdout[0] + 1, &readfds, &writefds, NULL, &tv );
if ( i_ret > 0 ) if ( i_ret > 0 )
...@@ -958,10 +958,10 @@ int __vlc_execve( vlc_object_t *p_object, int i_argc, char **ppsz_argv, ...@@ -958,10 +958,10 @@ int __vlc_execve( vlc_object_t *p_object, int i_argc, char **ppsz_argv,
} }
#elif defined( WIN32 ) && !defined( UNDER_CE ) #elif defined( WIN32 ) && !defined( UNDER_CE )
SECURITY_ATTRIBUTES saAttr; SECURITY_ATTRIBUTES saAttr;
PROCESS_INFORMATION piProcInfo; PROCESS_INFORMATION piProcInfo;
STARTUPINFO siStartInfo; STARTUPINFO siStartInfo;
BOOL bFuncRetn = FALSE; BOOL bFuncRetn = FALSE;
HANDLE hChildStdinRd, hChildStdinWr, hChildStdoutRd, hChildStdoutWr; HANDLE hChildStdinRd, hChildStdinWr, hChildStdoutRd, hChildStdoutWr;
DWORD i_status; DWORD i_status;
char *psz_cmd, *p_env, *p; char *psz_cmd, *p_env, *p;
...@@ -969,14 +969,14 @@ int __vlc_execve( vlc_object_t *p_object, int i_argc, char **ppsz_argv, ...@@ -969,14 +969,14 @@ int __vlc_execve( vlc_object_t *p_object, int i_argc, char **ppsz_argv,
int i_size; int i_size;
/* Set the bInheritHandle flag so pipe handles are inherited. */ /* Set the bInheritHandle flag so pipe handles are inherited. */
saAttr.nLength = sizeof(SECURITY_ATTRIBUTES); saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
saAttr.bInheritHandle = TRUE; saAttr.bInheritHandle = TRUE;
saAttr.lpSecurityDescriptor = NULL; saAttr.lpSecurityDescriptor = NULL;
/* Create a pipe for the child process's STDOUT. */ /* Create a pipe for the child process's STDOUT. */
if ( !CreatePipe( &hChildStdoutRd, &hChildStdoutWr, &saAttr, 0 ) ) if ( !CreatePipe( &hChildStdoutRd, &hChildStdoutWr, &saAttr, 0 ) )
{ {
msg_Err( p_object, "stdout pipe creation failed" ); msg_Err( p_object, "stdout pipe creation failed" );
return -1; return -1;
} }
...@@ -984,9 +984,9 @@ int __vlc_execve( vlc_object_t *p_object, int i_argc, char **ppsz_argv, ...@@ -984,9 +984,9 @@ int __vlc_execve( vlc_object_t *p_object, int i_argc, char **ppsz_argv,
SetHandleInformation( hChildStdoutRd, HANDLE_FLAG_INHERIT, 0 ); SetHandleInformation( hChildStdoutRd, HANDLE_FLAG_INHERIT, 0 );
/* Create a pipe for the child process's STDIN. */ /* Create a pipe for the child process's STDIN. */
if ( !CreatePipe( &hChildStdinRd, &hChildStdinWr, &saAttr, 0 ) ) if ( !CreatePipe( &hChildStdinRd, &hChildStdinWr, &saAttr, 0 ) )
{ {
msg_Err( p_object, "stdin pipe creation failed" ); msg_Err( p_object, "stdin pipe creation failed" );
return -1; return -1;
} }
...@@ -995,10 +995,10 @@ int __vlc_execve( vlc_object_t *p_object, int i_argc, char **ppsz_argv, ...@@ -995,10 +995,10 @@ int __vlc_execve( vlc_object_t *p_object, int i_argc, char **ppsz_argv,
/* Set up members of the PROCESS_INFORMATION structure. */ /* Set up members of the PROCESS_INFORMATION structure. */
ZeroMemory( &piProcInfo, sizeof(PROCESS_INFORMATION) ); ZeroMemory( &piProcInfo, sizeof(PROCESS_INFORMATION) );
/* Set up members of the STARTUPINFO structure. */ /* Set up members of the STARTUPINFO structure. */
ZeroMemory( &siStartInfo, sizeof(STARTUPINFO) ); ZeroMemory( &siStartInfo, sizeof(STARTUPINFO) );
siStartInfo.cb = sizeof(STARTUPINFO); siStartInfo.cb = sizeof(STARTUPINFO);
siStartInfo.hStdError = hChildStdoutWr; siStartInfo.hStdError = hChildStdoutWr;
siStartInfo.hStdOutput = hChildStdoutWr; siStartInfo.hStdOutput = hChildStdoutWr;
siStartInfo.hStdInput = hChildStdinRd; siStartInfo.hStdInput = hChildStdinRd;
...@@ -1045,25 +1045,25 @@ int __vlc_execve( vlc_object_t *p_object, int i_argc, char **ppsz_argv, ...@@ -1045,25 +1045,25 @@ int __vlc_execve( vlc_object_t *p_object, int i_argc, char **ppsz_argv,
ppsz_parser++; ppsz_parser++;
} }
*p = '\0'; *p = '\0';
/* Create the child process. */ /* Create the child process. */
bFuncRetn = CreateProcess( NULL, bFuncRetn = CreateProcess( NULL,
psz_cmd, // command line psz_cmd, // command line
NULL, // process security attributes NULL, // process security attributes
NULL, // primary thread security attributes NULL, // primary thread security attributes
TRUE, // handles are inherited TRUE, // handles are inherited
0, // creation flags 0, // creation flags
p_env, p_env,
psz_cwd, psz_cwd,
&siStartInfo, // STARTUPINFO pointer &siStartInfo, // STARTUPINFO pointer
&piProcInfo ); // receives PROCESS_INFORMATION &piProcInfo ); // receives PROCESS_INFORMATION
free( psz_cmd ); free( psz_cmd );
free( p_env ); free( p_env );
if ( bFuncRetn == 0 ) if ( bFuncRetn == 0 )
{ {
msg_Err( p_object, "child creation failed" ); msg_Err( p_object, "child creation failed" );
return -1; return -1;
} }
...@@ -1083,7 +1083,7 @@ int __vlc_execve( vlc_object_t *p_object, int i_argc, char **ppsz_argv, ...@@ -1083,7 +1083,7 @@ int __vlc_execve( vlc_object_t *p_object, int i_argc, char **ppsz_argv,
/* Close the write end of the pipe before reading from the /* Close the write end of the pipe before reading from the
* read end of the pipe. */ * read end of the pipe. */
CloseHandle(hChildStdoutWr); CloseHandle(hChildStdoutWr);
/* Read output from the child process. */ /* Read output from the child process. */
*pi_data = 0; *pi_data = 0;
*pp_data = malloc( 1025 ); /* +1 for \0 */ *pp_data = malloc( 1025 ); /* +1 for \0 */
...@@ -1091,10 +1091,10 @@ int __vlc_execve( vlc_object_t *p_object, int i_argc, char **ppsz_argv, ...@@ -1091,10 +1091,10 @@ int __vlc_execve( vlc_object_t *p_object, int i_argc, char **ppsz_argv,
while ( !p_object->b_die ) while ( !p_object->b_die )
{ {
DWORD i_read; DWORD i_read;
if ( !ReadFile( hChildStdoutRd, &(*pp_data)[*pi_data], 1024, &i_read, if ( !ReadFile( hChildStdoutRd, &(*pp_data)[*pi_data], 1024, &i_read,
NULL ) NULL )
|| i_read == 0 ) || i_read == 0 )
break; break;
*pi_data += i_read; *pi_data += i_read;
*pp_data = realloc( *pp_data, *pi_data + 1025 ); *pp_data = realloc( *pp_data, *pi_data + 1025 );
} }
......
...@@ -533,7 +533,8 @@ static void NotifyPlaylist( input_thread_t *p_input ) ...@@ -533,7 +533,8 @@ static void NotifyPlaylist( input_thread_t *p_input )
FIND_PARENT ); FIND_PARENT );
if( p_playlist ) if( p_playlist )
{ {
var_SetInteger( p_playlist, "item-change", p_input->input.p_item->i_id ); var_SetInteger( p_playlist, "item-change",
p_input->input.p_item->i_id );
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
} }
} }
......
...@@ -943,15 +943,15 @@ static picture_t *vout_new_buffer( decoder_t *p_dec ) ...@@ -943,15 +943,15 @@ static picture_t *vout_new_buffer( decoder_t *p_dec )
var_CreateGetBool( p_dec, "hdtv-fix" ) ) var_CreateGetBool( p_dec, "hdtv-fix" ) )
{ {
p_dec->fmt_out.video.i_visible_height = 1080; p_dec->fmt_out.video.i_visible_height = 1080;
p_dec->fmt_out.video.i_sar_num *= 135; p_dec->fmt_out.video.i_sar_num *= 135;
p_dec->fmt_out.video.i_sar_den *= 136; p_dec->fmt_out.video.i_sar_den *= 136;
msg_Warn( p_dec, "Fixing broken HDTV stream (display_height=1088)"); msg_Warn( p_dec, "Fixing broken HDTV stream (display_height=1088)");
} }
if( !p_dec->fmt_out.video.i_sar_num || if( !p_dec->fmt_out.video.i_sar_num ||
!p_dec->fmt_out.video.i_sar_den ) !p_dec->fmt_out.video.i_sar_den )
{ {
p_dec->fmt_out.video.i_sar_num = p_dec->fmt_out.video.i_aspect * p_dec->fmt_out.video.i_sar_num = p_dec->fmt_out.video.i_aspect *
p_dec->fmt_out.video.i_visible_height; p_dec->fmt_out.video.i_visible_height;
p_dec->fmt_out.video.i_sar_den = VOUT_ASPECT_FACTOR * p_dec->fmt_out.video.i_sar_den = VOUT_ASPECT_FACTOR *
......
...@@ -75,9 +75,10 @@ demux_t *__demux2_New( vlc_object_t *p_obj, ...@@ -75,9 +75,10 @@ demux_t *__demux2_New( vlc_object_t *p_obj,
if( s && *psz_module == '\0' && strrchr( p_demux->psz_path, '.' ) ) if( s && *psz_module == '\0' && strrchr( p_demux->psz_path, '.' ) )
{ {
/* XXX: add only file without any problem here and with strong detection. /* XXX: add only file without any problem here and with strong detection.
* - no .mp3, .a52, ... (aac is added as it works only by file ext anyway * - no .mp3, .a52, ... (aac is added as it works only by file ext
* - wav can't be added 'cause of a52 and dts in them as raw audio * anyway
* - wav can't be added 'cause of a52 and dts in them as raw audio
*/ */
static struct { char *ext; char *demux; } exttodemux[] = static struct { char *ext; char *demux; } exttodemux[] =
{ {
...@@ -99,7 +100,7 @@ demux_t *__demux2_New( vlc_object_t *p_obj, ...@@ -99,7 +100,7 @@ demux_t *__demux2_New( vlc_object_t *p_obj,
{ NULL, NULL }, { NULL, NULL },
}; };
/* Here, we don't mind if it does not work, it must be quick */ /* Here, we don't mind if it does not work, it must be quick */
static struct { char *ext; char *demux; } exttodemux_quick[] = static struct { char *ext; char *demux; } exttodemux_quick[] =
{ {
{ "mp3", "mpga" }, { "mp3", "mpga" },
{ "ogg", "ogg" }, { "ogg", "ogg" },
......
...@@ -179,7 +179,7 @@ es_out_t *input_EsOutNew( input_thread_t *p_input ) ...@@ -179,7 +179,7 @@ es_out_t *input_EsOutNew( input_thread_t *p_input )
if( p_sys->ppsz_audio_language ) if( p_sys->ppsz_audio_language )
{ {
for( i = 0; p_sys->ppsz_audio_language[i]; i++ ) for( i = 0; p_sys->ppsz_audio_language[i]; i++ )
msg_Dbg( p_input, "select audio in language[%d] %s", msg_Dbg( p_input, "selected audio language[%d] %s",
i, p_sys->ppsz_audio_language[i] ); i, p_sys->ppsz_audio_language[i] );
} }
if( val.psz_string ) free( val.psz_string ); if( val.psz_string ) free( val.psz_string );
...@@ -189,7 +189,7 @@ es_out_t *input_EsOutNew( input_thread_t *p_input ) ...@@ -189,7 +189,7 @@ es_out_t *input_EsOutNew( input_thread_t *p_input )
if( p_sys->ppsz_sub_language ) if( p_sys->ppsz_sub_language )
{ {
for( i = 0; p_sys->ppsz_sub_language[i]; i++ ) for( i = 0; p_sys->ppsz_sub_language[i]; i++ )
msg_Dbg( p_input, "select subtitle in language[%d] %s", msg_Dbg( p_input, "selected subtitle language[%d] %s",
i, p_sys->ppsz_sub_language[i] ); i, p_sys->ppsz_sub_language[i] );
} }
if( val.psz_string ) free( val.psz_string ); if( val.psz_string ) free( val.psz_string );
...@@ -287,7 +287,7 @@ void input_EsOutDiscontinuity( es_out_t *out, vlc_bool_t b_audio ) ...@@ -287,7 +287,7 @@ void input_EsOutDiscontinuity( es_out_t *out, vlc_bool_t b_audio )
{ {
es_out_id_t *es = p_sys->es[i]; es_out_id_t *es = p_sys->es[i];
es->b_discontinuity = VLC_TRUE; /* signal discontinuity */ es->b_discontinuity = VLC_TRUE; /* signal discontinuity */
/* Send a dummy block to let decoder know that /* Send a dummy block to let decoder know that
* there is a discontinuity */ * there is a discontinuity */
if( es->p_dec && ( !b_audio || es->fmt.i_cat == AUDIO_ES ) ) if( es->p_dec && ( !b_audio || es->fmt.i_cat == AUDIO_ES ) )
...@@ -368,8 +368,10 @@ static void EsOutESVarUpdate( es_out_t *out, es_out_id_t *es, ...@@ -368,8 +368,10 @@ static void EsOutESVarUpdate( es_out_t *out, es_out_id_t *es,
{ {
if( es->psz_language && *es->psz_language ) if( es->psz_language && *es->psz_language )
{ {
text.psz_string = malloc( strlen( es->fmt.psz_description) + strlen( es->psz_language ) + 10 ); text.psz_string = malloc( strlen( es->fmt.psz_description) +
sprintf( text.psz_string, "%s - [%s]", es->fmt.psz_description, es->psz_language ); strlen( es->psz_language ) + 10 );
sprintf( text.psz_string, "%s - [%s]", es->fmt.psz_description,
es->psz_language );
} }
else text.psz_string = strdup( es->fmt.psz_description ); else text.psz_string = strdup( es->fmt.psz_description );
} }
...@@ -378,7 +380,8 @@ static void EsOutESVarUpdate( es_out_t *out, es_out_id_t *es, ...@@ -378,7 +380,8 @@ static void EsOutESVarUpdate( es_out_t *out, es_out_id_t *es,
if( es->psz_language && *es->psz_language ) if( es->psz_language && *es->psz_language )
{ {
char *temp; char *temp;
text.psz_string = malloc( strlen( _("Track %i") )+ strlen( es->psz_language ) + 30 ); text.psz_string = malloc( strlen( _("Track %i") )+
strlen( es->psz_language ) + 30 );
asprintf( &temp, _("Track %i"), val.i_int ); asprintf( &temp, _("Track %i"), val.i_int );
sprintf( text.psz_string, "%s - [%s]", temp, es->psz_language ); sprintf( text.psz_string, "%s - [%s]", temp, es->psz_language );
free( temp ); free( temp );
...@@ -780,7 +783,7 @@ static void EsSelect( es_out_t *out, es_out_id_t *es ) ...@@ -780,7 +783,7 @@ static void EsSelect( es_out_t *out, es_out_id_t *es )
msg_Dbg( p_input, "spu is disabled, not selecting ES 0x%x", msg_Dbg( p_input, "spu is disabled, not selecting ES 0x%x",
es->i_id ); es->i_id );
return; return;
} }
} }
es->i_preroll_end = -1; es->i_preroll_end = -1;
......
...@@ -207,7 +207,8 @@ static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item, ...@@ -207,7 +207,8 @@ static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item,
} }
else if( !strncmp( psz_start, "time=", 5 ) ) else if( !strncmp( psz_start, "time=", 5 ) )
{ {
p_seekpoint->i_time_offset = atoll(psz_start + 5) * 1000000; p_seekpoint->i_time_offset = atoll(psz_start + 5) *
1000000;
} }
psz_start = psz_end + 1; psz_start = psz_end + 1;
} }
...@@ -1576,7 +1577,7 @@ static vlc_bool_t Control( input_thread_t *p_input, int i_type, ...@@ -1576,7 +1577,7 @@ static vlc_bool_t Control( input_thread_t *p_input, int i_type,
{ {
input_EsOutDiscontinuity( p_input->p_es_out, VLC_FALSE ); input_EsOutDiscontinuity( p_input->p_es_out, VLC_FALSE );
es_out_Control( p_input->p_es_out, ES_OUT_RESET_PCR ); es_out_Control( p_input->p_es_out, ES_OUT_RESET_PCR );
access2_Control( p_access, ACCESS_SET_TITLE, i_title ); access2_Control( p_access, ACCESS_SET_TITLE, i_title );
stream_AccessReset( p_input->input.p_stream ); stream_AccessReset( p_input->input.p_stream );
} }
...@@ -1617,7 +1618,7 @@ static vlc_bool_t Control( input_thread_t *p_input, int i_type, ...@@ -1617,7 +1618,7 @@ static vlc_bool_t Control( input_thread_t *p_input, int i_type,
{ {
input_EsOutDiscontinuity( p_input->p_es_out, VLC_FALSE ); input_EsOutDiscontinuity( p_input->p_es_out, VLC_FALSE );
es_out_Control( p_input->p_es_out, ES_OUT_RESET_PCR ); es_out_Control( p_input->p_es_out, ES_OUT_RESET_PCR );
demux2_Control( p_demux, DEMUX_SET_SEEKPOINT, i_seekpoint ); demux2_Control( p_demux, DEMUX_SET_SEEKPOINT, i_seekpoint );
} }
} }
...@@ -1653,8 +1654,9 @@ static vlc_bool_t Control( input_thread_t *p_input, int i_type, ...@@ -1653,8 +1654,9 @@ static vlc_bool_t Control( input_thread_t *p_input, int i_type,
{ {
input_EsOutDiscontinuity( p_input->p_es_out, VLC_FALSE ); input_EsOutDiscontinuity( p_input->p_es_out, VLC_FALSE );
es_out_Control( p_input->p_es_out, ES_OUT_RESET_PCR ); es_out_Control( p_input->p_es_out, ES_OUT_RESET_PCR );
access2_Control( p_access, ACCESS_SET_SEEKPOINT, i_seekpoint ); access2_Control( p_access, ACCESS_SET_SEEKPOINT,
i_seekpoint );
stream_AccessReset( p_input->input.p_stream ); stream_AccessReset( p_input->input.p_stream );
} }
} }
...@@ -1971,7 +1973,7 @@ static void UpdateItemLength( input_thread_t *p_input, int64_t i_length, ...@@ -1971,7 +1973,7 @@ static void UpdateItemLength( input_thread_t *p_input, int64_t i_length,
static input_source_t *InputSourceNew( input_thread_t *p_input ) static input_source_t *InputSourceNew( input_thread_t *p_input )
{ {
input_source_t *in = (input_source_t*) malloc( sizeof( input_source_t ) ); input_source_t *in = (input_source_t*) malloc( sizeof( input_source_t ) );
if( !in ) if( !in )
{ {
msg_Err( p_input, "out of memory for new input source" ); msg_Err( p_input, "out of memory for new input source" );
...@@ -2043,7 +2045,7 @@ static int InputSourceInit( input_thread_t *p_input, ...@@ -2043,7 +2045,7 @@ static int InputSourceInit( input_thread_t *p_input,
{ {
psz_demux = psz_var_demux; psz_demux = psz_var_demux;
msg_Dbg( p_input, "Enforce demux ` %s'", psz_demux ); msg_Dbg( p_input, "enforced demux ` %s'", psz_demux );
} }
else if( psz_var_demux ) else if( psz_var_demux )
{ {
...@@ -2281,7 +2283,7 @@ static void SlaveDemux( input_thread_t *p_input ) ...@@ -2281,7 +2283,7 @@ static void SlaveDemux( input_thread_t *p_input )
{ {
int64_t i_time; int64_t i_time;
int i; int i;
if( demux2_Control( p_input->input.p_demux, DEMUX_GET_TIME, &i_time ) ) if( demux2_Control( p_input->input.p_demux, DEMUX_GET_TIME, &i_time ) )
{ {
msg_Err( p_input, "demux doesn't like DEMUX_GET_TIME" ); msg_Err( p_input, "demux doesn't like DEMUX_GET_TIME" );
......
...@@ -36,8 +36,8 @@ ...@@ -36,8 +36,8 @@
# include <dirent.h> # include <dirent.h>
#endif #endif
#ifdef HAVE_LIMITS_H