]> git.alsa-project.org Git - tinycompress.git/commitdiff
fcplay: Add multiple audio files playback support
authorMohammad Rafi Shaik <quic_mohs@quicinc.com>
Thu, 28 Sep 2023 05:34:19 +0000 (11:04 +0530)
committerJaroslav Kysela <perex@perex.cz>
Wed, 22 Nov 2023 08:07:14 +0000 (09:07 +0100)
This patch will add changes which is required to play
multiple audio files.

The file_count variable is required for index validation and play
multiple audio files.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mohammad Rafi Shaik <quic_mohs@quicinc.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
src/utils-lgpl/fcplay.c

index 83d48a06326cf76a74a659caa4e9d1a7446a9671..ef222fb395d797f9189c3306fa614df6c537bf0b 100644 (file)
@@ -62,7 +62,8 @@ static void usage(void)
                "-h\tPrints this help list\n\n"
                "Example:\n"
                "\tfcplay -c 1 -d 2 test.mp3\n"
-               "\tfcplay -f 5 test.mp3\n\n"
+               "\tfcplay -f 5 test.mp3\n"
+               "\tfcplay -c 1 -d 2 test1.mp3 test2.mp3\n\n"
                "Valid codec IDs:\n");
 
        for (i = 0; i < CPLAY_NUM_CODEC_IDS; ++i)
@@ -94,11 +95,12 @@ static int print_time(struct compress *compress)
 
 int main(int argc, char **argv)
 {
-       char *file;
+       char **file;
        unsigned long buffer_size = 0;
        int c, i;
        unsigned int card = 0, device = 0, frag = 0;
        unsigned int codec_id = SND_AUDIOCODEC_MP3;
+       unsigned int file_count = 0;
 
        if (argc < 2)
                usage();
@@ -150,9 +152,12 @@ int main(int argc, char **argv)
        if (optind >= argc)
                usage();
 
-       file = argv[optind];
+       file = &argv[optind];
 
-       play_samples(file, card, device, buffer_size, frag, codec_id);
+       //file_count represents total number of files to play
+       file_count = argc - optind;
+
+       play_samples(file, card, device, buffer_size, frag, codec_id, file_count);
 
        fprintf(stderr, "Finish Playing.... Close Normally\n");
        exit(EXIT_SUCCESS);