mirror of
https://github.com/owntone/owntone-server.git
synced 2025-03-30 17:23:44 -04:00
make flac.c -Wall clean
This commit is contained in:
parent
d4aaf09700
commit
5a435bc6e9
39
src/flac.c
39
src/flac.c
@ -39,7 +39,6 @@
|
|||||||
#include <dirent.h> /* why here? For osx 10.2, of course! */
|
#include <dirent.h> /* why here? For osx 10.2, of course! */
|
||||||
|
|
||||||
#include "daapd.h"
|
#include "daapd.h"
|
||||||
#include "db-memory.h"
|
|
||||||
#include "err.h"
|
#include "err.h"
|
||||||
#include "mp3-scanner.h"
|
#include "mp3-scanner.h"
|
||||||
|
|
||||||
@ -51,7 +50,6 @@
|
|||||||
|
|
||||||
int scan_get_flacfileinfo(char *filename, MP3FILE *pmp3)
|
int scan_get_flacfileinfo(char *filename, MP3FILE *pmp3)
|
||||||
{
|
{
|
||||||
FLAC__bool ok;
|
|
||||||
FLAC__Metadata_Chain *chain;
|
FLAC__Metadata_Chain *chain;
|
||||||
FLAC__Metadata_Iterator *iterator;
|
FLAC__Metadata_Iterator *iterator;
|
||||||
FLAC__StreamMetadata *block;
|
FLAC__StreamMetadata *block;
|
||||||
@ -123,7 +121,6 @@ int scan_get_flacfileinfo(char *filename, MP3FILE *pmp3)
|
|||||||
|
|
||||||
int scan_get_flactags(char *filename, MP3FILE *pmp3)
|
int scan_get_flactags(char *filename, MP3FILE *pmp3)
|
||||||
{
|
{
|
||||||
FLAC__bool ok;
|
|
||||||
FLAC__Metadata_Chain *chain;
|
FLAC__Metadata_Chain *chain;
|
||||||
FLAC__Metadata_Iterator *iterator;
|
FLAC__Metadata_Iterator *iterator;
|
||||||
FLAC__StreamMetadata *block;
|
FLAC__StreamMetadata *block;
|
||||||
@ -157,44 +154,44 @@ int scan_get_flactags(char *filename, MP3FILE *pmp3)
|
|||||||
if (block->type == FLAC__METADATA_TYPE_VORBIS_COMMENT) {
|
if (block->type == FLAC__METADATA_TYPE_VORBIS_COMMENT) {
|
||||||
{
|
{
|
||||||
for (i = 0; i < block->data.vorbis_comment.num_comments; i++) {
|
for (i = 0; i < block->data.vorbis_comment.num_comments; i++) {
|
||||||
if (val = GET_VORBIS_COMMENT(block->data.vorbis_comment.comments[i],
|
if ((val = GET_VORBIS_COMMENT(block->data.vorbis_comment.comments[i],
|
||||||
"ARTIST", &len)) {
|
"ARTIST", &len))) {
|
||||||
if ((pmp3->artist = calloc(len + 1, 1)) != NULL)
|
if ((pmp3->artist = calloc(len + 1, 1)) != NULL)
|
||||||
strncpy(pmp3->artist, val, len);
|
strncpy(pmp3->artist, val, len);
|
||||||
} else if (val = GET_VORBIS_COMMENT(block->data.vorbis_comment.comments[i],
|
} else if ((val = GET_VORBIS_COMMENT(block->data.vorbis_comment.comments[i],
|
||||||
"TITLE", &len)) {
|
"TITLE", &len))) {
|
||||||
if ((pmp3->title = calloc(len + 1, 1)) != NULL)
|
if ((pmp3->title = calloc(len + 1, 1)) != NULL)
|
||||||
strncpy(pmp3->title, val, len);
|
strncpy(pmp3->title, val, len);
|
||||||
} else if (val = GET_VORBIS_COMMENT(block->data.vorbis_comment.comments[i],
|
} else if ((val = GET_VORBIS_COMMENT(block->data.vorbis_comment.comments[i],
|
||||||
"ALBUM", &len)) {
|
"ALBUM", &len))) {
|
||||||
if ((pmp3->album = calloc(len + 1, 1)) != NULL)
|
if ((pmp3->album = calloc(len + 1, 1)) != NULL)
|
||||||
strncpy(pmp3->album, val, len);
|
strncpy(pmp3->album, val, len);
|
||||||
} else if (val = GET_VORBIS_COMMENT(block->data.vorbis_comment.comments[i],
|
} else if ((val = GET_VORBIS_COMMENT(block->data.vorbis_comment.comments[i],
|
||||||
"GENRE", &len)) {
|
"GENRE", &len))) {
|
||||||
if ((pmp3->genre = calloc(len + 1, 1)) != NULL)
|
if ((pmp3->genre = calloc(len + 1, 1)) != NULL)
|
||||||
strncpy(pmp3->genre, val, len);
|
strncpy(pmp3->genre, val, len);
|
||||||
} else if (val = GET_VORBIS_COMMENT(block->data.vorbis_comment.comments[i],
|
} else if ((val = GET_VORBIS_COMMENT(block->data.vorbis_comment.comments[i],
|
||||||
"COMPOSER", &len)) {
|
"COMPOSER", &len))) {
|
||||||
if ((pmp3->composer = calloc(len + 1, 1)) != NULL)
|
if ((pmp3->composer = calloc(len + 1, 1)) != NULL)
|
||||||
strncpy(pmp3->composer, val, len);
|
strncpy(pmp3->composer, val, len);
|
||||||
} else if (val = GET_VORBIS_COMMENT(block->data.vorbis_comment.comments[i],
|
} else if ((val = GET_VORBIS_COMMENT(block->data.vorbis_comment.comments[i],
|
||||||
"COMMENT", &len)) {
|
"COMMENT", &len))) {
|
||||||
if ((pmp3->comment = calloc(len + 1, 1)) != NULL)
|
if ((pmp3->comment = calloc(len + 1, 1)) != NULL)
|
||||||
strncpy(pmp3->comment, val, len);
|
strncpy(pmp3->comment, val, len);
|
||||||
} else if (val = GET_VORBIS_COMMENT(block->data.vorbis_comment.comments[i],
|
} else if ((val = GET_VORBIS_COMMENT(block->data.vorbis_comment.comments[i],
|
||||||
"TRACKNUMBER", &len)) {
|
"TRACKNUMBER", &len))) {
|
||||||
tmp = *(val + len);
|
tmp = *(val + len);
|
||||||
*(val + len) = '\0';
|
*(val + len) = '\0';
|
||||||
pmp3->track = atoi(val);
|
pmp3->track = atoi(val);
|
||||||
*(val + len) = tmp;
|
*(val + len) = tmp;
|
||||||
} else if (val = GET_VORBIS_COMMENT(block->data.vorbis_comment.comments[i],
|
} else if ((val = GET_VORBIS_COMMENT(block->data.vorbis_comment.comments[i],
|
||||||
"DISCNUMBER", &len)) {
|
"DISCNUMBER", &len))) {
|
||||||
tmp = *(val + len);
|
tmp = *(val + len);
|
||||||
*(val + len) = '\0';
|
*(val + len) = '\0';
|
||||||
pmp3->disc = atoi(val);
|
pmp3->disc = atoi(val);
|
||||||
*(val + len) = tmp;
|
*(val + len) = tmp;
|
||||||
} else if (val = GET_VORBIS_COMMENT(block->data.vorbis_comment.comments[i],
|
} else if ((val = GET_VORBIS_COMMENT(block->data.vorbis_comment.comments[i],
|
||||||
"YEAR", &len)) {
|
"YEAR", &len))) {
|
||||||
tmp = *(val + len);
|
tmp = *(val + len);
|
||||||
*(val + len) = '\0';
|
*(val + len) = '\0';
|
||||||
pmp3->year = atoi(val);
|
pmp3->year = atoi(val);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user