Pick up metadata from the selected stream(s) in addition to the file itself

OGG has per-stream metadata; recent versions of ffmpeg report metadata
per-stream in this case.
This commit is contained in:
Julien BLACHE 2010-03-22 18:22:39 +01:00
parent c2f64e4280
commit 4da80edc3f
1 changed files with 28 additions and 2 deletions

View File

@ -402,14 +402,40 @@ scan_metadata_ffmpeg(char *file, struct media_file_info *mfi)
mdcount = 0;
if (ctx->metadata == NULL)
if ((!ctx->metadata) && (!ctx->streams[audio_stream]->metadata)
&& ((video_stream != -1) && (!ctx->streams[video_stream]->metadata)))
{
DPRINTF(E_WARN, L_SCAN, "ffmpeg reports no metadata\n");
goto skip_extract;
}
mdcount += extract_metadata(mfi, ctx->metadata);
if (ctx->metadata)
{
ret = extract_metadata(mfi, ctx->metadata);
DPRINTF(E_DBG, L_SCAN, "Picked up %d tags from file metadata\n", ret);
mdcount += ret;
}
if (ctx->streams[audio_stream]->metadata)
{
ret = extract_metadata(mfi, ctx->streams[audio_stream]->metadata);
DPRINTF(E_DBG, L_SCAN, "Picked up %d tags from audio stream metadata\n", ret);
mdcount += ret;
}
if ((video_stream != -1) && (ctx->streams[video_stream]->metadata))
{
ret = extract_metadata(mfi, ctx->streams[video_stream]->metadata);
DPRINTF(E_DBG, L_SCAN, "Picked up %d tags from video stream metadata\n", ret);
mdcount += ret;
}
/* fix up TV metadata */
if (mfi->media_kind == 10)