Skip to content

Commit

Permalink
m3utils: add albumartist support
Browse files Browse the repository at this point in the history
  • Loading branch information
Duncaen committed Apr 26, 2018
1 parent 63fc3f6 commit 5eb8917
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion m3utils.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// tags.c
struct tags {
char *artist;
char *album;
char *albumartist;
char *artist;
char *title;
char *track;
int channels;
Expand Down
2 changes: 2 additions & 0 deletions tags.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ cb(Tagctx *ctx, int t, const char *v, int offset, int size, Tagread f)
struct tags *ta = ((struct aux *)ctx->aux)->t;
switch (t) {
case Talbum: ta->album = strdup(v); break;
case Talbumartist: ta->albumartist = strdup(v); break;
case Tartist: ta->artist = strdup(v); break;
case Ttitle: ta->title = strdup(v); break;
case Ttrack: ta->track= strdup(v); break;
Expand Down Expand Up @@ -65,6 +66,7 @@ m3tags(char *file, struct tags *t)
t->bitrate = ctx.bitrate;
t->duration = ctx.duration;
t->format = ctx.format;
if (!t->albumartist) t->albumartist = t->artist;
close(aux.fd);
return 0;
}

0 comments on commit 5eb8917

Please sign in to comment.