--- a/decoder_plugins/ffmpeg/ffmpeg.c +++ b/decoder_plugins/ffmpeg/ffmpeg.c @@ -81,14 +81,14 @@ static void ffmpeg_info (const char *fil } if (tags_sel & TAGS_COMMENTS) { - if (ic->track != 0) - info->track = ic->track; - if (ic->title[0] != 0) - info->title = xstrdup (ic->title); - if (ic->author[0] != 0) - info->artist = xstrdup (ic->author); - if (ic->album[0] != 0) - info->album = xstrdup (ic->album); + if (av_metadata_get(ic->metadata, "track", NULL, 0) != NULL) + info->track = atoi(av_metadata_get(ic->metadata, "track", NULL, 0)->value); + if (av_metadata_get(ic->metadata, "title", NULL, 0) != NULL) + info->title = xstrdup (av_metadata_get(ic->metadata, "title", NULL, 0)->value); + if (av_metadata_get(ic->metadata, "author", NULL, 0) != NULL) + info->artist = xstrdup (av_metadata_get(ic->metadata, "author", NULL, 0)->value); + if (av_metadata_get(ic->metadata, "album", NULL, 0) != NULL) + info->album = xstrdup (av_metadata_get(ic->metadata, "album", NULL, 0)->value); } if (tags_sel & TAGS_TIME) @@ -127,7 +127,7 @@ static void *ffmpeg_open (const char *fi av_read_play (data->ic); for (i = 0; i < data->ic->nb_streams; i++) { data->enc = data->ic->streams[i]->codec; - if (data->enc->codec_type == CODEC_TYPE_AUDIO) { + if (data->enc->codec_type == AVMEDIA_TYPE_AUDIO) { audio_index = i; break; }