From 3923780814004f3735687c9963b753fd751b2245 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= Date: Tue, 12 Sep 2006 19:15:20 +0000 Subject: [PATCH] Most of demux/ --- modules/demux/asf/libasf.c | 4 +++- modules/demux/mp4/libmp4.c | 8 ++++++-- modules/demux/mp4/mp4.c | 5 ++++- modules/demux/nsc.c | 20 ++++++++++---------- modules/demux/playlist/b4s.c | 4 +++- modules/demux/real.c | 4 +++- modules/demux/subtitle.c | 5 ++++- modules/demux/ts.c | 7 ++++++- modules/demux/vobsub.c | 4 +++- 9 files changed, 42 insertions(+), 19 deletions(-) diff --git a/modules/demux/asf/libasf.c b/modules/demux/asf/libasf.c index 5c45fb61d4..7665e76656 100644 --- a/modules/demux/asf/libasf.c +++ b/modules/demux/asf/libasf.c @@ -22,9 +22,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ +#include + +#include #include /* malloc(), free() */ -#include #include #include "codecs.h" /* BITMAPINFOHEADER, WAVEFORMATEX */ diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c index 9325943114..13d7905f41 100644 --- a/modules/demux/mp4/libmp4.c +++ b/modules/demux/mp4/libmp4.c @@ -20,9 +20,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ +#include + +#include #include /* malloc(), free() */ -#include #include #ifdef HAVE_ZLIB_H @@ -1112,10 +1114,12 @@ static int MP4_ReadBox_sample_soun( stream_t *p_stream, MP4_Box_t *p_box ) { /* SoundDescriptionV2 */ double f_sample_rate; + int64_t dummy; uint32_t i_channel; MP4_GET4BYTES( p_box->data.p_sample_soun->i_sample_per_packet ); - MP4_GET8BYTES( (*(int64_t *)&f_sample_rate) ); + MP4_GET8BYTES( dummy ); + memcpy( &f_sample_rate, &dummy, 8 ); msg_Dbg( p_stream, "read box: %f Hz", f_sample_rate ); p_box->data.p_sample_soun->i_sampleratehi = (int)f_sample_rate % 65536; diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c index 84300fa357..5a533248ae 100644 --- a/modules/demux/mp4/mp4.c +++ b/modules/demux/mp4/mp4.c @@ -23,9 +23,12 @@ /***************************************************************************** * Preamble *****************************************************************************/ -#include /* malloc(), free() */ #include + +#include +#include /* malloc(), free() */ + #include #include #include diff --git a/modules/demux/nsc.c b/modules/demux/nsc.c index 77ff04d6a8..6bb9b6c4f9 100644 --- a/modules/demux/nsc.c +++ b/modules/demux/nsc.c @@ -147,7 +147,7 @@ char *nscdec( vlc_object_t *p_demux, char* p_encoded ) vlc_iconv_t conv; size_t buf16_size; unsigned char *buf16; - char *p_buf16; + const char *p_buf16; size_t buf8_size; char *buf8; char *p_buf8; @@ -208,7 +208,7 @@ char *nscdec( vlc_object_t *p_demux, char* p_encoded ) } buf16_size = length; - buf16 = (unsigned char *)malloc( buf16_size ); + buf16 = malloc( buf16_size ); if( buf16 == NULL ) { msg_Err( p_demux, "out of memory" ); @@ -220,17 +220,17 @@ char *nscdec( vlc_object_t *p_demux, char* p_encoded ) if( load_byte( encoding_type, &buf16[ i ], &p_input, &j, &k ) ) { msg_Err( p_demux, "load_byte failed" ); - free( (void *)buf16 ); + free( buf16 ); return NULL; } } buf8_size = length; - buf8 = (char *)malloc( buf8_size + 1 ); + buf8 = malloc( buf8_size + 1 ); if( buf8 == NULL ) { msg_Err( p_demux, "out of memory" ); - free( (void *)buf16 ); + free( buf16 ); return NULL; } @@ -238,13 +238,13 @@ char *nscdec( vlc_object_t *p_demux, char* p_encoded ) if( conv == (vlc_iconv_t)-1 ) { msg_Err( p_demux, "iconv_open failed" ); - free( (void *)buf16 ); - free( (void *)buf8 ); + free( buf16 ); + free( buf8 ); return NULL; } - p_buf8 = &buf8[ 0 ]; - p_buf16 = (char *)&buf16[ 0 ]; + p_buf8 = buf8; + p_buf16 = (const char *)buf16; if( vlc_iconv( conv, &p_buf16, &buf16_size, &p_buf8, &buf8_size ) < 0 ) { @@ -258,7 +258,7 @@ char *nscdec( vlc_object_t *p_demux, char* p_encoded ) vlc_iconv_close( conv ); - free( (void *)buf16 ); + free( buf16 ); return buf8; } diff --git a/modules/demux/playlist/b4s.c b/modules/demux/playlist/b4s.c index 591f5ad70b..45cef697d7 100644 --- a/modules/demux/playlist/b4s.c +++ b/modules/demux/playlist/b4s.c @@ -45,7 +45,7 @@ struct demux_sys_t *****************************************************************************/ static int Demux( demux_t *p_demux); static int Control( demux_t *p_demux, int i_query, va_list args ); -static char *GetNextToken(char *psz_cur_string); +//static char *GetNextToken(char *psz_cur_string); static int IsWhitespace( char *psz_string ); /***************************************************************************** @@ -298,6 +298,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) return VLC_EGENERIC; } +#if 0 /** * Get a in-string pointer to the start of the next token from a * string terminating the pointer returned by a previous call. @@ -318,6 +319,7 @@ static char *GetNextToken(char *psz_cur_string) { psz_cur_string++; return psz_cur_string; } +#endif static int IsWhitespace( char *psz_string ) { diff --git a/modules/demux/real.c b/modules/demux/real.c index bafa920bb5..e640afdcab 100644 --- a/modules/demux/real.c +++ b/modules/demux/real.c @@ -24,9 +24,11 @@ /***************************************************************************** * Preamble *****************************************************************************/ +#include + +#include #include /* malloc(), free() */ -#include #include #include "charset.h" diff --git a/modules/demux/subtitle.c b/modules/demux/subtitle.c index 4240a31d5a..e17acab47b 100644 --- a/modules/demux/subtitle.c +++ b/modules/demux/subtitle.c @@ -25,6 +25,9 @@ /***************************************************************************** * Preamble *****************************************************************************/ +#include + +#include #include #include @@ -33,9 +36,9 @@ #endif #include -#include #include #include "vlc_video.h" +#include "charset.h" /***************************************************************************** * Module descriptor diff --git a/modules/demux/ts.c b/modules/demux/ts.c index e5e611f8f6..376c1e1024 100644 --- a/modules/demux/ts.c +++ b/modules/demux/ts.c @@ -25,10 +25,13 @@ /***************************************************************************** * Preamble *****************************************************************************/ + +#include + +#include #include /* malloc(), free() */ #include -#include #include #include "iso_lang.h" @@ -2403,6 +2406,7 @@ static void SDTCallBack( demux_t *p_demux, dvbpsi_sdt_t *p_sdt ) { if( p_dr->i_tag == 0x48 ) { +#if 0 static const char *psz_type[0x11] = { "Reserved", "Digital television service", @@ -2422,6 +2426,7 @@ static void SDTCallBack( demux_t *p_demux, dvbpsi_sdt_t *p_sdt ) "RCS FLS (see EN 301 790 [35])", "DVB MHP service" }; +#endif dvbpsi_service_dr_t *pD = dvbpsi_DecodeServiceDr( p_dr ); char str1[257]; char str2[257]; diff --git a/modules/demux/vobsub.c b/modules/demux/vobsub.c index 0393b21302..032e535a2c 100644 --- a/modules/demux/vobsub.c +++ b/modules/demux/vobsub.c @@ -25,11 +25,13 @@ /***************************************************************************** * Preamble *****************************************************************************/ +#include + #include +#include #include #include -#include #include #include "vlc_video.h" #include "charset.h" -- GitLab