}
}
} else if (mimetype & MEDIA_FORMAT_AUDIO) {
+ gint channels = 0;
+ gint rate = 0;
+
ret = media_format_set_audio_mime(format, mimetype);
if (ret != MEDIA_FORMAT_ERROR_NONE) {
LOG_ERROR("failed to media_format_set_audio_mime()");
goto error;
}
+
+ gst_structure_get_int(structure, "channels", &channels);
+ gst_structure_get_int(structure, "rate", &rate);
+ if (channels > 0 && rate > 0) {
+ ret |= media_format_set_audio_channel(format, channels);
+ ret |= media_format_set_audio_samplerate(format, rate);
+ if (ret != MEDIA_FORMAT_ERROR_NONE) {
+ LOG_ERROR("failed to media_format_set_audio_channel/samplerate()");
+ goto error;
+ }
+ }
}
gst_caps_unref(caps);