Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Factory:PowerPC:Rings:1-MinimalX
mc
mc-extd-sound.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File mc-extd-sound.patch of Package mc
--- misc/ext.d/sound.sh | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) --- a/misc/ext.d/sound.sh +++ b/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() {
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor