* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#ifdef _USE_TV_PROFILE
+#ifdef _USE_TVPD_MODE
#include <media_info_private.h>
#include <media_util_private.h>
#include <media_uhd.h>
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;
- 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) {
_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);