{
mmplayer_t *player = (mmplayer_t *)hplayer;
int ret = MM_ERROR_NONE;
- int rm_ret = MM_ERROR_NONE;
mmplayer_resource_type_e res_idx = MMPLAYER_RESOURCE_TYPE_MAX;
MMPLAYER_FENTER();
GstElementFactory *factory = NULL;
guint new_pos = DEFAULT_IDX;
guint rm_pos = DEFAULT_IDX;
- const gchar *klass = NULL;
- gchar *factory_name = NULL;
guint hw_dec_idx = DEFAULT_IDX;
guint first_sw_dec_idx = DEFAULT_IDX;
guint last_sw_dec_idx = DEFAULT_IDX;
#endif
for (int i = 0 ; i < factories->n_values ; i++) {
+ const gchar *klass = NULL;
+ gchar *factory_name = NULL;
gchar *hw_dec_info = NULL;
gchar (*sw_dec_info)[PLAYER_INI_MAX_STRLEN] = {NULL, };
factory = g_value_get_object(g_value_array_get_nth(factories, i));
continue;
}
+ if (!factory_name) {
+ LOGW("Factory name is NULL");
+ continue;
+ }
+
if (g_strrstr(factory_name, hw_dec_info)) {
hw_dec_idx = i;
- } else {
- for (int j = 0; sw_dec_info[j][0] != '\0'; j++) {
- if (factory_name && strstr(factory_name, sw_dec_info[j])) {
- last_sw_dec_idx = i;
- if (first_sw_dec_idx == DEFAULT_IDX) {
- first_sw_dec_idx = i;
- }
- }
- }
+ continue;
+ }
- if (first_sw_dec_idx == DEFAULT_IDX) {
- if (factory_name)
- LOGW("unknown codec %s", factory_name);
+ for (int j = 0; sw_dec_info[j][0] != '\0'; j++) {
+ if (g_strrstr(factory_name, sw_dec_info[j])) {
+ last_sw_dec_idx = i;
+ if (first_sw_dec_idx == DEFAULT_IDX)
+ first_sw_dec_idx = i;
}
}
+
+ if (first_sw_dec_idx == DEFAULT_IDX)
+ LOGW("unknown codec %s", factory_name);
}
if (hw_dec_idx == DEFAULT_IDX || first_sw_dec_idx == DEFAULT_IDX)
ret = rm_allocate_resources(player->res.handle, &request_resources, device);
if (ret != RM_OK) {
LOGW("Resource allocation request failed ret %d [error type %d]", ret, device->error_type);
- MM_ERROR_PLAYER_INTERNAL;
+ return MM_ERROR_PLAYER_INTERNAL;
}
for (idx = 0; idx < device->allocated_num; idx++)
return MM_ERROR_NONE;
}
#endif /* RM_COMMON */
-