summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2011-04-07 22:21:56 +0200
committerGravatar waker <wakeroid@gmail.com>2011-04-07 22:21:56 +0200
commitd59be35ebb660d61e2856266d8d6d1188e1f2f5b (patch)
treef6ed9408a0dcc140dbc3d145a4006d2ee9887886
parent13c344f5b64792045645d9d3461a5a4d56111d34 (diff)
ffmpeg: get filetype from codec instead of predefined set
-rw-r--r--plugins/ffmpeg/ffmpeg.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/plugins/ffmpeg/ffmpeg.c b/plugins/ffmpeg/ffmpeg.c
index f0d3d5e6..020f2a1c 100644
--- a/plugins/ffmpeg/ffmpeg.c
+++ b/plugins/ffmpeg/ffmpeg.c
@@ -71,7 +71,7 @@ enum {
FT_UNKNOWN = 5
};
-static const char *filetypes[] = { "ALAC", "WMA", "ATRAC3", "VQF", "AC3", "AMR", "FFMPEG (unknown)", NULL };
+static const char *filetypes[] = { "FFMPEG", NULL };
#define FF_PROTOCOL_NAME "deadbeef"
@@ -165,21 +165,7 @@ ffmpeg_init (DB_fileinfo_t *_info, DB_playItem_t *it) {
return -1;
}
- if (!strcasecmp (info->codec->name, "alac")) {
- deadbeef->pl_replace_meta (it, ":FILETYPE", filetypes[FT_ALAC]);
- }
- else if (strcasestr (info->codec->name, "wma")) {
- deadbeef->pl_replace_meta (it, ":FILETYPE", filetypes[FT_WMA]);
- }
- else if (strcasestr (info->codec->name, "ac3")) {
- deadbeef->pl_replace_meta (it, ":FILETYPE", filetypes[FT_AC3]);
- }
- else if (strcasestr (info->codec->name, "amr")) {
- deadbeef->pl_replace_meta (it, ":FILETYPE", filetypes[FT_AMR]);
- }
- else {
- deadbeef->pl_replace_meta (it, ":FILETYPE", filetypes[FT_UNKNOWN]);
- }
+ deadbeef->pl_replace_meta (it, ":FILETYPE", info->codec->name);
int bps = av_get_bits_per_sample_format (info->ctx->sample_fmt);
int samplerate = info->ctx->sample_rate;
@@ -543,7 +529,7 @@ ffmpeg_insert (DB_playItem_t *after, const char *fname) {
DB_playItem_t *it = deadbeef->pl_item_alloc_init (fname, plugin.plugin.id);
// FIXME: get proper codec
- deadbeef->pl_add_meta (it, ":FILETYPE", filetypes[FT_UNKNOWN]);
+ deadbeef->pl_replace_meta (it, ":FILETYPE", codec->name);
if (!deadbeef->is_local_file (deadbeef->pl_find_meta (it, ":URI"))) {
deadbeef->pl_set_item_duration (it, -1);