Merge remote branch 'refs/remotes/fml/master'
[paraslash.git] / aacdec_filter.c
index 5b84d07e12c4757c4393e0d5da54a3bcbed499a9..1127fc1132b90d56169c34d732c9343e47e8fa43 100644 (file)
@@ -52,7 +52,7 @@ struct private_aacdec_data {
        /** The number of channels of the current stream. */
        unsigned int channels;
        /** Current sample rate in Hz. */
-       unsigned int samplerate;
+       unsigned int sample_rate;
 };
 
 static int aacdec_execute(struct btr_node *btrn, const char *cmd, char **result)
@@ -60,19 +60,7 @@ static int aacdec_execute(struct btr_node *btrn, const char *cmd, char **result)
        struct filter_node *fn = btr_context(btrn);
        struct private_aacdec_data *padd = fn->private_data;
 
-       if (!strcmp(cmd, "samplerate")) {
-               if (padd->samplerate == 0)
-                       return -E_BTR_NAVAIL;
-               *result = make_message("%u", padd->samplerate);
-               return 1;
-       }
-       if (!strcmp(cmd, "channels")) {
-               if (padd->channels == 0)
-                       return -E_BTR_NAVAIL;
-               *result = make_message("%u", padd->channels);
-               return 1;
-       }
-       return -ERRNO_TO_PARA_ERROR(ENOTSUP);
+       return decoder_execute(cmd, padd->sample_rate, padd->channels, result);
 }
 
 static void aacdec_open(struct filter_node *fn)
@@ -140,10 +128,10 @@ next_buffer:
                                        &channels) < 0)
                                goto out;
                }
-               padd->samplerate = rate;
+               padd->sample_rate = rate;
                padd->channels = channels;
                PARA_INFO_LOG("rate: %u, channels: %d\n",
-                       padd->samplerate, padd->channels);
+                       padd->sample_rate, padd->channels);
                padd->initialized = 1;
        }
        if (padd->decoder_length > 0) {