mirror of
https://github.com/owntone/owntone-server.git
synced 2025-03-20 04:24:20 -04:00
Add sample rate from wma files, closing #166
This commit is contained in:
parent
c319c8b090
commit
c7a385b9b1
@ -819,6 +819,8 @@ int scan_mp3_get_mp3fileinfo(char *file, MP3FILE *pmp3) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
file_size = pmp3->file_size;
|
||||
|
||||
memset((void*)&fi,0x00,sizeof(fi));
|
||||
|
||||
if(fread(buffer,1,sizeof(buffer),infile) != sizeof(buffer)) {
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
#include "mp3-scanner.h"
|
||||
#include "restart.h"
|
||||
#include "err.h"
|
||||
@ -377,7 +376,8 @@ int wma_parse_stream_properties(int fd, int size, MP3FILE *pmp3) {
|
||||
int wma_parse_audio_media(int fd, int size, MP3FILE *pmp3) {
|
||||
unsigned short int codec;
|
||||
|
||||
if(size < 2)
|
||||
|
||||
if(size < 18)
|
||||
return TRUE; /* we'll leave it wma. will work or not! */
|
||||
|
||||
if(!wma_file_read_short(fd,&codec)) {
|
||||
@ -401,6 +401,11 @@ int wma_parse_audio_media(int fd, int size, MP3FILE *pmp3) {
|
||||
break;
|
||||
}
|
||||
|
||||
/* might as well get the sample rate while we are at it */
|
||||
lseek(fd,2,SEEK_CUR);
|
||||
if(!wma_file_read_int(fd,(unsigned int *)&pmp3->samplerate))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user