[vlc-commits] WMV: use defines instead of magic numbers
Jean-Baptiste Kempf
git at videolan.org
Sun May 22 20:36:40 CEST 2016
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun May 22 20:35:45 2016 +0200| [1dbf58b4c296c36431f13a48ecfe257037c9bf01] | committer: Jean-Baptiste Kempf
WMV: use defines instead of magic numbers
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1dbf58b4c296c36431f13a48ecfe257037c9bf01
---
modules/demux/asf/libasf.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/modules/demux/asf/libasf.c b/modules/demux/asf/libasf.c
index 7171549..7d5feaa 100644
--- a/modules/demux/asf/libasf.c
+++ b/modules/demux/asf/libasf.c
@@ -1209,12 +1209,12 @@ static int ASF_ReadObject_extended_content_description( stream_t *s,
i_type = ASF_READ2();
i_size = ASF_READ2();
- if( i_type == 0 )
+ if( i_type == ASF_METADATA_TYPE_STRING )
{
/* Unicode string */
p_ec->ppsz_value[i] = ASF_READS( i_size );
}
- else if( i_type == 1 )
+ else if( i_type == ASF_METADATA_TYPE_BYTE )
{
/* Byte array */
static const char hex[16] = "0123456789ABCDEF";
@@ -1232,25 +1232,25 @@ static int ASF_ReadObject_extended_content_description( stream_t *s,
psz_value[2*i_size] = '\0';
}
}
- else if( i_type == 2 )
+ else if( i_type == ASF_METADATA_TYPE_BOOL )
{
/* Bool */
p_ec->ppsz_value[i] = strdup( ASF_READ1() ? "true" : "false" );
ASF_SKIP(i_size-1);
}
- else if( i_type == 3 )
+ else if( i_type == ASF_METADATA_TYPE_DWORD )
{
/* DWord */
if( asprintf( &p_ec->ppsz_value[i], "%d", ASF_READ4() ) == -1 )
p_ec->ppsz_value[i] = NULL;
}
- else if( i_type == 4 )
+ else if( i_type == ASF_METADATA_TYPE_QWORD )
{
/* QWord */
if( asprintf( &p_ec->ppsz_value[i], "%"PRId64, ASF_READ8() ) == -1 )
p_ec->ppsz_value[i] = NULL;
}
- else if( i_type == 5 )
+ else if( i_type == ASF_METADATA_TYPE_WORD )
{
/* Word */
if( asprintf( &p_ec->ppsz_value[i], "%d", ASF_READ2() ) == -1 )
More information about the vlc-commits
mailing list