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

Most of demux/

parent 39d0e3e0
......@@ -22,9 +22,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include <vlc/vlc.h>
#include <stdio.h>
#include <stdlib.h> /* malloc(), free() */
#include <vlc/vlc.h>
#include <vlc/input.h>
#include "codecs.h" /* BITMAPINFOHEADER, WAVEFORMATEX */
......
......@@ -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 <vlc/vlc.h>
#include <stdio.h>
#include <stdlib.h> /* malloc(), free() */
#include <vlc/vlc.h>
#include <vlc/input.h>
#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;
......
......@@ -23,9 +23,12 @@
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <stdlib.h> /* malloc(), free() */
#include <vlc/vlc.h>
#include <stdio.h>
#include <stdlib.h> /* malloc(), free() */
#include <vlc/input.h>
#include <vlc_playlist.h>
#include <vlc_md5.h>
......
......@@ -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;
}
......
......@@ -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 )
{
......
......@@ -24,9 +24,11 @@
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <vlc/vlc.h>
#include <stdio.h>
#include <stdlib.h> /* malloc(), free() */
#include <vlc/vlc.h>
#include <vlc/input.h>
#include "charset.h"
......
......@@ -25,6 +25,9 @@
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <vlc/vlc.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
......@@ -33,9 +36,9 @@
#endif
#include <ctype.h>
#include <vlc/vlc.h>
#include <vlc/input.h>
#include "vlc_video.h"
#include "charset.h"
/*****************************************************************************
* Module descriptor
......
......@@ -25,10 +25,13 @@
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <vlc/vlc.h>
#include <stdio.h>
#include <stdlib.h> /* malloc(), free() */
#include <ctype.h>
#include <vlc/vlc.h>
#include <vlc/input.h>
#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];
......
......@@ -25,11 +25,13 @@
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <vlc/vlc.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <vlc/vlc.h>
#include <vlc/input.h>
#include "vlc_video.h"
#include "charset.h"
......
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