diff options
author | Jiyong Min <jiyong.min@samsung.com> | 2016-04-28 18:42:28 +0900 |
---|---|---|
committer | Jiyong Min <jiyong.min@samsung.com> | 2016-04-28 18:47:27 +0900 |
commit | c31cd48d32e57eb3d2baaccc1d9adffd3f4412ad (patch) | |
tree | 8272cc3395263e59e793f493066a791af554eb08 | |
parent | e5ac9f2ed96657cfd6414ef01ce71ab754e20300 (diff) | |
download | libmedia-service-submit/tizen/20160509.073743.tar.gz libmedia-service-submit/tizen/20160509.073743.tar.bz2 libmedia-service-submit/tizen/20160509.073743.zip |
[TSAM-2420] modify media_type for .asf file from etc to video (mime_type is changed, so it is neccessary to check mime_type directly)submit/tizen/20160509.073743accepted/tizen/wearable/20160510.002211accepted/tizen/tv/20160510.002236accepted/tizen/mobile/20160510.002153accepted/tizen/ivi/20160510.002304accepted/tizen/common/20160509.135037
Change-Id: I01e7e3923903ac0cc935faa29fc406b3616d3cca
Signed-off-by: Jiyong Min <jiyong.min@samsung.com>
-rw-r--r-- | packaging/libmedia-service.spec | 2 | ||||
-rwxr-xr-x | src/common/media-svc-util.c | 26 |
2 files changed, 25 insertions, 3 deletions
diff --git a/packaging/libmedia-service.spec b/packaging/libmedia-service.spec index 425f07f..6a9bf90 100644 --- a/packaging/libmedia-service.spec +++ b/packaging/libmedia-service.spec @@ -1,6 +1,6 @@ Name: libmedia-service Summary: Media information service library for multimedia applications -Version: 0.2.66 +Version: 0.2.67 Release: 0 Group: Multimedia/Libraries License: Apache-2.0 and public domain diff --git a/src/common/media-svc-util.c b/src/common/media-svc-util.c index c933b4f..f25b3d3 100755 --- a/src/common/media-svc-util.c +++ b/src/common/media-svc-util.c @@ -415,9 +415,10 @@ static int __media_svc_get_content_type_from_mime(const char *path, const char * } } - /*in application type, exitst sound file ex) x-smafs */ + /*in application type, exitst sound file ex) x-smafs, asf */ if (*category & MEDIA_SVC_CATEGORY_ETC) { int prefix_len = strlen(content_category[0].content_type); + char *ext = NULL; for (idx = 0; idx < SOUND_MIME_NUM; idx++) { if (strstr(mimetype + prefix_len, sound_mime_table[idx]) != NULL) { @@ -431,6 +432,27 @@ static int __media_svc_get_content_type_from_mime(const char *path, const char * *category ^= MEDIA_SVC_CATEGORY_ETC; *category |= MEDIA_SVC_CATEGORY_SOUND; } + + /*"asf" must check video stream and then categorize in directly. */ + ext = strrchr(path, '.'); + if (ext != NULL) { + if (strncasecmp(ext, _ASF_FILE, 5) == 0) { + int audio = 0; + int video = 0; + int err = 0; + + err = mm_file_get_stream_info(path, &audio, &video); + if (err == 0) { + if (audio > 0 && video == 0) { + *category ^= MEDIA_SVC_CATEGORY_ETC; + *category |= MEDIA_SVC_CATEGORY_MUSIC; + } else { + *category ^= MEDIA_SVC_CATEGORY_ETC; + *category |= MEDIA_SVC_CATEGORY_VIDEO; + } + } + } + } } /*check music file in soun files. */ @@ -456,7 +478,7 @@ static int __media_svc_get_content_type_from_mime(const char *path, const char * /*"3gp" and "mp4" must check video stream and then categorize in directly. */ ext = strrchr(path, '.'); if (ext != NULL) { - if ((strncasecmp(ext, _3GP_FILE, 4) == 0) || (strncasecmp(ext, _MP4_FILE, 5) == 0) || (strncasecmp(ext, _ASF_FILE, 5) == 0)) { + if ((strncasecmp(ext, _3GP_FILE, 4) == 0) || (strncasecmp(ext, _MP4_FILE, 5) == 0)) { int audio = 0; int video = 0; int err = 0; |