- if(_src != NULL)
- {
- audio_meta_s *_dst = (audio_meta_s*)calloc(1, sizeof(audio_meta_s));
-
- if(_dst == NULL)
- {
-
- media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
- return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
- }
-
- if(STRING_VALID(_src->media_id))
- {
- _dst->media_id = strdup(_src->media_id);
- if(_dst->media_id == NULL)
- {
- audio_meta_destroy((audio_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(STRING_VALID(_src->title))
- {
- _dst->title = strdup(_src->title);
- if(_dst->title == NULL)
- {
- audio_meta_destroy((audio_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(STRING_VALID(_src->album))
- {
- _dst->album = strdup(_src->album);
- if(_dst->album == NULL)
- {
- audio_meta_destroy((audio_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(STRING_VALID(_src->artist))
- {
- _dst->artist = strdup(_src->artist);
- if(_dst->artist == NULL)
- {
- audio_meta_destroy((audio_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(STRING_VALID(_src->genre))
- {
- _dst->genre = strdup(_src->genre);
- if(_dst->genre == NULL)
- {
- audio_meta_destroy((audio_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(STRING_VALID(_src->composer))
- {
- _dst->composer = strdup(_src->composer);
- if(_dst->composer == NULL)
- {
- audio_meta_destroy((audio_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(STRING_VALID(_src->year))
- {
- _dst->year = strdup(_src->year);
- if(_dst->year == NULL)
- {
- audio_meta_destroy((audio_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(STRING_VALID(_src->recorded_date))
- {
- _dst->recorded_date = strdup(_src->recorded_date);
- if(_dst->recorded_date == NULL)
- {
- audio_meta_destroy((audio_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(STRING_VALID(_src->copyright))
- {
- _dst->copyright = strdup(_src->copyright);
- if(_dst->copyright == NULL)
- {
- audio_meta_destroy((audio_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(STRING_VALID(_src->track_num))
- {
- _dst->track_num = strdup(_src->track_num);
- if(_dst->track_num == NULL)
- {
- audio_meta_destroy((audio_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->samplerate = _src->samplerate;
- _dst->channel = _src->channel;
- _dst->duration = _src->duration;
- _dst->played_count = _src->played_count;
- _dst->played_time = _src->played_time;
- _dst->played_position = _src->played_position;
-
- *dst = (audio_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);
+
+ audio_meta_s *_dst = g_new0(audio_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->bitpersample = _src->bitpersample;
+ _dst->samplerate = _src->samplerate;
+ _dst->channel = _src->channel;
+ _dst->duration = _src->duration;
+
+ *dst = (audio_meta_h)_dst;
+
+ return MEDIA_CONTENT_ERROR_NONE;