Improve readability of media_audio
[platform/core/api/media-content.git] / src / media_audio.c
old mode 100755 (executable)
new mode 100644 (file)
index 073d75a..8269df3
 
 #include <media_info_private.h>
 
-
 int audio_meta_destroy(audio_meta_h audio)
 {
-       int ret = MEDIA_CONTENT_ERROR_NONE;
        audio_meta_s *_audio = (audio_meta_s*)audio;
-
-       if(_audio)
-       {
-               SAFE_FREE(_audio->media_id);
-               SAFE_FREE(_audio->title);
-               SAFE_FREE(_audio->album);
-               SAFE_FREE(_audio->artist);
-               SAFE_FREE(_audio->album_artist);
-               SAFE_FREE(_audio->genre);
-               SAFE_FREE(_audio->composer);
-               SAFE_FREE(_audio->year);
-               SAFE_FREE(_audio->recorded_date);
-               SAFE_FREE(_audio->copyright);
-               SAFE_FREE(_audio->track_num);
-               SAFE_FREE(_audio);
-
-               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;
+       media_content_retvm_if(_audio == NULL, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Audio handle is null");
+
+       SAFE_FREE(_audio->media_id);
+       SAFE_FREE(_audio->album);
+       SAFE_FREE(_audio->artist);
+       SAFE_FREE(_audio->album_artist);
+       SAFE_FREE(_audio->genre);
+       SAFE_FREE(_audio->composer);
+       SAFE_FREE(_audio->year);
+       SAFE_FREE(_audio->recorded_date);
+       SAFE_FREE(_audio->copyright);
+       SAFE_FREE(_audio->track_num);
+       SAFE_FREE(_audio);
+
+       return MEDIA_CONTENT_ERROR_NONE;
 }
 
 int audio_meta_clone(audio_meta_h *dst, audio_meta_h src)
 {
-       int ret = MEDIA_CONTENT_ERROR_NONE;
        audio_meta_s *_src = (audio_meta_s*)src;
-
-       if(_src != NULL)
-       {
-               audio_meta_s *_dst = (audio_meta_s*)calloc(1, sizeof(audio_meta_s));
-               media_content_retvm_if(_dst == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "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->album_artist))
-               {
-                       _dst->album_artist = strdup(_src->album_artist);
-                       if(_dst->album_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->bitpersample = _src->bitpersample;
-               _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;
+       media_content_retvm_if(_src == NULL, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Source handle is null");
+
+       audio_meta_s *_dst = (audio_meta_s*)calloc(1, sizeof(audio_meta_s));
+       media_content_retvm_if(_dst == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
+
+       _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;
 }
 
 int audio_meta_get_media_id(audio_meta_h audio, char **media_id)
 {
-       int ret = MEDIA_CONTENT_ERROR_NONE;
        audio_meta_s *_audio = (audio_meta_s*)audio;
-       if(_audio)
-       {
-               if(STRING_VALID(_audio->media_id))
-               {
-                       *media_id = strdup(_audio->media_id);
-                       media_content_retvm_if(*media_id == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
-               }
-               else
-               {
-                       *media_id = NULL;
-               }
-               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;
+       media_content_retvm_if(!_audio || !media_id, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid parameter");
+
+       *media_id = g_strdup(_audio->media_id);
+
+       return MEDIA_CONTENT_ERROR_NONE;
 }
 
 int audio_meta_get_album(audio_meta_h audio, char **album)
 {
-       int ret = MEDIA_CONTENT_ERROR_NONE;
        audio_meta_s *_audio = (audio_meta_s*)audio;
-       if(_audio)
-       {
-               if(STRING_VALID(_audio->album))
-               {
-                       *album = strdup(_audio->album);
-                       media_content_retvm_if(*album == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
-               }
-               else
-               {
-                       *album = NULL;
-               }
-               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;
+       media_content_retvm_if(!_audio || !album, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid parameter");
+
+       /*album can be empty string*/
+       *album = g_strdup(_audio->album);
+
+       return MEDIA_CONTENT_ERROR_NONE;
 }
 
 int audio_meta_get_artist(audio_meta_h audio, char **artist)
 {
-       int ret = MEDIA_CONTENT_ERROR_NONE;
        audio_meta_s *_audio = (audio_meta_s*)audio;
+       media_content_retvm_if(!_audio || !artist, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid parameter");
+
+       /*artist can be empty string*/
+       *artist = g_strdup(_audio->artist);
 
-       if(_audio)
-       {
-               if(STRING_VALID(_audio->artist))
-               {
-                       *artist = strdup(_audio->artist);
-                       media_content_retvm_if(*artist == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
-               }
-               else
-               {
-                       *artist = NULL;
-               }
-               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;
+       return MEDIA_CONTENT_ERROR_NONE;
 }
 
 int audio_meta_get_album_artist(audio_meta_h audio, char **album_artist)
 {
-       int ret = MEDIA_CONTENT_ERROR_NONE;
        audio_meta_s *_audio = (audio_meta_s*)audio;
+       media_content_retvm_if(!_audio || !album_artist, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid parameter");
 
-       if(_audio)
-       {
-               if(STRING_VALID(_audio->album_artist))
-               {
-                       *album_artist = strdup(_audio->album_artist);
-                       media_content_retvm_if(*album_artist == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
-               }
-               else
-               {
-                       *album_artist = NULL;
-               }
-               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;
+       /*album_artist can be empty string*/
+       *album_artist = g_strdup(_audio->album_artist);
+
+       return MEDIA_CONTENT_ERROR_NONE;
 }
 
 int audio_meta_get_genre(audio_meta_h audio, char **genre)
 {
-       int ret = MEDIA_CONTENT_ERROR_NONE;
        audio_meta_s *_audio = (audio_meta_s*)audio;
+       media_content_retvm_if(!_audio || !genre, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid parameter");
+
+       /*genre can be empty string*/
+       *genre = g_strdup(_audio->genre);
 
-       if(_audio)
-       {
-               if(STRING_VALID(_audio->genre))
-               {
-                       *genre = strdup(_audio->genre);
-                       media_content_retvm_if(*genre == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
-               }
-               else
-               {
-                       *genre = NULL;
-               }
-
-               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;
+       return MEDIA_CONTENT_ERROR_NONE;
 }
 
 int audio_meta_get_composer(audio_meta_h audio, char **composer)
 {
-       int ret = MEDIA_CONTENT_ERROR_NONE;
        audio_meta_s *_audio = (audio_meta_s*)audio;
+       media_content_retvm_if(!_audio || !composer, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid parameter");
 
-       if(_audio)
-       {
-               if(STRING_VALID(_audio->composer))
-               {
-                       *composer = strdup(_audio->composer);
-                       media_content_retvm_if(*composer == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
-               }
-               else
-               {
-                       *composer = NULL;
-               }
-
-               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;
+       /*composer can be empty string*/
+       *composer = g_strdup(_audio->composer);
+
+       return MEDIA_CONTENT_ERROR_NONE;
 }
 
 int audio_meta_get_year(audio_meta_h audio, char **year)
 {
-       int ret = MEDIA_CONTENT_ERROR_NONE;
        audio_meta_s *_audio = (audio_meta_s*)audio;
+       media_content_retvm_if(!_audio || !year, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid parameter");
+
+       /*year can be empty string*/
+       *year = g_strdup(_audio->year);
 
-       if(_audio)
-       {
-               if(STRING_VALID(_audio->year))
-               {
-                       *year = strdup(_audio->year);
-                       media_content_retvm_if(*year == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
-               }
-               else
-               {
-                       *year = NULL;
-               }
-
-               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;
+       return MEDIA_CONTENT_ERROR_NONE;
 }
 
 int audio_meta_get_recorded_date(audio_meta_h audio, char **recorded_date)
 {
-       int ret = MEDIA_CONTENT_ERROR_NONE;
        audio_meta_s *_audio = (audio_meta_s*)audio;
+       media_content_retvm_if(!_audio || !recorded_date, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid parameter");
+
+       *recorded_date = g_strdup(_audio->recorded_date);
 
-       if(_audio)
-       {
-               if(STRING_VALID(_audio->recorded_date))
-               {
-                       *recorded_date = strdup(_audio->recorded_date);
-                       media_content_retvm_if(*recorded_date == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
-               }
-               else
-               {
-                       *recorded_date = NULL;
-               }
-
-               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;
+       return MEDIA_CONTENT_ERROR_NONE;
 }
 
 int audio_meta_get_copyright(audio_meta_h audio, char **copyright)
 {
-       int ret = MEDIA_CONTENT_ERROR_NONE;
        audio_meta_s *_audio = (audio_meta_s*)audio;
+       media_content_retvm_if(!_audio || !copyright, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid parameter");
 
-       if(_audio)
-       {
-               if(STRING_VALID(_audio->copyright))
-               {
-                       *copyright = strdup(_audio->copyright);
-                       media_content_retvm_if(*copyright == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
-               }
-               else
-               {
-                       *copyright = NULL;
-               }
-
-               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;
+       /*copyright can be empty string*/
+       *copyright = g_strdup(_audio->copyright);
+
+       return MEDIA_CONTENT_ERROR_NONE;
 }
 
 int audio_meta_get_track_num(audio_meta_h audio, char **track_num)
 {
-       int ret = MEDIA_CONTENT_ERROR_NONE;
        audio_meta_s *_audio = (audio_meta_s*)audio;
+       media_content_retvm_if(!_audio || !track_num, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid parameter");
+
+       /*track_num can be empty string*/
+       *track_num = g_strdup(_audio->track_num);
 
-       if(_audio)
-       {
-               if(STRING_VALID(_audio->track_num))
-               {
-                       *track_num = strdup(_audio->track_num);
-                       media_content_retvm_if(*track_num == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
-               }
-               else
-               {
-                       *track_num = NULL;
-               }
-
-               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;
+       return MEDIA_CONTENT_ERROR_NONE;
 }
 
 int audio_meta_get_bit_rate(audio_meta_h audio, int *bit_rate)
 {
-       int ret = MEDIA_CONTENT_ERROR_NONE;
        audio_meta_s *_audio = (audio_meta_s*)audio;
+       media_content_retvm_if(!_audio || !bit_rate, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid parameter");
 
-       if(_audio && bit_rate)
-       {
-               *bit_rate = _audio->bitrate;
-               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;
+       *bit_rate = _audio->bitrate;
+
+       return MEDIA_CONTENT_ERROR_NONE;
 }
 
 int audio_meta_get_bitpersample(audio_meta_h audio, int *bitpersample)
 {
-       int ret = MEDIA_CONTENT_ERROR_NONE;
        audio_meta_s *_audio = (audio_meta_s*)audio;
+       media_content_retvm_if(!_audio || !bitpersample, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid parameter");
+
+       *bitpersample = _audio->bitpersample;
 
-       if(_audio && bitpersample)
-       {
-               *bitpersample = _audio->bitpersample;
-               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;
+       return MEDIA_CONTENT_ERROR_NONE;
 }
 
 int audio_meta_get_sample_rate(audio_meta_h audio, int *sample_rate)
 {
-       int ret = MEDIA_CONTENT_ERROR_NONE;
        audio_meta_s *_audio = (audio_meta_s*)audio;
+       media_content_retvm_if(!_audio || !sample_rate, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid parameter");
 
-       if(_audio && sample_rate)
-       {
-               *sample_rate = _audio->samplerate;
-               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;
+       *sample_rate = _audio->samplerate;
+
+       return MEDIA_CONTENT_ERROR_NONE;
 }
 
 int audio_meta_get_channel(audio_meta_h audio, int *channel)
 {
-       int ret = MEDIA_CONTENT_ERROR_NONE;
        audio_meta_s *_audio = (audio_meta_s*)audio;
+       media_content_retvm_if(!_audio || !channel, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid parameter");
+
+       *channel = _audio->channel;
 
-       if(_audio && channel)
-       {
-               *channel = _audio->channel;
-               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;
+       return MEDIA_CONTENT_ERROR_NONE;
 }
 
 int audio_meta_get_duration(audio_meta_h audio, int *duration)
 {
-       int ret = MEDIA_CONTENT_ERROR_NONE;
        audio_meta_s *_audio = (audio_meta_s*)audio;
+       media_content_retvm_if(!_audio || !duration, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid parameter");
 
-       if(_audio)
-       {
-               *duration = _audio->duration;
-               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;
-}
-
-int audio_meta_get_played_count(audio_meta_h audio, int *played_count)
-{
-       int ret = MEDIA_CONTENT_ERROR_NONE;
-       audio_meta_s *_audio = (audio_meta_s*)audio;
+       *duration = _audio->duration;
 
-       if(_audio)
-       {
-               *played_count = _audio->played_count;
-               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;
+       return MEDIA_CONTENT_ERROR_NONE;
 }
 
+#ifdef TIZEN_FEATURE_COMPATIBILITY
 int audio_meta_get_played_time(audio_meta_h audio, time_t* played_time)
 {
-       int ret = MEDIA_CONTENT_ERROR_NONE;
-       audio_meta_s *_audio = (audio_meta_s*)audio;
+       media_content_warn("DEPRECATION WARNING: audio_meta_get_played_time() is removed from 5.5.");
 
-       if(_audio)
-       {
-               *played_time = _audio->played_time;
-               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;
+       return MEDIA_CONTENT_ERROR_NONE;
 }
 
-int audio_meta_get_played_position(audio_meta_h audio, int *played_position)
+int audio_meta_get_played_count(audio_meta_h audio, int *played_count)
 {
-       int ret = MEDIA_CONTENT_ERROR_NONE;
-       audio_meta_s *_audio = (audio_meta_s*)audio;
+       media_content_warn("DEPRECATION WARNING: audio_meta_get_played_count() is removed from 5.5.");
 
-       if(_audio)
-       {
-               *played_position = _audio->played_position;
-               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;
+       return MEDIA_CONTENT_ERROR_NONE;
 }
 
 int audio_meta_set_played_count(audio_meta_h audio, int played_count)
 {
-       int ret = MEDIA_CONTENT_ERROR_NONE;
-
-       audio_meta_s *_audio = (audio_meta_s*)audio;
+       media_content_warn("DEPRECATION WARNING: audio_meta_set_played_count() is removed from 5.5.");
 
-       if((_audio != NULL) && (played_count >= 0))
-       {
-               _audio->played_count = played_count;
-       }
-       else
-       {
-               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
-               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
-       }
-
-       return ret;
+       return MEDIA_CONTENT_ERROR_NONE;
 }
 
 int audio_meta_set_played_time(audio_meta_h audio, time_t played_time)
 {
-       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_content_warn("DEPRECATION WARNING: audio_meta_set_played_time() is removed from 5.5.");
 
-       audio_meta_s *_audio = (audio_meta_s*)audio;
-
-       if((_audio != NULL) && (played_time >= 0))
-       {
-               _audio->played_time = played_time;
-       }
-       else
-       {
-               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
-               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
-       }
-
-       return ret;
-}
-
-int audio_meta_set_played_position(audio_meta_h audio, int played_position)
-{
-       int ret = MEDIA_CONTENT_ERROR_NONE;
-       audio_meta_s *_audio = (audio_meta_s*)audio;
-
-       if((_audio != NULL) && (played_position >= 0))
-       {
-               _audio->played_position = played_position;
-       }
-       else
-       {
-               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
-               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
-       }
-
-       return ret;
+       return MEDIA_CONTENT_ERROR_NONE;
 }
 
 int audio_meta_update_to_db(audio_meta_h audio)
 {
-       int ret = MEDIA_CONTENT_ERROR_NONE;
-       audio_meta_s *_audio = (audio_meta_s*)audio;
-       char *sql = NULL;
-
-       if(_audio != NULL && STRING_VALID(_audio->media_id))
-       {
-               char storage_id[MEDIA_CONTENT_UUID_SIZE+1] = {0,};
-               memset(storage_id, 0x00, sizeof(storage_id));
-
-               ret = _media_db_get_storage_id_by_media_id(_audio->media_id, storage_id);
-               media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
-
-               sql = sqlite3_mprintf(UPDATE_AV_META_FROM_MEDIA, storage_id, _audio->played_count, _audio->played_time, _audio->played_position, _audio->media_id);
-               ret = _content_query_sql(sql);
-               SQLITE3_SAFE_FREE(sql);
-       }
-       else
-       {
-               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
-               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
-       }
-
-       return ret;
+       media_content_warn("DEPRECATION WARNING: audio_meta_update_to_db() is removed from 5.5.");
+
+       return MEDIA_CONTENT_ERROR_NONE;
 }
+#endif
\ No newline at end of file