Commit 30e4a13f authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

ASF: cleaning

Trailing spaces, guid names consistency with MMS module, calloc, enum
parent 82756986
...@@ -53,10 +53,10 @@ static void Close ( vlc_object_t * ); ...@@ -53,10 +53,10 @@ static void Close ( vlc_object_t * );
vlc_module_begin () vlc_module_begin ()
set_category( CAT_INPUT ) set_category( CAT_INPUT )
set_subcategory( SUBCAT_INPUT_DEMUX ) set_subcategory( SUBCAT_INPUT_DEMUX )
set_description( N_("ASF v1.0 demuxer") ) set_description( N_("ASF/WMV demuxer") )
set_capability( "demux", 200 ) set_capability( "demux", 200 )
set_callbacks( Open, Close ) set_callbacks( Open, Close )
add_shortcut( "asf" ) add_shortcut( "asf", "wmv" )
vlc_module_end () vlc_module_end ()
...@@ -126,8 +126,7 @@ static int Open( vlc_object_t * p_this ) ...@@ -126,8 +126,7 @@ static int Open( vlc_object_t * p_this )
/* Set p_demux fields */ /* Set p_demux fields */
p_demux->pf_demux = Demux; p_demux->pf_demux = Demux;
p_demux->pf_control = Control; p_demux->pf_control = Control;
p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) ); p_demux->p_sys = p_sys = calloc( 1, sizeof( demux_sys_t ) );
memset( p_sys, 0, sizeof( demux_sys_t ) );
/* Load the headers */ /* Load the headers */
if( DemuxInit( p_demux ) ) if( DemuxInit( p_demux ) )
...@@ -811,12 +810,12 @@ static int DemuxInit( demux_t *p_demux ) ...@@ -811,12 +810,12 @@ static int DemuxInit( demux_t *p_demux )
if( p_hdr_ext ) if( p_hdr_ext )
{ {
int i_ext_stream = ASF_CountObject( p_hdr_ext, int i_ext_stream = ASF_CountObject( p_hdr_ext,
&asf_object_extended_stream_properties ); &asf_object_extended_stream_properties_guid );
for( int i = 0; i < i_ext_stream; i++ ) for( int i = 0; i < i_ext_stream; i++ )
{ {
asf_object_t *p_tmp = asf_object_t *p_tmp =
ASF_FindObject( p_hdr_ext, ASF_FindObject( p_hdr_ext,
&asf_object_extended_stream_properties, i ); &asf_object_extended_stream_properties_guid, i );
if( p_tmp->ext_stream.i_stream_number == p_sp->i_stream_number ) if( p_tmp->ext_stream.i_stream_number == p_sp->i_stream_number )
{ {
p_esp = &p_tmp->ext_stream; p_esp = &p_tmp->ext_stream;
......
...@@ -32,14 +32,6 @@ ...@@ -32,14 +32,6 @@
#define ASF_DEBUG 1 #define ASF_DEBUG 1
#define GUID_FMT "0x%x-0x%x-0x%x-0x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x"
#define GUID_PRINT( guid ) \
(guid).v1, \
(guid).v2, \
(guid).v3, \
(guid).v4[0],(guid).v4[1],(guid).v4[2],(guid).v4[3], \
(guid).v4[4],(guid).v4[5],(guid).v4[6],(guid).v4[7]
/* Helpers: /* Helpers:
* They ensure that invalid reads will not create problems. * They ensure that invalid reads will not create problems.
* They are expansion safe * They are expansion safe
...@@ -1274,7 +1266,7 @@ static const struct ...@@ -1274,7 +1266,7 @@ static const struct
{ &asf_object_stream_bitrate_properties, ASF_OBJECT_OTHER, { &asf_object_stream_bitrate_properties, ASF_OBJECT_OTHER,
ASF_ReadObject_stream_bitrate_properties, ASF_ReadObject_stream_bitrate_properties,
ASF_FreeObject_stream_bitrate_properties }, ASF_FreeObject_stream_bitrate_properties },
{ &asf_object_extended_stream_properties, ASF_OBJECT_OTHER, { &asf_object_extended_stream_properties_guid, ASF_OBJECT_OTHER,
ASF_ReadObject_extended_stream_properties, ASF_ReadObject_extended_stream_properties,
ASF_FreeObject_extended_stream_properties }, ASF_FreeObject_extended_stream_properties },
{ &asf_object_advanced_mutual_exclusion, ASF_OBJECT_OTHER, { &asf_object_advanced_mutual_exclusion, ASF_OBJECT_OTHER,
...@@ -1435,7 +1427,7 @@ static const struct ...@@ -1435,7 +1427,7 @@ static const struct
{ &asf_object_language_list, "Language List" }, { &asf_object_language_list, "Language List" },
{ &asf_object_stream_bitrate_properties, "Stream Bitrate Properties" }, { &asf_object_stream_bitrate_properties, "Stream Bitrate Properties" },
{ &asf_object_padding, "Padding" }, { &asf_object_padding, "Padding" },
{ &asf_object_extended_stream_properties, "Extended Stream Properties" }, { &asf_object_extended_stream_properties_guid, "Extended Stream Properties" },
{ &asf_object_advanced_mutual_exclusion, "Advanced Mutual Exclusion" }, { &asf_object_advanced_mutual_exclusion, "Advanced Mutual Exclusion" },
{ &asf_object_stream_prioritization, "Stream Prioritization" }, { &asf_object_stream_prioritization, "Stream Prioritization" },
{ &asf_object_extended_content_description, "Extended content description"}, { &asf_object_extended_content_description, "Extended content description"},
...@@ -1568,12 +1560,12 @@ asf_object_root_t *ASF_ReadObjectRoot( stream_t *s, int b_seekable ) ...@@ -1568,12 +1560,12 @@ asf_object_root_t *ASF_ReadObjectRoot( stream_t *s, int b_seekable )
&asf_object_metadata_guid, 0 ); &asf_object_metadata_guid, 0 );
/* Special case for broken designed file format :( */ /* Special case for broken designed file format :( */
i_ext_stream = ASF_CountObject( p_hdr_ext, i_ext_stream = ASF_CountObject( p_hdr_ext,
&asf_object_extended_stream_properties ); &asf_object_extended_stream_properties_guid );
for( i = 0; i < i_ext_stream; i++ ) for( i = 0; i < i_ext_stream; i++ )
{ {
asf_object_t *p_esp = asf_object_t *p_esp =
ASF_FindObject( p_hdr_ext, ASF_FindObject( p_hdr_ext,
&asf_object_extended_stream_properties, i ); &asf_object_extended_stream_properties_guid, i );
if( p_esp->ext_stream.p_sp ) if( p_esp->ext_stream.p_sp )
{ {
asf_object_t *p_sp = asf_object_t *p_sp =
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* libasf.h : * libasf.h :
***************************************************************************** *****************************************************************************
* Copyright © 2001-2004, 2011 the VideoLAN team * Copyright © 2001-2004, 2011 the VideoLAN team
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -32,6 +32,14 @@ typedef struct guid_s ...@@ -32,6 +32,14 @@ typedef struct guid_s
uint8_t v4[8]; uint8_t v4[8];
} guid_t; } guid_t;
#define GUID_FMT "0x%x-0x%x-0x%x-0x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x"
#define GUID_PRINT( guid ) \
(guid).v1, \
(guid).v2, \
(guid).v3, \
(guid).v4[0],(guid).v4[1],(guid).v4[2],(guid).v4[3], \
(guid).v4[4],(guid).v4[5],(guid).v4[6],(guid).v4[7]
enum enum
{ {
ASF_OBJECT_NULL = 0, ASF_OBJECT_NULL = 0,
...@@ -150,7 +158,7 @@ static const guid_t asf_object_padding = ...@@ -150,7 +158,7 @@ static const guid_t asf_object_padding =
{0x1806D474, 0xCADF, 0x4509, {0xA4, 0xBA, 0x9A, 0xAB, 0xCB, 0x96, 0xAA, 0xE8}}; {0x1806D474, 0xCADF, 0x4509, {0xA4, 0xBA, 0x9A, 0xAB, 0xCB, 0x96, 0xAA, 0xE8}};
// header extension // header extension
static const guid_t asf_object_extended_stream_properties = static const guid_t asf_object_extended_stream_properties_guid =
{0x14E6A5CB, 0xC672, 0x4332, {0x83, 0x99, 0xA9, 0x69, 0x52, 0x06, 0x5B, 0x5A}}; {0x14E6A5CB, 0xC672, 0x4332, {0x83, 0x99, 0xA9, 0x69, 0x52, 0x06, 0x5B, 0x5A}};
static const guid_t asf_object_group_mutual_exclusion_guid = static const guid_t asf_object_group_mutual_exclusion_guid =
...@@ -300,12 +308,14 @@ typedef struct ...@@ -300,12 +308,14 @@ typedef struct
} asf_object_header_extension_t; } asf_object_header_extension_t;
#define ASF_METADATA_TYPE_STRING 0x0000 enum {
#define ASF_METADATA_TYPE_BYTE 0x0001 ASF_METADATA_TYPE_STRING,
#define ASF_METADATA_TYPE_BOOL 0x0002 ASF_METADATA_TYPE_BYTE,
#define ASF_METADATA_TYPE_DWORD 0x0003 ASF_METADATA_TYPE_BOOL,
#define ASF_METADATA_TYPE_QWORD 0x0004 ASF_METADATA_TYPE_DWORD,
#define ASF_METADATA_TYPE_WORD 0x0005 ASF_METADATA_TYPE_QWORD,
ASF_METADATA_TYPE_WORD,
};
typedef struct typedef struct
{ {
......
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