Compare commits
3 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| 2561ced90f | |||
| a4db539249 | |||
| e5c9408a0b |
@@ -1,176 +0,0 @@
|
||||
From 70ae99463889e191c3d5d0af6ba28e893d73a63f Mon Sep 17 00:00:00 2001
|
||||
From: Christopher Snowhill <kode54@gmail.com>
|
||||
Date: Fri, 21 Jun 2024 21:35:53 -0700
|
||||
Subject: [PATCH] ffmpeg: update API to support FFMPEG 7
|
||||
|
||||
---
|
||||
plugins/ffmpeg/ffmpeg.c | 53 ++++++++++++++++++++++++++++++++++-------
|
||||
1 file changed, 44 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/plugins/ffmpeg/ffmpeg.c b/plugins/ffmpeg/ffmpeg.c
|
||||
index 97545e987d..69c4e83df8 100644
|
||||
--- a/plugins/ffmpeg/ffmpeg.c
|
||||
+++ b/plugins/ffmpeg/ffmpeg.c
|
||||
@@ -62,7 +62,7 @@ static int enable_dop = 0;
|
||||
|
||||
typedef struct {
|
||||
DB_fileinfo_t info;
|
||||
- AVCodec *codec;
|
||||
+ const AVCodec *codec;
|
||||
AVCodecContext *codec_context;
|
||||
int need_to_free_codec_context;
|
||||
AVFormatContext *format_context;
|
||||
@@ -115,12 +115,20 @@ int is_codec_dsd(enum AVCodecID codec_id) {
|
||||
// ensure that the buffer can contain entire frame of frame_size bytes per channel
|
||||
static int
|
||||
ensure_buffer (ffmpeg_info_t *info, size_t frame_size) {
|
||||
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(61, 0, 0)
|
||||
+ if (!info->buffer || info->buffer_size < frame_size * info->codec_context->ch_layout.nb_channels) {
|
||||
+#else
|
||||
if (!info->buffer || info->buffer_size < frame_size * info->codec_context->channels) {
|
||||
+#endif
|
||||
if (info->buffer) {
|
||||
free (info->buffer);
|
||||
info->buffer = NULL;
|
||||
}
|
||||
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(61, 0, 0)
|
||||
+ info->buffer_size = frame_size*info->codec_context->ch_layout.nb_channels;
|
||||
+#else
|
||||
info->buffer_size = frame_size*info->codec_context->channels;
|
||||
+#endif
|
||||
info->left_in_buffer = 0;
|
||||
int err = posix_memalign ((void **)&info->buffer, 16, info->buffer_size);
|
||||
if (err) {
|
||||
@@ -137,7 +145,7 @@ _get_audio_codec_from_stream(AVFormatContext *format_context, int stream_index,
|
||||
if (format_context->streams[stream_index]->codecpar->codec_type != AVMEDIA_TYPE_AUDIO) {
|
||||
return 0;
|
||||
}
|
||||
- AVCodec *codec = avcodec_find_decoder(format_context->streams[stream_index]->codecpar->codec_id);
|
||||
+ const AVCodec *codec = avcodec_find_decoder(format_context->streams[stream_index]->codecpar->codec_id);
|
||||
if (codec == NULL) {
|
||||
return 0;
|
||||
}
|
||||
@@ -154,7 +162,7 @@ _get_audio_codec_from_stream(AVFormatContext *format_context, int stream_index,
|
||||
if (ctx == NULL) {
|
||||
return 0;
|
||||
}
|
||||
- AVCodec *codec = avcodec_find_decoder (ctx->codec_id);
|
||||
+ const AVCodec *codec = avcodec_find_decoder (ctx->codec_id);
|
||||
if (codec == NULL) {
|
||||
return 0;
|
||||
}
|
||||
@@ -231,7 +239,11 @@ ffmpeg_init (DB_fileinfo_t *_info, DB_playItem_t *it) {
|
||||
int bps = av_get_bytes_per_sample (info->codec_context->sample_fmt)*8;
|
||||
int samplerate = info->codec_context->sample_rate;
|
||||
|
||||
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(61, 0, 0)
|
||||
+ if (bps <= 0 || info->codec_context->ch_layout.nb_channels <= 0 || samplerate <= 0) {
|
||||
+#else
|
||||
if (bps <= 0 || info->codec_context->channels <= 0 || samplerate <= 0) {
|
||||
+#endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -248,7 +260,11 @@ ffmpeg_init (DB_fileinfo_t *_info, DB_playItem_t *it) {
|
||||
_info->plugin = &plugin.decoder;
|
||||
_info->readpos = 0;
|
||||
_info->fmt.bps = bps;
|
||||
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(61, 0, 0)
|
||||
+ _info->fmt.channels = info->codec_context->ch_layout.nb_channels;
|
||||
+#else
|
||||
_info->fmt.channels = info->codec_context->channels;
|
||||
+#endif
|
||||
_info->fmt.samplerate = samplerate;
|
||||
if (info->codec_context->sample_fmt == AV_SAMPLE_FMT_FLT || info->codec_context->sample_fmt == AV_SAMPLE_FMT_FLTP) {
|
||||
_info->fmt.is_float = 1;
|
||||
@@ -296,7 +312,9 @@ _free_info_data(ffmpeg_info_t *info) {
|
||||
av_packet_unref (&info->pkt);
|
||||
}
|
||||
if (info->codec_context) {
|
||||
+#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(61, 0, 0)
|
||||
avcodec_close (info->codec_context);
|
||||
+#endif
|
||||
|
||||
// The ctx is owned by AVFormatContext in legacy mode
|
||||
if (info->need_to_free_codec_context) {
|
||||
@@ -396,7 +414,11 @@ ffmpeg_read (DB_fileinfo_t *_info, char *bytes, int size) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(61, 0, 0)
|
||||
+ int chCnt = info->codec_context->ch_layout.nb_channels;
|
||||
+#else
|
||||
int chCnt = info->codec_context->channels;
|
||||
+#endif
|
||||
int chSize = info->pkt.size / chCnt;
|
||||
uint32_t *pOut = (uint32_t *)info->buffer;
|
||||
uint8_t marker = 0x05;
|
||||
@@ -462,25 +484,30 @@ ffmpeg_read (DB_fileinfo_t *_info, char *bytes, int size) {
|
||||
return -1;
|
||||
}
|
||||
if (av_sample_fmt_is_planar(info->codec_context->sample_fmt)) {
|
||||
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(61, 0, 0)
|
||||
+ int chCnt = info->codec_context->ch_layout.nb_channels;
|
||||
+#else
|
||||
+ int chCnt = info->codec_context->channels;
|
||||
+#endif
|
||||
out_size = 0;
|
||||
- for (int c = 0; c < info->codec_context->channels; c++) {
|
||||
+ for (int c = 0; c < chCnt; c++) {
|
||||
for (int i = 0; i < info->frame->nb_samples; i++) {
|
||||
if (_info->fmt.bps == 8) {
|
||||
- info->buffer[i*info->codec_context->channels+c] = ((int8_t *)info->frame->extended_data[c])[i];
|
||||
+ info->buffer[i*chCnt+c] = ((int8_t *)info->frame->extended_data[c])[i];
|
||||
out_size++;
|
||||
}
|
||||
else if (_info->fmt.bps == 16) {
|
||||
int16_t outsample = ((int16_t *)info->frame->extended_data[c])[i];
|
||||
- ((int16_t*)info->buffer)[i*info->codec_context->channels+c] = outsample;
|
||||
+ ((int16_t*)info->buffer)[i*chCnt+c] = outsample;
|
||||
out_size += 2;
|
||||
}
|
||||
else if (_info->fmt.bps == 24) {
|
||||
- memcpy (&info->buffer[(i*info->codec_context->channels+c)*3], &((int8_t*)info->frame->extended_data[c])[i*3], 3);
|
||||
+ memcpy (&info->buffer[(i*chCnt+c)*3], &((int8_t*)info->frame->extended_data[c])[i*3], 3);
|
||||
out_size += 3;
|
||||
}
|
||||
else if (_info->fmt.bps == 32) {
|
||||
int32_t sample = ((int32_t *)info->frame->extended_data[c])[i];
|
||||
- ((int32_t*)info->buffer)[i*info->codec_context->channels+c] = sample;
|
||||
+ ((int32_t*)info->buffer)[i*chCnt+c] = sample;
|
||||
out_size += 4;
|
||||
}
|
||||
}
|
||||
@@ -784,7 +811,11 @@ ffmpeg_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) {
|
||||
trace ("ffmpeg: samplerate is %d\n", samplerate);
|
||||
trace ("ffmpeg: duration is %f\n", duration);
|
||||
|
||||
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(61, 0, 0)
|
||||
+ if (bps <= 0 || info.codec_context->ch_layout.nb_channels <= 0 || samplerate <= 0) {
|
||||
+#else
|
||||
if (bps <= 0 || info.codec_context->channels <= 0 || samplerate <= 0) {
|
||||
+#endif
|
||||
goto error;
|
||||
}
|
||||
|
||||
@@ -819,7 +850,11 @@ ffmpeg_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) {
|
||||
deadbeef->pl_add_meta (it, ":FILE_SIZE", s);
|
||||
snprintf (s, sizeof (s), "%d", bps);
|
||||
deadbeef->pl_add_meta (it, ":BPS", s);
|
||||
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(61, 0, 0)
|
||||
+ snprintf (s, sizeof (s), "%d", info.codec_context->ch_layout.nb_channels);
|
||||
+#else
|
||||
snprintf (s, sizeof (s), "%d", info.codec_context->channels);
|
||||
+#endif
|
||||
deadbeef->pl_add_meta (it, ":CHANNELS", s);
|
||||
if (is_codec_dsd(info.codec_context->codec_id)) {
|
||||
snprintf (s, sizeof (s), "%d", samplerate * 8);
|
||||
@@ -904,7 +939,7 @@ ffmpeg_init_exts (void) {
|
||||
n = add_new_exts (n, new_exts, ';');
|
||||
}
|
||||
else {
|
||||
- AVInputFormat *ifmt = NULL;
|
||||
+ const AVInputFormat *ifmt = NULL;
|
||||
/*
|
||||
* It's quite complicated to enumerate all supported extensions in
|
||||
* ffmpeg. If a decoder defines extensions in ffmpeg, the probing
|
||||
3
deadbeef-1.10.0.tar.bz2
Normal file
3
deadbeef-1.10.0.tar.bz2
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:98d4247a76efb13bf65890aec9921f5c4733bfc1557906b8d6f209a66b28c363
|
||||
size 5310621
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9d77b3d8afdeab5027d24bd18e9cfc04ce7d6ab3ddc043cc8e84c82b41b79c04
|
||||
size 5182123
|
||||
@@ -1,15 +0,0 @@
|
||||
Index: deadbeef-1.9.2/Makefile.am
|
||||
===================================================================
|
||||
--- deadbeef-1.9.2.orig/Makefile.am
|
||||
+++ deadbeef-1.9.2/Makefile.am
|
||||
@@ -69,8 +69,8 @@ deadbeef_CFLAGS = $(DEPS_CFLAGS) $(DISPA
|
||||
|
||||
docsdir = $(docdir)
|
||||
|
||||
-docs_DATA = README help.txt about.txt translators.txt ChangeLog\
|
||||
- COPYING.GPLv2 COPYING.LGPLv2.1
|
||||
+#docs_DATA = README help.txt about.txt translators.txt ChangeLog\
|
||||
+# COPYING.GPLv2 COPYING.LGPLv2.1
|
||||
|
||||
desktopdir = $(datadir)/applications
|
||||
desktop_DATA = deadbeef.desktop
|
||||
@@ -1,20 +0,0 @@
|
||||
--- deadbeef-1.9.5/deadbeef.desktop.in.orig 2023-02-24 16:00:06.833542450 +0100
|
||||
+++ deadbeef-1.9.5/deadbeef.desktop.in 2023-02-24 16:00:38.869651872 +0100
|
||||
@@ -14,7 +14,7 @@
|
||||
Icon=deadbeef
|
||||
Exec=deadbeef %F
|
||||
Terminal=false
|
||||
-Actions=Play;Pause;Toggle Pause;Stop;Next;Prev;
|
||||
+Actions=Play;Pause;TogglePause;Stop;Next;Prev;
|
||||
MimeType=application/ogg;audio/x-vorbis+ogg;application/x-ogg;audio/mp3;audio/prs.sid;audio/x-flac;audio/mpeg;audio/x-mpeg;audio/x-mod;audio/x-it;audio/x-s3m;audio/x-xm;audio/x-mpegurl;audio/x-scpls;application/x-cue;
|
||||
Categories=Audio;AudioVideo;Player;GTK;
|
||||
Keywords=Sound;Music;Audio;Player;Musicplayer;MP3;
|
||||
@@ -35,7 +35,7 @@
|
||||
Name[zh_TW]=暫停
|
||||
Exec=deadbeef --pause
|
||||
|
||||
-[Desktop Action Toggle Pause]
|
||||
+[Desktop Action TogglePause]
|
||||
Name=Toggle Pause
|
||||
Name[zh_CN]=播放/暂停
|
||||
Name[zh_TW]=播放/暫停
|
||||
@@ -1,3 +1,37 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Apr 28 09:47:47 UTC 2025 - Michael Pujos <pujos.michael@gmail.com>
|
||||
|
||||
- made the devel package noarch as it only contains includes
|
||||
- removed upstreamed 70ae99463889e191c3d5d0af6ba28e893d73a63f.patch
|
||||
- removed deadbeef-fix-desktop-file.patch, fixed upstream
|
||||
- removed unneeded deadbeef-drop-documents-installation.patch
|
||||
- Update to 1.10.0:
|
||||
* Fixed: Memory leak affecting DSD (Toad King)
|
||||
* Fixed: deadbeef.desktop format violations (Viorel Munteanu)
|
||||
* Fixed: Spectrum analyzer drawing bugs
|
||||
* Fixed: Scope drawing bugs
|
||||
* Fixed: Finding album art image in ogg files
|
||||
* Fixed: Deadlock (hang) when clearing a playlist
|
||||
* Fixed: A number of issues with album art
|
||||
* Fixed: A number of issues with OSD notifications
|
||||
* Fixed: Toggle-pause behavior to do nothing when playback is stopped
|
||||
* Fixed: CDText issues (Warepire)
|
||||
* Fixed: Implementation of $longer title formatting function
|
||||
* Fixed: Handling of escape sequences in $cut title formatting function
|
||||
* Fixed: Current track playback indication in playlist browser
|
||||
* Fixed: Crash and memory leak when saving M3U playlists
|
||||
* Fixed: Crash after drag-dropping from search window
|
||||
* Added: Media library: find music in specified folders, and display in a tree
|
||||
* Added: Undo/redo playlist editing operations
|
||||
* Added: Commands for navigating to next/previous/random album with respect to shuffle mode (Robin Seth Ekman)
|
||||
* Added: TORY frame support for ID3v2.3
|
||||
* Added: FFMPEG 7 support (Christopher Snowhill)
|
||||
* Added: Separate config file for storing secrets (lastfm password)
|
||||
* Added: Support for relative paths when loading DBPL playlists (Robin Ekman)
|
||||
* Added: EAC3 support to ffmpeg plugin
|
||||
* Added: Updated adplug library to latest upstream version (Thomas Jepp)
|
||||
* Added: An option to disable log window auto showing after errors
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Nov 11 11:11:11 UTC 2024 - olaf@aepfle.de
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package deadbeef
|
||||
#
|
||||
# Copyright (c) 2024 SUSE LLC
|
||||
# Copyright (c) 2025 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -21,7 +21,7 @@
|
||||
%define _lto_cflags %{nil}
|
||||
%bcond_with restricted
|
||||
Name: deadbeef
|
||||
Version: 1.9.6
|
||||
Version: 1.10.0
|
||||
Release: 0
|
||||
Summary: GTK+ audio player
|
||||
License: BSD-3-Clause AND GPL-2.0-or-later AND Zlib AND LGPL-2.1-or-later
|
||||
@@ -31,12 +31,6 @@ Source: %{name}-%{version}.tar.bz2
|
||||
Source1: %{name}.appdata.xml
|
||||
# PATCH-FIX-OPENSUSE 0003-Fix-operator-precedence-and-uninitialized-value-warn.patch
|
||||
Patch0: 0003-Fix-operator-precedence-and-uninitialized-value-warn.patch
|
||||
# PATCH-FIX-OPENSUSE deadbeef-drop-documents-installation.patch hillwood@opensuse.org -- Install documents by rpmbuild.
|
||||
Patch1: %{name}-drop-documents-installation.patch
|
||||
# PATCH-FIX-OPENSUSE deadbeef-fix-desktop-file.patch -- fix bogus "Play Pause" action
|
||||
Patch2: %{name}-fix-desktop-file.patch
|
||||
# PATCH-FIX-OPENSUSE 70ae99463889e191c3d5d0af6ba28e893d73a63f.patch -- see patch
|
||||
Patch3: 70ae99463889e191c3d5d0af6ba28e893d73a63f.patch
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: automake
|
||||
BuildRequires: clang
|
||||
@@ -114,6 +108,7 @@ Summary: Development files for %{name}
|
||||
License: Zlib
|
||||
Group: Development/Libraries/C and C++
|
||||
Requires: %{name} = %{version}
|
||||
BuildArch: noarch
|
||||
|
||||
%description devel
|
||||
This package provides headers for DeaDBeeF plugins development.
|
||||
@@ -211,6 +206,7 @@ find %{buildroot} -type f -name "*.la" -delete -print
|
||||
%{_libdir}/%{name}/ddb_mono2stereo.so*
|
||||
%{_libdir}/%{name}/ddb_out_pw.so*
|
||||
%{_libdir}/%{name}/ddb_shn.so*
|
||||
%{_libdir}/%{name}/medialib.so*
|
||||
%ifnarch %{ix86}
|
||||
%{_libdir}/%{name}/ddb_soundtouch.so*
|
||||
%endif
|
||||
|
||||
Reference in New Issue
Block a user