From d8ea220aadf238e02b54d722c4bc452bf9eeec60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Fri, 25 Jul 2025 19:15:01 +0200 Subject: [PATCH] clapper-app: Remove claps handling code It is now handled inside playlist demuxer, with the other playlist formats --- src/bin/clapper-app/clapper-app-application.c | 65 +------------------ 1 file changed, 2 insertions(+), 63 deletions(-) diff --git a/src/bin/clapper-app/clapper-app-application.c b/src/bin/clapper-app/clapper-app-application.c index 3d682fe9..6ecef41b 100644 --- a/src/bin/clapper-app/clapper-app-application.c +++ b/src/bin/clapper-app/clapper-app-application.c @@ -642,18 +642,6 @@ clapper_app_application_command_line (GApplication *app, GApplicationCommandLine return EXIT_SUCCESS; } -static gboolean -_is_claps_file (GFile *file) -{ - gchar *basename = g_file_get_basename (file); - gboolean is_claps; - - is_claps = (basename && g_str_has_suffix (basename, ".claps")); - g_free (basename); - - return is_claps; -} - static void add_item_from_file (GFile *file, ClapperQueue *queue) { @@ -666,51 +654,6 @@ add_item_from_file (GFile *file, ClapperQueue *queue) gst_object_unref (item); } -static void -add_items_from_claps_file (GFile *file, ClapperQueue *queue) -{ - GDataInputStream *dstream = NULL; - GFileInputStream *stream; - GError *error = NULL; - gchar *line; - - if (!(stream = g_file_read (file, NULL, &error))) - goto finish; - - dstream = g_data_input_stream_new (G_INPUT_STREAM (stream)); - - while ((line = g_data_input_stream_read_line ( - dstream, NULL, NULL, &error))) { - g_strstrip (line); - - if (strlen (line) > 0) { - GFile *tmp_file = gst_uri_is_valid (line) - ? g_file_new_for_uri (line) - : g_file_new_for_path (line); - - if (_is_claps_file (tmp_file)) - add_items_from_claps_file (tmp_file, queue); - else - add_item_from_file (tmp_file, queue); - - g_object_unref (tmp_file); - } - - g_free (line); - } - -finish: - if (error) { - GST_ERROR ("Could not read \".claps\" file, reason: %s", error->message); - g_error_free (error); - } - if (stream) { - g_input_stream_close (G_INPUT_STREAM (stream), NULL, NULL); - g_object_unref (stream); - } - g_clear_object (&dstream); -} - static void add_item_with_subtitles (GFile *media_file, GFile *subs_file, ClapperQueue *queue) @@ -779,12 +722,8 @@ clapper_app_application_open (GApplication *app, if (!handled) { gint i; - for (i = 0; i < n_files; ++i) { - if (_is_claps_file (files[i])) - add_items_from_claps_file (files[i], queue); - else - add_item_from_file (files[i], queue); - } + for (i = 0; i < n_files; ++i) + add_item_from_file (files[i], queue); } add_only = (g_strcmp0 (hint, "add-only") == 0);