- /* For now use the filename (without .py) as decoder name. */
- if ((tmp = g_strndup(dp->d_name, strlen(dp->d_name) - 3)))
- list_pds = g_slist_append(list_pds, tmp);
+
+ /* Decoder name == filename (without .py suffix). */
+ decodername = g_strndup(dp->d_name, strlen(dp->d_name) - 3);
+
+ /* TODO: Error handling. */
+ dec = malloc(sizeof(struct srd_decoder));
+
+ /* Load the decoder. */
+ ret = srd_load_decoder(decodername, &dec);
+
+ /* Append it to the list of supported/loaded decoders. */
+ list_pds = g_slist_append(list_pds, dec);