projects
/
platform
/
core
/
api
/
media-content.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Block path replacement(temporary)" into tizen
[platform/core/api/media-content.git]
/
src
/
media_uhd.c
diff --git
a/src/media_uhd.c
b/src/media_uhd.c
index
a7b79ec
..
082f42c
100755
(executable)
--- a/
src/media_uhd.c
+++ b/
src/media_uhd.c
@@
-13,7
+13,7
@@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#ifdef _USE_TV
_PROFIL
E
+#ifdef _USE_TV
PD_MOD
E
#include <media_info_private.h>
#include <media_util_private.h>
#include <media_uhd.h>
#include <media_info_private.h>
#include <media_util_private.h>
#include <media_uhd.h>
@@
-173,16
+173,13
@@
int media_uhd_get_uhd_from_db(const char *media_id, media_uhd_h *uhd)
select_query = sqlite3_mprintf(SELECT_UHD_FROM_UHD, media_id);
select_query = sqlite3_mprintf(SELECT_UHD_FROM_UHD, media_id);
- ret = _content_
query_prepare(&stmt, select_query, NULL, NULL
);
-
sqlite3_free
(select_query);
+ ret = _content_
get_result(select_query, &stmt
);
+
SQLITE3_SAFE_FREE
(select_query);
media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
media_uhd_s *_uhd = NULL;
media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
media_uhd_s *_uhd = NULL;
- while (sqlite3_step(stmt) == SQLITE_ROW) {
- if (_uhd)
- media_uhd_destroy((media_uhd_h)_uhd);
-
+ if (sqlite3_step(stmt) == SQLITE_ROW) {
_uhd = (media_uhd_s*)calloc(1, sizeof(media_uhd_s));
if (_uhd == NULL) {
_uhd = (media_uhd_s*)calloc(1, sizeof(media_uhd_s));
if (_uhd == NULL) {
@@
-194,6
+191,9
@@
int media_uhd_get_uhd_from_db(const char *media_id, media_uhd_h *uhd)
_media_uhd_item_get_detail(stmt, (media_uhd_h)_uhd);
*uhd = (media_uhd_h)_uhd;
_media_uhd_item_get_detail(stmt, (media_uhd_h)_uhd);
*uhd = (media_uhd_h)_uhd;
+ } else {
+ media_content_error("Nonexistent media id[%s]", media_id);
+ ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
SQLITE3_FINALIZE(stmt);
}
SQLITE3_FINALIZE(stmt);