Changeset 77 for mppenc/branches/r2d/src/tags.c
- Timestamp:
- 10/17/06 16:55:28 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
mppenc/branches/r2d/src/tags.c
r65 r77 600 600 601 601 static int 602 IsUnicode ( const unsignedchar* src, size_t len )602 IsUnicode ( const char* src, size_t len ) 603 603 { 604 604 if ( len <= 2 ) … … 608 608 return 0; 609 609 610 if ( src [0] != 0xFF || src [1] != 0xFE) // Microsoft Unicode preample (also useful to detect endianess, but currently only little endian is supported)610 if ( src [0] != 0xFFi || src [1] != 0xFEi ) // Microsoft Unicode preample (also useful to detect endianess, but currently only little endian is supported) 611 611 return 0; 612 612 … … 614 614 if ( ( src [1] & 0xFC ) == 0xDC ) 615 615 return 0; 616 if ( src [1] == 0xFF && ( src [0] & 0xFE ) == 0xFE )616 if ( src [1] == 0xFFi && ( src [0] & 0xFE ) == 0xFE ) 617 617 return 0; 618 618 if ( ( src [1] & 0xFC ) == 0xD8 ) { … … 652 652 addtag ( const char* key, // the item key 653 653 size_t keylen, // length of item key, or 0 for auto-determine 654 const unsigned char*value, // the item value654 const char* value, // the item value 655 655 size_t valuelen, // the length of the item value (before any possible translation) 656 656 int converttoutf8, // convert flags of item value … … 659 659 unsigned char* p; 660 660 unsigned char* q; 661 unsignedchar ch;661 char ch; 662 662 size_t i; 663 663 #ifdef _WIN32 … … 716 716 p = malloc ( keylen ); 717 717 memcpy ( p, key, keylen ); 718 T [TagCount] . key =p;718 T [TagCount] . key = (char*) p; 719 719 T [TagCount] . keylen = keylen; 720 720 … … 925 925 return -1; 926 926 927 memcpy_crop ( "Title" ,tmp + 3, 30, 0 );928 memcpy_crop ( "Artist" ,tmp + 33, 30, 0 );929 memcpy_crop ( "Album" ,tmp + 63, 30, 0 );930 memcpy_crop ( "Year" ,tmp + 93, 4, 0 );931 memcpy_crop ( "Comment",tmp + 97, 30, 0 );927 memcpy_crop ( "Title" , (char*)tmp + 3, 30, 0 ); 928 memcpy_crop ( "Artist" , (char*)tmp + 33, 30, 0 ); 929 memcpy_crop ( "Album" , (char*)tmp + 63, 30, 0 ); 930 memcpy_crop ( "Year" , (char*)tmp + 93, 4, 0 ); 931 memcpy_crop ( "Comment", (char*)tmp + 97, 30, 0 ); 932 932 933 933 if ( tmp[127] < sizeof(GenreList)/sizeof(*GenreList) ) … … 937 937 if ( tmp[125] == 0 && tmp[126] != 0 ) 938 938 if ( ! TagKeyExists ( "Track", 0 ) ) { 939 sprintf (tmp, "%u", tmp[126] );940 addtag ("Track", 0, tmp, strlen (tmp), 0, 0 );939 sprintf ( (char*)tmp, "%u", tmp[126] ); 940 addtag ("Track", 0, (char*)tmp, strlen ((char*)tmp), 0, 0 ); 941 941 } 942 942 … … 991 991 len = Read_LE_Uint32 ( p ); p += 4; 992 992 flags = Read_LE_Uint32 ( p ); p += 4; 993 strcpy ( key, p ); p += strlen (key) + 1;994 if ( ! TagKeyExists (key, 0 ) )995 addtag ( key, 0,p, len > 0 && p [len-1] == '\0' ? len-1 : len, version >= 2000 ? 0 : 5, flags );993 strcpy ( (char*)key, (char*)p ); p += strlen ((char*)key) + 1; 994 if ( ! TagKeyExists ( (char*)key, 0 ) ) 995 addtag ( (char*)key, 0, (char*)p, len > 0 && p [len-1] == '\0' ? len-1 : len, version >= 2000 ? 0 : 5, flags ); 996 996 p += len; 997 997 }
Note: See TracChangeset
for help on using the changeset viewer.