Testing mp3 files with error protection enabled
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
#define CHANNEL 0x08
|
#define CHANNEL 0x08
|
||||||
|
|
||||||
/* Adds extra debugging text */
|
/* Adds extra debugging text */
|
||||||
//#define DEBUG
|
#define DEBUG
|
||||||
|
|
||||||
/* Prints more error information */
|
/* Prints more error information */
|
||||||
#define err_print(err) \
|
#define err_print(err) \
|
||||||
|
|||||||
@@ -47,14 +47,14 @@ int initMp3(const char* file)
|
|||||||
|
|
||||||
if((mh = mpg123_new(NULL, &err)) == NULL)
|
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;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mpg123_open(mh, file) != MPG123_OK ||
|
if(mpg123_open(mh, file) != MPG123_OK ||
|
||||||
mpg123_getformat(mh, (long *) &rate, (int *) &channels, &encoding) != 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;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -236,7 +236,9 @@ int getFileType(const char *file)
|
|||||||
* MP3 without ID3 tag, ID3v1 tag is at the end of file, or MP3
|
* MP3 without ID3 tag, ID3v1 tag is at the end of file, or MP3
|
||||||
* with ID3 tag at the beginning of the file.
|
* 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.");
|
puts("File type is MP3.");
|
||||||
file_type = FILE_TYPE_MP3;
|
file_type = FILE_TYPE_MP3;
|
||||||
|
|||||||
Reference in New Issue
Block a user