+static gboolean
+__mmplayer_is_audio_info_changed (MMHandleType hplayer, media_format_h fmt)
+{
+ mmplayer_t *player = (mmplayer_t *)hplayer;
+ gboolean ret = FALSE;
+ GstStructure *str = NULL;
+ media_format_mimetype_e mimetype = 0;
+ gint cur_samplerate = 0, samplerate = 0;
+ gint cur_channel = 0, channel = 0;
+
+ MMPLAYER_FENTER();
+
+ MMPLAYER_RETURN_VAL_IF_FAIL(player && player->a_stream_caps, FALSE);
+ MMPLAYER_RETURN_VAL_IF_FAIL(fmt, FALSE);
+
+ if (MMPLAYER_CURRENT_STATE(player) != MM_PLAYER_STATE_PAUSED &&
+ MMPLAYER_CURRENT_STATE(player) != MM_PLAYER_STATE_PLAYING) {
+ LOGW("skip update audio info, state: %s", MMPLAYER_STATE_GET_NAME(MMPLAYER_CURRENT_STATE(player)));
+ return FALSE;
+ }
+
+ str = gst_caps_get_structure(player->a_stream_caps, 0);
+ if (!str) {
+ LOGE("failed to get caps info");
+ return FALSE;
+ }
+
+ if (!gst_structure_get_int(str, "channels", &cur_channel))
+ LOGD("missing 'channel' field in audio caps");
+
+ if (!gst_structure_get_int(str, "rate", &cur_samplerate))
+ LOGD("missing 'rate' field in audio caps");
+
+ media_format_get_audio_info(fmt, &mimetype, &channel, &samplerate, NULL, NULL);
+ if ((cur_channel != channel) || (cur_samplerate != samplerate)) {
+ LOGW("audio info change channel(%d), samplerate(%d) -> %d, %d",
+ cur_channel, cur_samplerate, channel, samplerate);
+ _mmplayer_set_audio_info(hplayer, fmt);
+ ret = TRUE;
+ }
+
+ MMPLAYER_FLEAVE();
+ return ret;
+}
+