Skip files that have no audio streams

This commit is contained in:
Julien BLACHE 2009-11-01 12:52:30 +01:00
parent 9b56d51f92
commit 6cc9abadbd
1 changed files with 8 additions and 0 deletions

View File

@ -159,6 +159,14 @@ scan_metadata_ffmpeg(char *file, struct media_file_info *mfi)
} }
} }
if (audio_codec_id == CODEC_ID_NONE)
{
DPRINTF(E_DBG, L_SCAN, "File has no audio streams, discarding\n");
av_close_input_file(ctx);
return -1;
}
/* Common media information */ /* Common media information */
if (ctx->duration > 0) if (ctx->duration > 0)
mfi->song_length = ctx->duration / (AV_TIME_BASE / 1000); /* ms */ mfi->song_length = ctx->duration / (AV_TIME_BASE / 1000); /* ms */