- if (_src != NULL) {
- video_meta_s *_dst = (video_meta_s*)calloc(1, sizeof(video_meta_s));
- media_content_retvm_if(_dst == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
-
- if (_src->media_id != NULL) {
- _dst->media_id = g_strdup(_src->media_id);
- if (_dst->media_id == NULL) {
- video_meta_destroy((video_meta_h)_dst);
- media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
- return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
- }
- }
-
- if (_src->title != NULL) {
- _dst->title = g_strdup(_src->title);
- if (_dst->title == NULL) {
- video_meta_destroy((video_meta_h)_dst);
- media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
- return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
- }
- }
-
- if (_src->album != NULL) {
- _dst->album = g_strdup(_src->album);
- if (_dst->album == NULL) {
- video_meta_destroy((video_meta_h)_dst);
- media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
- return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
- }
- }
-
- if (_src->artist != NULL) {
- _dst->artist = g_strdup(_src->artist);
- if (_dst->artist == NULL) {
- video_meta_destroy((video_meta_h)_dst);
- media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
- return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
- }
- }
-
- if (_src->album_artist != NULL) {
- _dst->album_artist = g_strdup(_src->album_artist);
- if (_dst->album_artist == NULL) {
- video_meta_destroy((video_meta_h)_dst);
- media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
- return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
- }
- }
-
- if (_src->genre != NULL) {
- _dst->genre = g_strdup(_src->genre);
- if (_dst->genre == NULL) {
- video_meta_destroy((video_meta_h)_dst);
- media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
- return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
- }
- }
-
- if (_src->composer != NULL) {
- _dst->composer = g_strdup(_src->composer);
- if (_dst->composer == NULL) {
- video_meta_destroy((video_meta_h)_dst);
- media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
- return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
- }
- }
-
- if (_src->year != NULL) {
- _dst->year = g_strdup(_src->year);
- if (_dst->year == NULL) {
- video_meta_destroy((video_meta_h)_dst);
- media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
- return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
- }
- }
-
- if (_src->recorded_date != NULL) {
- _dst->recorded_date = g_strdup(_src->recorded_date);
- if (_dst->recorded_date == NULL) {
- video_meta_destroy((video_meta_h)_dst);
- media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
- return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
- }
- }
-
- if (_src->copyright != NULL) {
- _dst->copyright = g_strdup(_src->copyright);
- if (_dst->copyright == NULL) {
- video_meta_destroy((video_meta_h)_dst);
- media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
- return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
- }
- }
-
- if (_src->track_num != NULL) {
- _dst->track_num = g_strdup(_src->track_num);
- if (_dst->track_num == NULL) {
- video_meta_destroy((video_meta_h)_dst);
- media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
- return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
- }
- }
-
- _dst->bitrate = _src->bitrate;
- _dst->duration = _src->duration;
- _dst->width = _src->width;
- _dst->height = _src->height;
- _dst->played_count = _src->played_count;
- _dst->played_time = _src->played_time;
- _dst->played_position = _src->played_position;
-
- *dst = (video_meta_h)_dst;
-
- ret = MEDIA_CONTENT_ERROR_NONE;
- } else {
- media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
- ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
- }
-
- return ret;
+ content_retip_if_fail(dst);
+ content_retip_if_fail(src);
+
+ video_meta_s *_dst = g_new(video_meta_s, 1);
+
+ _dst->media_id = g_strdup(_src->media_id);
+ _dst->album = g_strdup(_src->album);
+ _dst->artist = g_strdup(_src->artist);
+ _dst->album_artist = g_strdup(_src->album_artist);
+ _dst->genre = g_strdup(_src->genre);
+ _dst->composer = g_strdup(_src->composer);
+ _dst->year = g_strdup(_src->year);
+ _dst->recorded_date = g_strdup(_src->recorded_date);
+ _dst->copyright = g_strdup(_src->copyright);
+ _dst->track_num = g_strdup(_src->track_num);
+ _dst->bitrate = _src->bitrate;
+ _dst->duration = _src->duration;
+ _dst->width = _src->width;
+ _dst->height = _src->height;
+ _dst->rotation = _src->rotation;
+
+ *dst = (video_meta_h)_dst;
+
+ return MEDIA_CONTENT_ERROR_NONE;