Saturday, February 27, 2021

Fix -fno-common bugs in multimedia/audiopreview

I confirmed that it runs and plays pieces of videos.

From aac4e9a6da911a827b7119480400addfe0340ea5 Mon Sep 17 00:00:00 2001
From: Greg Steuck <greg@lenny.nest.cx>
Date: Sat, 27 Feb 2021 21:21:11 -0800
Subject: [PATCH] Fix -fno-common bugs in multimedia/audiopreview

---
multimedia/audiopreview/Makefile | 2 +-
.../patches/patch-src_ap_config_c | 16 ++++++++++++++
.../patches/patch-src_ap_config_h | 16 ++++++++++++++
.../audiopreview/patches/patch-src_player_c | 22 +++++++++++++++++++
.../audiopreview/patches/patch-src_player_h | 22 +++++++++++++++++++
5 files changed, 77 insertions(+), 1 deletion(-)
create mode 100644 multimedia/audiopreview/patches/patch-src_ap_config_c
create mode 100644 multimedia/audiopreview/patches/patch-src_ap_config_h
create mode 100644 multimedia/audiopreview/patches/patch-src_player_c
create mode 100644 multimedia/audiopreview/patches/patch-src_player_h

diff --git a/multimedia/audiopreview/Makefile b/multimedia/audiopreview/Makefile
index 8b42085720f..8d3aeffda22 100644
--- a/multimedia/audiopreview/Makefile
+++ b/multimedia/audiopreview/Makefile
@@ -3,7 +3,7 @@
COMMENT = tool to play previews of audio and video files

DISTNAME = audiopreview-0.6
-REVISION = 5
+REVISION = 6

CATEGORIES = multimedia

diff --git a/multimedia/audiopreview/patches/patch-src_ap_config_c b/multimedia/audiopreview/patches/patch-src_ap_config_c
new file mode 100644
index 00000000000..4e2ef2ffdd3
--- /dev/null
+++ b/multimedia/audiopreview/patches/patch-src_ap_config_c
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+-fno-common fixes
+
+Index: src/ap_config.c
+--- src/ap_config.c.orig
++++ src/ap_config.c
+@@ -22,6 +22,8 @@
+
+ #include "ap_config.h"
+
++apconfig ap_config;
++
+ #define PREVIEW_DURATION 10
+
+ void ap_config_init (apconfig* ap)
diff --git a/multimedia/audiopreview/patches/patch-src_ap_config_h b/multimedia/audiopreview/patches/patch-src_ap_config_h
new file mode 100644
index 00000000000..89bca3c0158
--- /dev/null
+++ b/multimedia/audiopreview/patches/patch-src_ap_config_h
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+-fno-common fixes
+
+Index: src/ap_config.h
+--- src/ap_config.h.orig
++++ src/ap_config.h
+@@ -73,7 +73,7 @@ typedef struct
+ StartPlayingPosition position;
+ } apconfig;
+
+-apconfig ap_config;
++extern apconfig ap_config;
+
+ void ap_config_init (apconfig* ap);
+ void config_debug_print_start_position ();
diff --git a/multimedia/audiopreview/patches/patch-src_player_c b/multimedia/audiopreview/patches/patch-src_player_c
new file mode 100644
index 00000000000..d41b2ecdadc
--- /dev/null
+++ b/multimedia/audiopreview/patches/patch-src_player_c
@@ -0,0 +1,22 @@
+$OpenBSD$
+
+-fno-common fixes
+
+Index: src/player.c
+--- src/player.c.orig
++++ src/player.c
+@@ -23,6 +23,14 @@
+
+ #include "player.h"
+
++void (*done_playing_callback)();
++GstElement *pipeline;
++
++static GstElement *audiofakesink;
++static GstElement *videofakesink;
++static Stream **currentstream;
++static Stream *current_stream;
++
+ static gboolean loop_stream_was_played = FALSE; ///< endless loop prevention flag
+
+ /**
diff --git a/multimedia/audiopreview/patches/patch-src_player_h b/multimedia/audiopreview/patches/patch-src_player_h
new file mode 100644
index 00000000000..14c8b29f4b4
--- /dev/null
+++ b/multimedia/audiopreview/patches/patch-src_player_h
@@ -0,0 +1,22 @@
+$OpenBSD$
+
+-fno-common fixes
+
+Index: src/player.h
+--- src/player.h.orig
++++ src/player.h
+@@ -29,12 +29,8 @@
+ #include "stream.h"
+ #include "log.h"
+
+-GstElement *videofakesink;
+-GstElement *audiofakesink;
+-GstElement *pipeline;
+-void (*done_playing_callback)();
+-Stream **currentstream;
+-Stream *current_stream;
++extern GstElement *pipeline;
++extern void (*done_playing_callback)();
+
+ static void player_begin (Stream* stream);
+ void player_set_position (StartPlayingPosition position);
--
2.30.1

No comments:

Post a Comment