mc/mc-extd-sound.patch
Dirk Mueller 34a0b02861 Accepting request 915746 from home:ecsos
Security-Update:
- Midnight Commander 4.8.27:
  * Core
    - Minimal version of Autoconf is 2.64 ()
    - Minimal version of Automake is 1.12 ()
    - Minimal version of Gettext is 0.18.2 ()
    - Minimal version of libssh2 is 1.2.8 ()
    - Reimplement version detection (, )
    - Significantly reduce rebuilt time after version change (, )
    - Drop automatic migration of configuration from ~/.mc to XDG-based directories ()
    - zsh: support custom configuration file: ~/.local/share/mc/.zshrc ()
    - Widgets: implement WST_VISIBLE state to show/hide widgets ()
    - Find File: add Follow symlinks option () 
  * VFS
    - extfs: support unrar-6 ()
    - extfs: support official 7z binary (7zz) ()
    - ftpfs: apply file list parser from lftp project (, ) 
  * Editor
    - Word completion: get candidates from all open files ()
    - etags: get rid of hardcoded list length and window width ()
    - Update syntax files:
      - python () 
    - Add syntax highlighting:
      - Verilog and SystemVerilog? header files ()
      - JSON ()
      - openrc-run scripts () 
  * Viewer
  * Diff viewer
  * Misc
    - Code clean up (, , )
    - Filehighlight of c++ and h++ files as sources ()
    - Filehighlight of JSON files as documents ()
    - Support of alacritty terminal emulator (​https://github.com/alacritty/alacritty) ()
    - Support of foot terminal emulator (​https://codeberg.org/dnkl/foot) ()
    - Support of (alt+)shift+arrow keys in st terminal emulator (st.suckless.org) ()
    - Mouse support in screen: don't check  variable ()
    - mc.ext: support fb2 e-books ()
    - ext.d: use mediainfo to view info about various media files ()
    - Remove OS/distro-specific package-related stuff from source tree () 
  * Fixes
    - FTBFS against NCurses on OS X 10.9.5 ()
    - Segfault on dialog before panels get visible ()
    - Crash if shadow is out of screen (build against NCurses) ()
    - Crash in search ()
    - Crash on startup with enabled subshell in FreeBSD (workaround) ()
    - Hang on start randomly with zsh as subshell ()
    - If command line is invisible it's partially displayed ()
    - Broken handling of zip archives (, )
    - Broken handling of jar files as zip archives ()
    - Timestamps of symlinks, sockets, fifos, etc are not preserved after copy/move ()
    - %view action in the user menu doesn't work on no-exec filesystem ()
    - Hardlinks are not colored by file type or extension ()
    - mcedit: silent macro makes terminal disrupted ()
    - mcedit: disrupting of TAGS file path ()
    - vfs: unable to browse compressed tar archives ()
    - sftpfs vfs: CVE-2021-36370: server fingerprint isn't verified 
      (discovered by AUT-milCERT during an audit of open source software) ()
    - ftpfs vfs: month of file is always January ()
    - Tests: log files are written by libcheck and automake simultaneously () 
- Rebase mc-ext-audio.patch.
- Rebase mc-extd-sound.patch.

OBS-URL: https://build.opensuse.org/request/show/915746
OBS-URL: https://build.opensuse.org/package/show/Base:System/mc?expand=0&rev=138
2021-10-16 09:58:20 +00:00

66 lines
1.7 KiB
Diff

Index: misc/ext.d/sound.sh
===================================================================
--- misc/ext.d/sound.sh.orig
+++ misc/ext.d/sound.sh
@@ -6,22 +6,40 @@
action=$1
filetype=$2
-[ -n "${MC_XDG_OPEN}" ] || MC_XDG_OPEN="xdg-open"
+[ -n "${MC_XDG_OPEN}" ] || MC_XDG_OPEN="_xdg_open"
+
+_xdg_open()
+{
+ if [ -n "$DISPLAY" ] && type -p gmplayer ; then
+ gmplayer "${MC_EXT_FILENAME}"
+ elif type -p mplayer ; then
+ mplayer "${MC_EXT_FILENAME}"
+ else
+ xdg-open "${MC_EXT_FILENAME}"
+ fi
+}
do_view_action() {
filetype=$1
+ if type -p mediainfo >/dev/null 2>&1 ; then
+ mediainfo "${MC_EXT_FILENAME}"
+ return $?
+ fi
+
case "${filetype}" in
common)
mediainfo "${MC_EXT_FILENAME}"
;;
-
mp3)
- mpg123 -vtn1 "${MC_EXT_FILENAME}" 2>&1 | \
- sed -n '/^Title/,/^Comment/p;/^MPEG/,/^Audio/p'
+ if type -p mpg123 ; then
+ mpg123 -vtn1 "${MC_EXT_FILENAME}" 2>&1 | \
+ sed -n '/^Title/,/^Comment/p;/^MPEG/,/^Audio/p'
+ return 0
+ fi
;;
ogg)
- ogginfo "${MC_EXT_FILENAME}"
+ type -p ogginfo && ogginfo "${MC_EXT_FILENAME}" && return 0
;;
opus)
opusinfo "${MC_EXT_FILENAME}"
@@ -29,11 +47,11 @@ do_view_action() {
wma)
mplayer -quiet -slave -frames 0 -vo null -ao null -identify "${MC_EXT_FILENAME}" 2>/dev/null | \
tail +13 || file "${MC_EXT_FILENAME}"
- ;;
- *)
- cat "${MC_EXT_FILENAME}"
+ return $?
;;
esac
+
+ mplayer -identify -vo null -ao null -frames 0 "${MC_EXT_FILENAME}" 2>&1 | sed -n '/^ID_/p'
}
do_open_action() {