From 65fc530f0c3ff02f982a0e4c74988d4a53730f04 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 11 Oct 2012 02:04:08 +0200 Subject: Rename to "mpv" This changes the name of this project to mpv. Most user-visible mentions of "MPlayer" and "mplayer" are changed to "mpv". The binary name and the default config file location are changed as well. The new default config file location is: ~/.mpv/ Remove etc/mplayer.desktop. Apparently this was for the MPlayer GUI, which has been removed from mplayer2 ages ago. We don't have a logo, and the MS Windows resource files sort-of require one, so leave etc/mplayer.ico/.xpm as-is. Remove the debian and rpm packaging scripts. These contained outdated dependencies and likely were more harmful than useful. (Patches which add working and well-tested packaging are welcome.) --- TOOLS/binary_codecs.sh | 219 --------------------------------------------- TOOLS/mplayer2_identify.sh | 165 ---------------------------------- TOOLS/mpv_identify.sh | 165 ++++++++++++++++++++++++++++++++++ 3 files changed, 165 insertions(+), 384 deletions(-) delete mode 100755 TOOLS/binary_codecs.sh delete mode 100755 TOOLS/mplayer2_identify.sh create mode 100755 TOOLS/mpv_identify.sh (limited to 'TOOLS') diff --git a/TOOLS/binary_codecs.sh b/TOOLS/binary_codecs.sh deleted file mode 100755 index 5ab3b3993c..0000000000 --- a/TOOLS/binary_codecs.sh +++ /dev/null @@ -1,219 +0,0 @@ -#!/bin/sh -set -e - -# avoid insecure tempfile creation -umask 0022 - -# This script will download binary codecs for MPlayer unto a Debian system. - -# Author: thuglife, mennucc1 -# - -CODECDIR=/usr/lib/codecs -PREFDIR=/var/lib/mplayer/prefs -MYSITE='http://people.debian.org/~mennucc1/mplayer' - -dpkgarch=$(dpkg --print-architecture) - -[ -d $PREFDIR ] || mkdir -v $PREFDIR -[ -d $CODECDIR ] || mkdir -v $CODECDIR -cd $CODECDIR -[ -d mplayer_binary_codecs ] || mkdir -v mplayer_binary_codecs - -choosemirror () -{ - cd $PREFDIR - - #if [ ! -r mirrors ] || find mirrors -mtime +20 ; then - echo "Downloading mirrors list" - wget -nv -c -N $MYSITE/mirrors || true - #fi - if [ ! -r bestsites ] || [ mirrors -nt bestsites ] || \ - find bestsites -mtime +20 | grep -q bestsites ; then - if which netselect > /dev/null ; then - echo Choosing best mirrors using netselect - netselect -s 5 -t 5 $( cat mirrors ) | awk '{print $2}' > bestsites - elif which fping > /dev/null ; then - fping -C 1 $( sed 's#.*//##;s#/.*##' mirrors ) 2>&1 | \ - egrep -v 'bytes.*loss' | sort -n -k3 | \ - grep -v ': *-' | awk '/:/{print $1}' | head -5 | ( while read mainsite ; do - grep $mainsite $PREFDIR/mirrors ; done ) > bestsites - else - echo "(If you install 'netselect' or 'fping', it will select the best mirror for you" - echo " you may wish to stop this script and rerun after installation)" - sleep 3 - fi - fi -} - -INSTALL () { - filename="$3" - dir="$2" - url="$1" - - cd $CODECDIR/mplayer_binary_codecs - - if [ -r $filename ] ; then - cp $filename $filename.bak - fi - - if [ "$url" = @MAINSITE@ ] ; then - list=$PREFDIR/bestsites - test -r $list || list=$PREFDIR/mirrors - cat $list | while read mainsite ; do - echo Downloading $filename from $mainsite ... - wget -c -N $mainsite/$dir/$filename || true - if [ -r "$filename" ] ; then - UNPACK "$filename" - return 0 - fi - done - else - wget -c -N $url/$dir/$filename || true - if [ -r "$filename" ] ; then - UNPACK "$filename" - return 0 - fi - fi -} - - -UNPACK () -{ - filename="$1" - if [ -r $filename.bak ] && cmp $filename.bak $filename && [ -r $filename.list ] ; then - echo It appears that $filename was already succesfully installed - [ -r $filename.bak ] && rm $filename.bak - else - if grep -q " $filename$" $PREFDIR/MD5SUMS ; then - echo Checking MD5 for $filename - grep " $filename$" $PREFDIR/MD5SUMS | md5sum -c - - else - echo Warning: no MD5 for $filename were found. Hit enter to continue. - read dummy - fi - echo Installing $filename ... - if [ -r $filename.list ] ; then - tr '\n' '\000' < $filename.list | xargs -r0 rm || true - UNLINK $filename.list - rm $filename.list - fi - - tarfail () { echo FAILED $filename ; rm $filename.list ; exit 1 ; } - - case "$filename" in - *.tar.gz) - tar xvzf $filename > $filename.list || tarfail - #rm $filename - ;; - *.tgz) - tar xvzf $filename > $filename.list || tarfail - #rm $filename - ;; - *.tar.bz2) - tar --bzip2 -xvf $filename > $filename.list || tarfail - #rm $filename - ;; - esac - [ -r $filename.bak ] && rm $filename.bak - LINK $filename.list - echo "Installed $filename Succesfully!" - fi -} - -LINK () { - cd $CODECDIR/ - cat $CODECDIR/mplayer_binary_codecs/$1 | while read f ; do - ln -sbf mplayer_binary_codecs/"$f" . - done -} - -UNLINK () { -### FIXME -# cd $CODECDIR -# cat $CODECDIR/mplayer_binary_codecs/$1 | while f do -# ln -sbf mplayer_binary_codecs/"$f" -# done - if which symlinks > /dev/null ; then - symlinks -d $CODECDIR - fi -} - -if [ `whoami` != root ]; then - echo "You must be 'root' to use this script. Login as root first!" - exit 1 -fi - -case "$1" in - install) - if test -x /bin/bzip2 || test -x /usr/bin/bzip2 ; then : ; else - echo You need to install bzip2 - exit 1 - fi - choosemirror - cd $PREFDIR - #if [ ! -r codecs_list ] || find codecs_list -mtime +20 ; then - echo "Getting codecs list" - wget -nv -c -N $MYSITE/codecs_list || true - #fi - - cd $PREFDIR - echo Downloading MD5 sums from main site - [ -r MD5SUMS ] && mv MD5SUMS MD5SUMS.bak - if wget -nv -N http://www.mplayerhq.hu/MPlayer/releases/codecs/MD5SUMS ; then - [ -r MD5SUMS.bak ] && rm MD5SUMS.bak - else - echo "failed" - if [ -r MD5SUMS.bak ] ; then - echo "trying to use backup" - mv MD5SUMS.bak MD5SUMS - fi - fi - - if grep -q "^$dpkgarch" $PREFDIR/codecs_list ; then - egrep -v "^[[:space:]]*(#|$)" $PREFDIR/codecs_list | \ - while read arch url dir file info ; do - if [ "$dpkgarch" = "$arch" ]; then - echo Downloading and installing $file $info... - INSTALL "$url" "$dir" "$file" - fi - done - needlibstd=no - test "$dpkgarch" = "powerpc" && needlibstd=yes - test "$dpkgarch" = "i386" && needlibstd=yes - if test "$needlibstd" = "yes" && ! test -r /usr/lib/libstdc++.so.5 ; then - echo "Warning: you need to install libstdc++ 5 libraries" - echo -n "Do it now? " - read R - case $R in - y*) apt-get install libstdc++5 ;; - *) echo "If you change your mind, use the command" - echo " apt-get install libstdc++5" ;; - esac - fi - else - echo "Sorry, no codecs for your arch '$dpkgarch'. Sorry dude :(" - exit 1 - fi - ;; - - uninstall) - cd $CODECDIR/ - rm -rf mplayer_binary_codecs - #FIXME we need a better clean system - if which symlinks > /dev/null ; then - symlinks -d . - else - echo "please install the package 'symlinks' and run 'symlinks -d $CODECDIR' " - fi - echo "Uninstalled Succesfully!" - ;; - - *) - echo "Usage: {install|uninstall}" - echo "This program will install binary codecs for MPlayer." - exit 1 - ;; -esac - -exit 0 diff --git a/TOOLS/mplayer2_identify.sh b/TOOLS/mplayer2_identify.sh deleted file mode 100755 index 04902124ab..0000000000 --- a/TOOLS/mplayer2_identify.sh +++ /dev/null @@ -1,165 +0,0 @@ -#!/bin/sh - -# file identification script -# -# manual usage: -# mplayer2_identify.sh foo.mkv -# -# sh/dash/ksh/bash usage: -# . mplayer2_identify.sh FOO_ foo.mkv -# will fill properties into variables like FOO_length -# -# zsh usage: -# mplayer2_identify() { emulate -L sh; . mplayer2_identify.sh "$@"; } -# mplayer2_identify FOO_ foo.mkv -# will fill properties into variables like FOO_length -# -# When multiple files were specified, their info will be put into FOO_* for the -# first file, FOO_1_* for the second file, FOO_2_* for the third file, etc. - -case "$0" in - mplayer2_identify.sh|*/mplayer2_identify.sh) - # we are NOT being sourced - case "$1" in - '') - ;; - *) - set -- '' "$@" - ;; - esac - ;; -esac - -if [ $# -lt 2 ]; then - echo >&2 "Usage 1 (for humans only): $0 filename.mkv" - echo >&2 "will print all property values." - echo >&2 "Note that this output really shouldn't be parsed, as the" - echo >&2 "format is subject to change." - echo >&2 - echo >&2 "Usage 2 (for use by scripts): see top of this file" - echo >&2 - echo >&2 "NOTE: for mkv with ordered chapters, this may" - echo >&2 "not always identify the specified file, but the" - echo >&2 "file providing the first chapter. Specify" - echo >&2 "--no-ordered-chapters to prevent this." - exit 1 -fi - -__midentify__LF=" -" - -__midentify__nextprefix=$1 -shift - -if [ -n "$__midentify__nextprefix" ]; then - # in case of error, we always want this unset - eval unset $__midentify__nextprefix'path' -fi - -__midentify__allprops=" - filename - path - stream_start - stream_end - stream_length - - demuxer - - switch_program - length - chapters - editions - titles - - switch_audio - audio_bitrate - audio_codec - audio_format - channels - samplerate - - switch_video - angle - video_bitrate - video_codec - video_format - aspect - fps - width - height - - sub -" -# TODO add metadata support once mplayer can do it - -__midentify__propstr="X-MIDENTIFY-START:\\n" -for __midentify__key in $__midentify__allprops; do - __midentify__propstr=$__midentify__propstr"X-MIDENTIFY: $__midentify__key \${=$__midentify__key}\\n" - eval unset $__midentify__nextprefix$__midentify__key -done - -__midentify__output=`mplayer --playing-msg="$__midentify__propstr" --vo=null --ao=null --frames=0 "$@"` -__midentify__fileindex=0 -__midentify__prefix= -while :; do - case "$__midentify__output" in - '') - break - ;; - *$__midentify__LF*) - __midentify__line=${__midentify__output%%$__midentify__LF*} - __midentify__output=${__midentify__output#*$__midentify__LF} - ;; - *) - __midentify__line=$__midentify__output - __midentify__output= - ;; - esac - case "$__midentify__line" in - X-MIDENTIFY-START:) - if [ -n "$__midentify__nextprefix" ]; then - __midentify__prefix=$__midentify__nextprefix - if [ $__midentify__fileindex -gt 0 ]; then - __midentify__nextprefix=${__midentify__prefix%$__midentify__fileindex\_} - fi - __midentify__fileindex=$(($__midentify__fileindex+1)) - __midentify__nextprefix=$__midentify__nextprefix$__midentify__fileindex\_ - for __midentify__key in $__midentify__allprops; do - eval unset $__midentify__nextprefix$__midentify__key - done - else - if [ $__midentify__fileindex -gt 0 ]; then - echo - fi - __midentify__fileindex=$(($__midentify__fileindex+1)) - fi - ;; - X-MIDENTIFY:\ *) - __midentify__key=${__midentify__line#X-MIDENTIFY:\ } - __midentify__value=${__midentify__key#* } - __midentify__key=${__midentify__key%% *} - if [ -n "$__midentify__nextprefix" ]; then - if [ -z "$__midentify__prefix" ]; then - echo >&2 "Got X-MIDENTIFY: without X-MIDENTIFY-START:" - elif [ -n "$__midentify__value" ]; then - eval $__midentify__prefix$__midentify__key=\$__midentify__value - fi - else - if [ -n "$__midentify__value" ]; then - echo "$__midentify__key=$__midentify__value" - fi - fi - ;; - esac -done - -unset __midentify__fileindex -unset __midentify__allprops -unset __midentify__key -unset __midentify__LF -unset __midentify__line -unset __midentify__output -unset __midentify__nextprefix -unset __midentify__prefix -unset __midentify__propstr -unset __midentify__value diff --git a/TOOLS/mpv_identify.sh b/TOOLS/mpv_identify.sh new file mode 100755 index 0000000000..49cec2ce94 --- /dev/null +++ b/TOOLS/mpv_identify.sh @@ -0,0 +1,165 @@ +#!/bin/sh + +# file identification script +# +# manual usage: +# mpv_identify.sh foo.mkv +# +# sh/dash/ksh/bash usage: +# . mpv_identify.sh FOO_ foo.mkv +# will fill properties into variables like FOO_length +# +# zsh usage: +# mpv_identify() { emulate -L sh; . mpv_identify.sh "$@"; } +# mpv_identify FOO_ foo.mkv +# will fill properties into variables like FOO_length +# +# When multiple files were specified, their info will be put into FOO_* for the +# first file, FOO_1_* for the second file, FOO_2_* for the third file, etc. + +case "$0" in + mpv_identify.sh|*/mpv_identify.sh) + # we are NOT being sourced + case "$1" in + '') + ;; + *) + set -- '' "$@" + ;; + esac + ;; +esac + +if [ $# -lt 2 ]; then + echo >&2 "Usage 1 (for humans only): $0 filename.mkv" + echo >&2 "will print all property values." + echo >&2 "Note that this output really shouldn't be parsed, as the" + echo >&2 "format is subject to change." + echo >&2 + echo >&2 "Usage 2 (for use by scripts): see top of this file" + echo >&2 + echo >&2 "NOTE: for mkv with ordered chapters, this may" + echo >&2 "not always identify the specified file, but the" + echo >&2 "file providing the first chapter. Specify" + echo >&2 "--no-ordered-chapters to prevent this." + exit 1 +fi + +__midentify__LF=" +" + +__midentify__nextprefix=$1 +shift + +if [ -n "$__midentify__nextprefix" ]; then + # in case of error, we always want this unset + eval unset $__midentify__nextprefix'path' +fi + +__midentify__allprops=" + filename + path + stream_start + stream_end + stream_length + + demuxer + + switch_program + length + chapters + editions + titles + + switch_audio + audio_bitrate + audio_codec + audio_format + channels + samplerate + + switch_video + angle + video_bitrate + video_codec + video_format + aspect + fps + width + height + + sub +" +# TODO add metadata support once mpv can do it + +__midentify__propstr="X-MIDENTIFY-START:\\n" +for __midentify__key in $__midentify__allprops; do + __midentify__propstr=$__midentify__propstr"X-MIDENTIFY: $__midentify__key \${=$__midentify__key}\\n" + eval unset $__midentify__nextprefix$__midentify__key +done + +__midentify__output=`mpv --playing-msg="$__midentify__propstr" --vo=null --ao=null --frames=0 "$@"` +__midentify__fileindex=0 +__midentify__prefix= +while :; do + case "$__midentify__output" in + '') + break + ;; + *$__midentify__LF*) + __midentify__line=${__midentify__output%%$__midentify__LF*} + __midentify__output=${__midentify__output#*$__midentify__LF} + ;; + *) + __midentify__line=$__midentify__output + __midentify__output= + ;; + esac + case "$__midentify__line" in + X-MIDENTIFY-START:) + if [ -n "$__midentify__nextprefix" ]; then + __midentify__prefix=$__midentify__nextprefix + if [ $__midentify__fileindex -gt 0 ]; then + __midentify__nextprefix=${__midentify__prefix%$__midentify__fileindex\_} + fi + __midentify__fileindex=$(($__midentify__fileindex+1)) + __midentify__nextprefix=$__midentify__nextprefix$__midentify__fileindex\_ + for __midentify__key in $__midentify__allprops; do + eval unset $__midentify__nextprefix$__midentify__key + done + else + if [ $__midentify__fileindex -gt 0 ]; then + echo + fi + __midentify__fileindex=$(($__midentify__fileindex+1)) + fi + ;; + X-MIDENTIFY:\ *) + __midentify__key=${__midentify__line#X-MIDENTIFY:\ } + __midentify__value=${__midentify__key#* } + __midentify__key=${__midentify__key%% *} + if [ -n "$__midentify__nextprefix" ]; then + if [ -z "$__midentify__prefix" ]; then + echo >&2 "Got X-MIDENTIFY: without X-MIDENTIFY-START:" + elif [ -n "$__midentify__value" ]; then + eval $__midentify__prefix$__midentify__key=\$__midentify__value + fi + else + if [ -n "$__midentify__value" ]; then + echo "$__midentify__key=$__midentify__value" + fi + fi + ;; + esac +done + +unset __midentify__fileindex +unset __midentify__allprops +unset __midentify__key +unset __midentify__LF +unset __midentify__line +unset __midentify__output +unset __midentify__nextprefix +unset __midentify__prefix +unset __midentify__propstr +unset __midentify__value -- cgit v1.2.3