Merge branch 'mp3crc'

Fixes issue #24.
This commit is contained in:
Mahyar Koshkouei
2017-01-13 22:57:19 +00:00
3 changed files with 6 additions and 4 deletions

View File

@@ -4,7 +4,7 @@
#define CHANNEL 0x08
/* Adds extra debugging text */
//#define DEBUG
#define DEBUG
/* Prints more error information */
#define err_print(err) \

View File

@@ -47,14 +47,14 @@ int initMp3(const char* file)
if((mh = mpg123_new(NULL, &err)) == NULL)
{
//printf("Error: %s\n", mpg123_plain_strerror(err));
printf("Error: %s\n", mpg123_plain_strerror(err));
return err;
}
if(mpg123_open(mh, file) != MPG123_OK ||
mpg123_getformat(mh, (long *) &rate, (int *) &channels, &encoding) != MPG123_OK)
{
//printf("Trouble with mpg123: %s\n", mpg123_strerror(mh));
printf("Trouble with mpg123: %s\n", mpg123_strerror(mh));
return -1;
}

View File

@@ -236,7 +236,9 @@ int getFileType(const char *file)
* MP3 without ID3 tag, ID3v1 tag is at the end of file, or MP3
* with ID3 tag at the beginning of the file.
*/
if((fileSig << 16) == 0xFBFF0000 || (fileSig << 8) == 0x33444900)
if((fileSig << 16) == 0xFBFF0000 ||
(fileSig << 16) == 0xFAFF0000 ||
(fileSig << 8) == 0x33444900)
{
puts("File type is MP3.");
file_type = FILE_TYPE_MP3;