mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.3k stars 2.9k forks source link

ZSH completion error? #1731

Closed Argon- closed 9 years ago

Argon- commented 9 years ago

When I want to use the completion for e.g. --vo= (that is, hitting TAB twice after the =) errors appear:

$ mpv --vo=_mpv:12: command not found: *:files:->mfiles
_mpv:12: command not found: *:files:->mfiles
_mpv:12: command not found: *:files:->mfiles

The generated _mpv file: https://gist.github.com/Argon-/02a7bbeff8540e8034c7 Not sure about this syntax, so I can only guess what/if there's something wrong. But looking at the code I don't see how this should present me with a list of possible video outputs anyway (even when it wouldn't error out at the top). This used to work and --vo=help does print the usual list. I'm on mpv git-cfaa6e9 but this error is not exactly new, I just came never around to report it. Probably something for @qmega

ghedo commented 9 years ago

The completion file is definitely borked. Did you build mpv yourself? Was there any wierd output message during ./waf build?

Argon- commented 9 years ago

edit// My previous explanation was not the actual cause/problem. The general situation is still the same: calling homebrew (osx package manager) "by hand" works, calling it by script does not produce a proper completion, therefore I assume it's not mpv's fault.

Maybe as hint for future references, the actual problem/error (when executing my package manager from a script) is:

Use of uninitialized value $opts_str in scalar chomp at /private/tmp/mpv20150328-57624-ch23zx/TOOLS/zsh.pl line 23.
Use of uninitialized value $ao_str in scalar chomp at /private/tmp/mpv20150328-57624-ch23zx/TOOLS/zsh.pl line 26.
Use of uninitialized value $vo_str in scalar chomp at /private/tmp/mpv20150328-57624-ch23zx/TOOLS/zsh.pl line 29.
Use of uninitialized value $af_str in scalar chomp at /private/tmp/mpv20150328-57624-ch23zx/TOOLS/zsh.pl line 32.
Use of uninitialized value $vf_str in scalar chomp at /private/tmp/mpv20150328-57624-ch23zx/TOOLS/zsh.pl line 35.
Use of uninitialized value $opts_str in concatenation (.) or string at /private/tmp/mpv20150328-57624-ch23zx/TOOLS/zsh.pl line 70.
Use of uninitialized value $ao_str in concatenation (.) or string at /private/tmp/mpv20150328-57624-ch23zx/TOOLS/zsh.pl line 70.
Use of uninitialized value $vo_str in concatenation (.) or string at /private/tmp/mpv20150328-57624-ch23zx/TOOLS/zsh.pl line 70.
Use of uninitialized value $af_str in concatenation (.) or string at /private/tmp/mpv20150328-57624-ch23zx/TOOLS/zsh.pl line 70.
Use of uninitialized value $vf_str in concatenation (.) or string at /private/tmp/mpv20150328-57624-ch23zx/TOOLS/zsh.pl line 70.

Not sure why though.

qmega commented 9 years ago

Maybe your package script ends up using a different version of perl than when you do it manually? Probably OS X ships an ancient perl and you have a more recent one installed in your own path or something.

@ghedo wrote the relevant part of the script and I don't know perl very well, but my best guess is that @opts, @ao, @vo, @af, @vf are empty (so the corresponding $..._str never get appended to, resulting in the warnings) and @protos is a list of empty strings ($proto_str doesn't throw a warning, but the completion ends up with 52 spaces where the protos should be, and there are 52 protos). Why that would happen, I'm not really sure, but maybe it has to do with the \s, which all of the patterns use. If an old version of perl doesn't recognize that, I think it'd try to match a literal "s", which would certainly break the parse functions.

Argon- commented 9 years ago

Any idea what a min perl version might be and what I could add to the script to get useful debug output (what info might be useful)? I don't know perl.

qmega commented 9 years ago

Well, like I said, I'm not really a perl guy either, but try this:

diff --git a/TOOLS/zsh.pl b/TOOLS/zsh.pl
index 35592fe..96910a1 100755
--- a/TOOLS/zsh.pl
+++ b/TOOLS/zsh.pl
@@ -7,15 +7,15 @@ use warnings;

 my $mpv = $ARGV[0] || 'mpv';

-my @opts = parse_main_opts("$mpv --list-options", '^ (\-\-[^\s\*]*)\*?\s*(.*)');
+my @opts = parse_main_opts("$mpv --list-options", '^ (\-\-[^ \*]*)\*? *(.*)');

-my @ao = parse_opts("$mpv --ao=help", '^  ([^\s\:]*)\s*: (.*)');
-my @vo = parse_opts("$mpv --vo=help", '^  ([^\s\:]*)\s*: (.*)');
+my @ao = parse_opts("$mpv --ao=help", '^  ([^ \:]*) *: (.*)');
+my @vo = parse_opts("$mpv --vo=help", '^  ([^ \:]*) *: (.*)');

-my @af = parse_opts("$mpv --af=help", '^  ([^\s\:]*)\s*: (.*)');
-my @vf = parse_opts("$mpv --vf=help", '^  ([^\s\:]*)\s*: (.*)');
+my @af = parse_opts("$mpv --af=help", '^  ([^ \:]*) *: (.*)');
+my @vf = parse_opts("$mpv --vf=help", '^  ([^ \:]*) *: (.*)');

-my @protos = parse_opts("$mpv --list-protocols", '^ ([^\s]*)');
+my @protos = parse_opts("$mpv --list-protocols", '^ ([^ ]*)');

 my ($opts_str, $ao_str, $vo_str, $af_str, $vf_str, $protos_str);

Just see if it makes the script work. That should at least tell us if my idea of what's going on is right, and then we can move from there.

Argon- commented 9 years ago

After I tried it with your diff I stumbled upon the problem... seems like nobody else is using msg-module in their config? Well, I do and... it's probably better to call mpv with --no-config from zsh.pl. x)

qmega commented 9 years ago

Ah, yeah, nice catch. So does it work even with the \s if you add --no-config?

Argon- commented 9 years ago

Yes, the \s doesn't pose a problem. Just calling the unpatched script like TOOLS/zsh.pl "$(which mpv) --no-config" works.

qmega commented 9 years ago

Cool. The first commit in #1739 should fix it then.

Argon- commented 9 years ago

Great, thanks.

tetherit commented 9 years ago

This was fixed and now it seems to be an issue again since the last release?

$ mpv <press tab>
_mpv:18: parse error near `&&'
_mpv:18: parse error near `&&'
_mpv:18: parse error near `&&'
$

Any solution to this?

Argon- commented 9 years ago

You tested current master? I just recompiled and it works for me.

qmega commented 9 years ago

@hackeron Post your full _mpv. It's probably /usr/share/zsh/site-functions/_mpv or /usr/local/share/zsh/site-functions/_mpv. You're on OS X, right? Any errors when building?

tetherit commented 9 years ago

@qmega I am using OS X and this was working until the last brew upgrade mpv which bumped the version of mpv to 0.9.2. No errors when building.

Here are the contents of /usr/local/share/zsh/site-functions/_mpv:

#compdef mpv

# mpv zsh completion

local curcontext="$curcontext" state state_descr line
typeset -A opt_args

local rc=1

_arguments -C -S \

  '*:files:->mfiles' && rc=0

case $state in
  ao)
    _values -s , 'audio outputs' \

    && rc=0
  ;;

  vo)
    _values -s , 'video outputs' \

    && rc=0
  ;;

  af)
    _values -s , 'audio filters' \

    && rc=0
  ;;

  vf)
    _values -s , 'video filters' \

    && rc=0
  ;;

  profile|show-profile)
    local -a profiles
    local current
    for current in "${(@f)$($words[1] --profile=help)}"; do
      current=${current//\*/\\\*}
      current=${current//\:/\\\:}
      current=${current//\[/\\\[}
      current=${current//\]/\\\]}
      if [[ $current =~ $'\t'([^$'\t']*)$'\t'(.*) ]]; then
        if [[ -n $match[2] ]]; then
          current="$match[1][$match[2]]"
        else
          current="$match[1]"
        fi
        profiles=($profiles $current)
      fi
    done
    if [[ $state == show-profile ]]; then
      # For --show-profile, only one allowed
      if (( ${#profiles} > 0 )); then
        _values 'profile' $profiles && rc=0
      fi
    else
      # For --profile, multiple allowed
      profiles=($profiles 'help[list profiles]')
      _values -s , 'profile(s)' $profiles && rc=0
    fi
  ;;

  files)
    compset -P '*,'
    compset -S ',*'
    _files -r ',/ \t\n\-' && rc=0
  ;;

  mfiles)
    local expl
    _tags files urls
    while _tags; do
      _requested files expl 'media file' _files -g \
        "*.(#i)(asf|asx|avi|flac|flv|m1v|m2p|m2v|m4v|mjpg|mka|mkv|mov|mp3|mp4|mpe|mpeg|mpg|ogg|ogm|ogv|qt|rm|ts|vob|wav|webm|wma|wmv)(-.)" && rc=0
      if _requested urls; then
        while _next_label urls expl URL; do
          _urls "$expl[@]" && rc=0
          compadd -S '' "$expl[@]"  && rc=0
        done
      fi
      (( rc )) || return 0
    done
  ;;
esac

return rc
tetherit commented 9 years ago

When I do brew install mpv --HEAD I get a different error:

$ mpv <press tab>
_mpv:12: command not found: *:files:->mfiles
_mpv:12: command not found: *:files:->mfiles

Here are the contents of /usr/local/share/zsh/site-functions/_mpv building from latest trunk:

#compdef mpv

# mpv zsh completion

local curcontext="$curcontext" state state_descr line
typeset -A opt_args

local rc=1

_arguments -C -S \
  '--no-write-filename-in-watch-later-config' \
  '--no-ignore-path-in-watch-later-config' \
  '--write-filename-in-watch-later-config' \
  '--no-demuxer-mkv-probe-video-duration' \
  '--demuxer-mkv-subtitle-preroll-secs=-:Double (0 to any) (default\: 1.000000):' \
  '--ignore-path-in-watch-later-config' \
  '--demuxer-mkv-probe-video-duration' \
  '--no-screenshot-jpeg-source-chroma' \
  '--no-stop-playback-on-init-failure' \
  '--no-demuxer-mkv-subtitle-preroll' \
  '--no-demuxer-lavf-allow-mimetype' \
  '--no-ass-vsfilter-aspect-compat' \
  '--no-demuxer-mkv-fix-timestamps' \
  '--screenshot-jpeg-source-chroma' \
  '--stop-playback-on-init-failure' \
  '--no-ass-vsfilter-color-compat' \
  '--demuxer-lavf-analyzeduration=-:Float (0 to 3600) (default\: 0.000000):' \
  '--demuxer-mkv-subtitle-preroll' \
  '--no-screenshot-high-bit-depth' \
  '--no-screenshot-tag-colorspace' \
  '--no-ass-vsfilter-blur-compat' \
  '--demuxer-lavf-allow-mimetype' \
  '--no-demuxer-lavf-genpts-mode' \
  '--no-force-rgba-osd-rendering' \
  '--no-screenshot-jpeg-baseline' \
  '--no-vd-lavc-check-hw-profile' \
  '--ass-vsfilter-aspect-compat' \
  '--no-cursor-autohide-fs-only' \
  '--demuxer-mkv-fix-timestamps' \
  '--demuxer-rawvideo-mp-format=-:Image format:' \
  '--screenshot-png-compression=-:Integer (0 to 9) (default\: 7):' \
  '--ass-vsfilter-color-compat=-:Choices\: no basic full force-601 (default\: basic):(no basic full force-601)' \
  '--no-audio-pitch-correction' \
  '--demuxer-rawaudio-channels=-:Audio channels or channel map (1 to any):' \
  '--demuxer-readahead-packets=-:Integer (0 to 16000) (default\: 0):' \
  '--no-input-default-bindings' \
  '--screenshot-high-bit-depth' \
  '--screenshot-tag-colorspace' \
  '--no-ass-scale-with-window' \
  '--ass-vsfilter-blur-compat' \
  '--demuxer-lavf-genpts-mode=-:Choices\: lavf no (default\: no):(lavf no)' \
  '--force-rgba-osd-rendering' \
  '--no-force-window-position' \
  '--no-load-unsafe-playlists' \
  '--no-save-position-on-quit' \
  '--screenshot-jpeg-baseline' \
  '--screenshot-jpeg-optimize=-:Integer (0 to 100) (default\: 100):' \
  '--no-sub-scale-with-window' \
  '--vd-lavc-check-hw-profile' \
  '--chapter-merge-threshold=-:Integer (0 to 10000) (default\: 100):' \
  '--cursor-autohide-fs-only' \
  '--demuxer-lavf-buffersize=-:Integer (1 to 10485760) (default\: 32768):' \
  '--demuxer-lavf-probescore=-:Integer (1 to 100) (default\: 26):' \
  '--demuxer-rawaudio-format=-:Choices\: u8 s8 u16le u16be s16le u16be u24le u24be s24le s24be u32le u32be s32le s32be floatle floatbe doublele doublebe u16 s16 u24 s24 u32 s32 float double (default\: s16le):(u8 s8 u16le u16be s16le u16be u24le u24be s24le s24be u32le u32be s32le s32be floatle floatbe doublele doublebe u16 s16 u24 s24 u32 s32 float double)' \
  '--demuxer-rawvideo-format=-:FourCC:' \
  '--demuxer-readahead-bytes=-:Integer (0 to 419430400) (default\: 0):' \
  '--no-fs-black-out-screens' \
  '--screenshot-jpeg-quality=-:Integer (0 to 100) (default\: 90):' \
  '--audio-pitch-correction' \
  '--chapter-seek-threshold=-:Double (default\: 5.000000):' \
  '--demuxer-lavf-cryptokey=-:String (default\: ):' \
  '--demuxer-lavf-probesize=-:Integer (32 to 2147483647) (default\: 0):' \
  '--demuxer-rawvideo-codec=-:String (default\: ):' \
  '--demuxer-readahead-secs=-:Double (0 to any) (default\: 1.000000):' \
  '--hr-seek-demuxer-offset=-:Float (default\: 0.000000):' \
  '--input-default-bindings' \
  '--input-doubleclick-time=-:Integer (0 to 1000) (default\: 300):' \
  '--ordered-chapters-files=-:String (default\: ) [file]:->files' \
  '--no-osd-scale-by-window' \
  '--screenshot-jpeg-smooth=-:Integer (0 to 100) (default\: 0):' \
  '--no-sub-scale-by-window' \
  '--sub-text-shadow-offset=-:Float (0 to 10) (default\: 0.000000):' \
  '--vd-lavc-skiploopfilter=-:Choices\: none default nonref bidir nonkey all (default\: default):(none default nonref bidir nonkey all)' \
  '--ass-scale-with-window' \
  '--no-ass-style-override' \
  '--no-demuxer-lavf-hacks' \
  '--demuxer-rawaudio-rate=-:Integer (1000 to 384000) (default\: 44100):' \
  '--demuxer-rawvideo-size=-:Integer (1 to 268435456) (default\: 0):' \
  '--force-window-position' \
  '--no-initial-audio-sync' \
  '--no-input-right-alt-gr' \
  '--no-input-x11-keyboard' \
  '--load-unsafe-playlists' \
  '--save-position-on-quit' \
  '--screenshot-png-filter=-:Integer (0 to 5) (default\: 5):' \
  '--sub-scale-with-window' \
  '--sub-text-border-color=-:Color:' \
  '--sub-text-shadow-color=-:Color:' \
  '--no-ass-force-margins' \
  '--demuxer-rawvideo-fps=-:Float (0.001 to 1000) (default\: 25.000000):' \
  '--fs-black-out-screens' \
  '--no-hr-seek-framedrop' \
  '--no-input-appleremote' \
  '--no-input-vo-keyboard' \
  '--no-keepaspect-window' \
  '--no-on-all-workspaces' \
  '--pts-association-mode=-:Choices\: auto decoder sort (default\: decoder):(auto decoder sort)' \
  '--screenshot-directory=-:String (default\: ):' \
  '--no-sub-clear-on-seek' \
  '--sub-text-border-size=-:Float (0 to 10) (default\: 3.000000):' \
  '--no-tv-scan-autostart' \
  '--demuxer-lavf-format=-:String (default\: ):' \
  '--no-input-app-events' \
  '--input-key-fifo-size=-:Integer (2 to 65000) (default\: 7) [global]:' \
  '--no-input-media-keys' \
  '--no-native-keyrepeat' \
  '--no-ordered-chapters' \
  '--osd-scale-by-window' \
  '--screenshot-template=-:String (default\: mpv-shot%n):' \
  '--no-stop-screensaver' \
  '--no-stretch-dvd-subs' \
  '--sub-scale-by-window' \
  '--sub-text-back-color=-:Color:' \
  '--no-tv-immediatemode' \
  '--no-use-filedir-conf' \
  '--no-vd-lavc-bitexact' \
  '--no-vd-lavc-show-all' \
  '--volume-restore-data=-:String (default\: ):' \
  '--no-ad-lavc-downmix' \
  '--ass-style-override=-:Choices\: no yes force signfs (default\: yes):(no yes force signfs)' \
  '--no-audio-file-auto' \
  '--no-cursor-autohide' \
  '--demuxer-lavf-hacks' \
  '--demuxer-rawvideo-h=-:Integer (1 to 8192) (default\: 720):' \
  '--demuxer-rawvideo-w=-:Integer (1 to 8192) (default\: 1280):' \
  '--heartbeat-interval=-:Float (0 to any) (default\: 30.000000):' \
  '--http-header-fields=-:String list (default\: ):' \
  '--initial-audio-sync' \
  '--input-right-alt-gr' \
  '--input-x11-keyboard' \
  '--monitorpixelaspect=-:Float (0.2 to 9) (default\: 1.000000):' \
  '--reset-on-next-file=-:String list (default\: ) [global]:' \
  '--no-resume-playback' \
  '--no-sub-forced-only' \
  '--sub-text-font-size=-:Float (1 to 9000) (default\: 55.000000):' \
  '--no-sub-use-margins' \
  '--term-osd-bar-chars=-:String (default\: [-+-]):' \
  '--no-window-dragging' \
  '--no-ad-spdif-dtshd' \
  '--ass-force-margins' \
  '--audio-client-name=-:String (default\: mpv):' \
  '--no-demuxer-thread' \
  '--force-media-title=-:String (default\: ):' \
  '--hr-seek-framedrop' \
  '--input-appleremote' \
  '--no-input-terminal' \
  '--input-unix-socket=-:String (default\: ) [file]:->files' \
  '--input-vo-keyboard' \
  '--keepaspect-window' \
  '--on-all-workspaces' \
  '--osd-shadow-offset=-:Float (0 to 10) (default\: 0.000000):' \
  '--screenshot-format=-:String (default\: jpg):' \
  '--sub-clear-on-seek' \
  '--no-sub-fix-timing' \
  '--sub-text-margin-x=-:Integer (0 to 300) (default\: 25):' \
  '--sub-text-margin-y=-:Integer (0 to 600) (default\: 22):' \
  '--no-sub-visibility' \
  '--tv-scan-autostart' \
  '--tv-scan-threshold=-:Integer (1 to 100) (default\: 50):' \
  '--vd-lavc-framedrop=-:Choices\: none default nonref bidir nonkey all (default\: nonref):(none default nonref bidir nonkey all)' \
  '--vd-lavc-skipframe=-:Choices\: none default nonref bidir nonkey all (default\: default):(none default nonref bidir nonkey all)' \
  '--video-stereo-mode=-:Choices\: mono sbs2l ab2r ab2l checkr checkl irr irl icr icl arcc sbs2r agmc (default\: mono):(mono sbs2l ab2r ab2l checkr checkl irr irl icr icl arcc sbs2r agmc)' \
  '--no-video-unscaled' \
  '--ass-line-spacing=-:Float (-1000 to 1000) (default\: 0.000000):' \
  '--no-audio-display' \
  '--audio-samplerate=-:Integer (1000 to 384000) (default\: 0):' \
  '--no-cache-default' \
  '--no-embeddedfonts' \
  '--no-gapless-audio' \
  '--input-app-events' \
  '--input-media-keys' \
  '--native-keyrepeat' \
  '--ordered-chapters' \
  '--osd-border-color=-:Color:' \
  '--no-osd-fractions' \
  '--osd-shadow-color=-:Color:' \
  '--no-secondary-sid' \
  '--stop-screensaver' \
  '--stretch-dvd-subs' \
  '--sub-text-align-x=-:Choices\: left center right (default\: center):(left center right)' \
  '--sub-text-align-y=-:Choices\: top center bottom (default\: bottom):(top center bottom)' \
  '--no-sub-text-bold' \
  '--sub-text-spacing=-:Float (-10 to 10) (default\: 0.000000):' \
  '--term-playing-msg=-:String (default\: ):' \
  '--tv-immediatemode' \
  '--use-filedir-conf' \
  '--vd-lavc-bitexact' \
  '--vd-lavc-show-all' \
  '--vd-lavc-skipidct=-:Choices\: none default nonref bidir nonkey all (default\: default):(none default nonref bidir nonkey all)' \
  '--ytdl-raw-options=-:Key/value list (default\: ) [global]:' \
  '--ad-lavc-downmix' \
  '--ad-lavc-threads=-:Integer (1 to 16) (default\: 1):' \
  '--ass-force-style=-:String list (default\: ):' \
  '--audio-file-auto=-:Choices\: no exact fuzzy all (default\: exact):(no exact fuzzy all)' \
  '--autofit-smaller=-:Window size (default\: ):' \
  '--cache-file-size=-:Integer (0 to 2147483647) (default\: 1048576):' \
  '--cursor-autohide=-:Choices\: no always (or an integer) (0 to 30000) (default\: 1000):(no always)' \
  '--field-dominance=-:Choices\: auto top bottom (default\: auto):(auto top bottom)' \
  '--no-force-window' \
  '--no-input-cursor' \
  '--list-properties' \
  '--no-load-scripts' \
  '--network-timeout=-:Double (0 to any) (default\: 0.000000):' \
  '--no-video-aspect' \
  '--osd-bar-align-x=-:Float (-1 to 1) (default\: 0.000000):' \
  '--osd-bar-align-y=-:Float (-1 to 1) (default\: 0.500000):' \
  '--osd-border-size=-:Float (0 to 10) (default\: 3.000000):' \
  '--osd-playing-msg=-:String (default\: ):' \
  '--resume-playback' \
  '--sub-forced-only' \
  '--sub-use-margins' \
  '--no-term-osd-bar' \
  '--term-status-msg=-:String (default\: ):' \
  '--no-use-text-osd' \
  '--no-vd-lavc-fast' \
  '--vd-lavc-threads=-:Integer (0 to 16) (default\: 0):' \
  '--no-video-rotate' \
  '--window-dragging' \
  '--ad-lavc-ac3drc=-:Float (0 to 6) (default\: 0.000000):' \
  '--ad-spdif-dtshd' \
  '--audio-channels=-:Audio channels or channel map (0 to any):' \
  '--autofit-larger=-:Window size (default\: ):' \
  '--no-cache-pause' \
  '--cache-seek-min=-:Integer (0 to 2147483647) (default\: 500):' \
  '--no-correct-pts' \
  '--no-deinterlace' \
  '--demuxer-lavf-o=-:Key/value list (default\: ):' \
  '--demuxer-thread' \
  '--no-hls-bitrate' \
  '--input-ar-delay=-:Integer (default\: 200) [global]:' \
  '--input-terminal' \
  '--list-protocols' \
  '--no-merge-files' \
  '--osd-back-color=-:Color:' \
  '--osd-status-msg=-:String (default\: ):' \
  '--rtsp-transport=-:Choices\: lavf udp tcp http (default\: tcp):(lavf udp tcp http)' \
  '--stream-capture=-:String (default\: ) [file]:->files' \
  '--sub-fix-timing' \
  '--sub-text-color=-:Color:' \
  '--sub-visibility' \
  '--tv-scan-period=-:Float (0.1 to 2) (default\: 0.500000):' \
  '--video-unscaled' \
  '--audio-demuxer=-:String (default\: ):' \
  '--audio-display=-:Choices\: no attachment (default\: attachment):(no attachment)' \
  '--cache-default=-:Choices\: no (or an integer) (32 to 2147483647) (default\: 150000):(no)' \
  '--cache-initial=-:Integer (0 to 2147483647) (default\: 0):' \
  '--chapters-file=-:String (default\: ) [file]:->files' \
  '--embeddedfonts' \
  '--no-fullscreen' \
  '--gapless-audio=-:Choices\: no yes weak (default\: weak):(no yes weak)' \
  '--heartbeat-cmd=-:String (default\: ):' \
  '--input-ar-rate=-:Integer (default\: 40) [global]:' \
  '--input-cmdlist' \
  '--input-keylist' \
  '--no-input-test' \
  '--no-keepaspect' \
  '--monitoraspect=-:Float (0 to 9) (default\: 0.000000):' \
  '--no-msg-module' \
  '--no-oneverdrop' \
  '--osd-font-size=-:Float (1 to 9000) (default\: 55.000000):' \
  '--osd-fractions' \
  '--secondary-sid=-:Choices\: no auto (or an integer) (0 to 8190) (default\: no):(no auto)' \
  '--stream-lavf-o=-:Key/value list (default\: ):' \
  '--sub-text-blur=-:Float (0 to 20) (default\: 0.000000):' \
  '--sub-text-bold' \
  '--sub-text-font=-:String (default\: sans-serif):' \
  '--no-tls-verify' \
  '--tv-brightness=-:Integer (-100 to 100) (default\: 0):' \
  '--tv-saturation=-:Integer (-100 to 100) (default\: 0):' \
  '--video-align-x=-:Float (-1 to 1) (default\: 0.000000):' \
  '--video-align-y=-:Float (-1 to 1) (default\: 0.000000):' \
  '--audio-buffer=-:Double (0 to 10) (default\: 0.200000):' \
  '--audio-device=-:String (default\: auto):' \
  '--audio-format=-:Audio format:' \
  '--cookies-file=-:String (default\: ) [file]:->files' \
  '--display-tags=-:String list (default\: Artist,Album,Album_Artist,Comment,Composer,Genre,Performer,Title,Track,icy-title):' \
  '--force-window=-:Choices\: no yes immediate (default\: no):(no yes immediate)' \
  '--no-framedrop' \
  '--hwdec-codecs=-:String (default\: h264,vc1,wmv3,hevc):' \
  '--input-cursor' \
  '--no-keep-open' \
  '--list-options' \
  '--load-scripts' \
  '--no-loop-file' \
  '--no-msg-color' \
  '--no-ometadata' \
  '--osd-duration=-:Integer (0 to 3600000) (default\: 1000):' \
  '--osd-margin-x=-:Integer (0 to 300) (default\: 25):' \
  '--osd-margin-y=-:Integer (0 to 600) (default\: 22):' \
  '--really-quiet' \
  '--show-profile=-:String (default\: ) [nocfg]:->show-profile' \
  '--sub-codepage=-:String (default\: auto):' \
  '--term-osd-bar' \
  '--tv-audiorate=-:Integer (default\: 44100):' \
  '--use-text-osd' \
  '--vd-lavc-fast' \
  '--video-aspect=-:Float (-1 to 10) (default\: -1.000000):' \
  '--video-rotate=-:Choices\: no (or an integer) (0 to 360) (default\: 0):(no)' \
  '--window-scale=-:Float (0.001 to 100) (default\: 1.000000):' \
  '--af-defaults=-:Object settings list (default\: ):' \
  '--ao-defaults=-:Object settings list (default\: ):' \
  '--ass-hinting=-:Choices\: none light normal native (default\: none):(none light normal native)' \
  '--audio-delay=-:Float (-100 to 100) (default\: 0.000000):' \
  '--audio-spdif=-:String (default\: ):' \
  '--no-autosync' \
  '--cache-pause' \
  '--correct-pts' \
  '--deinterlace=-:Choices\: auto no yes (default\: auto):(auto no yes)' \
  '--display-fps=-:Double (0 to any) (default\: 0.000000):' \
  '--hls-bitrate=-:Choices\: no min max (default\: max):(no min max)' \
  '--merge-files' \
  '--no-msg-time' \
  '--no-oautofps' \
  '--no-oharddup' \
  '--osd-align-x=-:Choices\: left center right (default\: left):(left center right)' \
  '--osd-align-y=-:Choices\: top center bottom (default\: top):(top center bottom)' \
  '--no-osd-bold' \
  '--osd-spacing=-:Float (-10 to 10) (default\: 0.000000):' \
  '--script-opts=-:Key/value list (default\: ) [global]:' \
  '--softvol-max=-:Float (100 to 1000) (default\: 130.000000):' \
  '--stream-dump=-:String (default\: ) [file]:->files' \
  '--no-sub-auto' \
  '--sub-demuxer=-:String (default\: ):' \
  '--no-sub-gray' \
  '--no-term-osd' \
  '--no-terminal' \
  '--tls-ca-file=-:String (default\: ) [file]:->files' \
  '--no-tv-audio' \
  '--tv-automute=-:Integer (0 to 255) (default\: 0):' \
  '--tv-chanlist=-:String (default\: europe-east):' \
  '--tv-channels=-:String list (default\: ):' \
  '--tv-contrast=-:Integer (-100 to 100) (default\: 0):' \
  '--vf-defaults=-:Object settings list (default\: ):' \
  '--video-pan-x=-:Float (-3 to 3) (default\: 0.000000):' \
  '--video-pan-y=-:Float (-3 to 3) (default\: 0.000000):' \
  '--vo-defaults=-:Object settings list (default\: ):' \
  '--ytdl-format=-:String (default\: best) [global]:' \
  '--ass-shaper=-:Choices\: simple complex (default\: complex):(simple complex)' \
  '--ass-styles=-:String (default\: ) [file]:->files' \
  '--audio-file=-:String list (default\: ) [file]:->files' \
  '--brightness=-:Integer (-100 to 100) (default\: 1000):' \
  '--cache-file=-:String (default\: ) [file]:->files' \
  '--cache-secs=-:Double (0 to any) (default\: 10.000000):' \
  '--config-dir=-:String (default\: ) [global] [nocfg]:' \
  '--no-cookies' \
  '--dump-stats=-:String (default\: ) [global]:' \
  '--fullscreen' \
  '--no-hr-seek' \
  '--input-conf=-:String (default\: ) [global] [file]:->files' \
  '--input-file=-:String (default\: ) [global] [file]:->files' \
  '--input-test' \
  '--keepaspect' \
  '--msg-module' \
  '--no-oafirst' \
  '--no-ocopyts' \
  '--oneverdrop' \
  '--no-osd-bar' \
  '--no-ovfirst' \
  '--saturation=-:Integer (-100 to 100) (default\: 1000):' \
  '--no-shuffle' \
  '--no-softvol' \
  '--no-sub-ass' \
  '--sws-scaler=-:Choices\: fast-bilinear bilinear bicubic x point area bicublin gauss sinc lanczos spline (default\: bicubic):(fast-bilinear bilinear bicubic x point area bicublin gauss sinc lanczos spline)' \
  '--tls-verify' \
  '--tv-adevice=-:String (default\: ):' \
  '--tv-audioid=-:Integer (0 to 9) (default\: 0):' \
  '--tv-channel=-:String (default\: ):' \
  '--no-untimed' \
  '--user-agent=-:String (default\: mpv git-ed44f21):' \
  '--video-zoom=-:Float (-20 to 20) (default\: 0.000000):' \
  '--ab-loop-a=-:Time (default\: no):' \
  '--ab-loop-b=-:Time (default\: no):' \
  '--ad-lavc-o=-:Key/value list (default\: ):' \
  '--no-border' \
  '--no-config' \
  '--no-ff-aid' \
  '--no-ff-sid' \
  '--no-ff-vid' \
  '--framedrop=-:Choices\: no vo decoder decoder+vo (default\: vo):(no vo decoder decoder+vo)' \
  '--fs-screen=-:Choices\: all current (or an integer) (0 to 32) (default\: current):(all current)' \
  '--keep-open=-:Choices\: no yes always (default\: no):(no yes always)' \
  '--loop-file=-:Choices\: no yes inf (or an integer) (0 to 10000) (default\: no):(no yes inf)' \
  '--msg-color' \
  '--msg-level=-:Output verbosity levels (default\: ) [global]:' \
  '--ometadata' \
  '--no-orawts' \
  '--osd-bar-h=-:Float (0.1 to 50) (default\: 3.125000):' \
  '--osd-bar-w=-:Float (1 to 100) (default\: 75.000000):' \
  '--osd-color=-:Color:' \
  '--osd-level=-:Choices\: 0 1 2 3 (default\: 1):(0 1 2 3)' \
  '--osd-scale=-:Float (0 to 100) (default\: 1.000000):' \
  '--sub-delay=-:Float (default\: 0.000000):' \
  '--sub-gauss=-:Float (0 to 3) (default\: 0.000000):' \
  '--sub-paths=-:String list (default\: ):' \
  '--sub-scale=-:Float (0 to 100) (default\: 1.000000):' \
  '--sub-speed=-:Float (default\: 1.000000):' \
  '--tv-device=-:String (default\: ):' \
  '--tv-driver=-:String (default\: ):' \
  '--tv-height=-:Integer (0 to 4096) (default\: -1):' \
  '--tv-outfmt=-:FourCC:' \
  '--vd-lavc-o=-:Key/value list (default\: ):' \
  '--autosync=-:Choices\: no (or an integer) (0 to 10000) (default\: 0):(no)' \
  '--no-cache' \
  '--contrast=-:Integer (-100 to 100) (default\: 1000):' \
  '--geometry=-:Window geometry (default\: ):' \
  '--no-hwdec' \
  '--log-file=-:String (default\: ) [global] [file]:->files' \
  '--msg-time' \
  '--no-audio' \
  '--no-video' \
  '--oaoffset=-:Float (-1000000 to 1000000) (default\: 0.000000) [global]:' \
  '--oautofps' \
  '--oharddup' \
  '--no-ontop' \
  '--osd-blur=-:Float (0 to 20) (default\: 0.000000):' \
  '--osd-bold' \
  '--osd-font=-:String (default\: sans-serif):' \
  '--osd-msg1=-:String (default\: ):' \
  '--osd-msg2=-:String (default\: ):' \
  '--osd-msg3=-:String (default\: ):' \
  '--ovoffset=-:Float (-1000000 to 1000000) (default\: 0.000000) [global]:' \
  '--no-pause' \
  '--playlist=-:String (1 to any) (default\: ) [nocfg] [file]:->files' \
  '--no-quiet' \
  '--referrer=-:String (default\: ):' \
  '--sub-auto=-:Choices\: no exact fuzzy all (default\: exact):(no exact fuzzy all)' \
  '--sub-file=-:String list (default\: ) [file]:->files' \
  '--sub-gray' \
  '--term-osd=-:Choices\: force auto no (default\: auto):(force auto no)' \
  '--terminal' \
  '--tv-audio' \
  '--tv-input=-:Integer (default\: 0):' \
  '--tv-width=-:Integer (0 to 4096) (default\: -1):' \
  '--x11-name=-:String (default\: ):' \
  '--autofit=-:Window size (default\: ):' \
  '--chapter=-:Int[-Int]:' \
  '--cookies' \
  '--demuxer=-:String (default\: ):' \
  '--edition=-:Choices\: auto (or an integer) (0 to 8190) (default\: auto):(auto)' \
  '--hr-seek=-:Choices\: no absolute yes always (default\: absolute):(no absolute yes always)' \
  '--no-idle' \
  '--include=-:String (default\: ) [file]:->files' \
  '--no-loop' \
  '--mf-type=-:String (default\: ):' \
  '--no-mute' \
  '--oacopts=-:String list (default\: ) [global]:' \
  '--oafirst' \
  '--ocopyts' \
  '--omaxfps=-:Float (0 to 1000000) (default\: 0.000000) [global]:' \
  '--osd-bar' \
  '--ovcopts=-:String list (default\: ) [global]:' \
  '--ovfirst' \
  '--panscan=-:Float (0 to 1) (default\: 0.000000):' \
  '--profile=-:String list (default\: ):->profile' \
  '--shuffle' \
  '--softvol=-:Choices\: no yes auto (default\: auto):(no yes auto)' \
  '--sub-ass' \
  '--sub-fps=-:Float (default\: 0.000000):' \
  '--sub-pos=-:Integer (0 to 100) (default\: 100):' \
  '--sws-cgb=-:Float (0 to 100) (default\: 0.000000):' \
  '--sws-chs=-:Integer (default\: 0):' \
  '--sws-cvs=-:Integer (default\: 0):' \
  '--sws-lgb=-:Float (0 to 100) (default\: 0.000000):' \
  '--tv-freq=-:String (default\: ):' \
  '--tv-gain=-:Integer (-1 to 100) (default\: -1):' \
  '--tv-norm=-:String (default\: pal):' \
  '--untimed' \
  '--version' \
  '--no-ytdl' \
  '--no-aid' \
  '--border' \
  '--config' \
  '--ff-aid=-:Choices\: no auto (or an integer) (0 to 8190) (default\: auto):(no auto)' \
  '--ff-sid=-:Choices\: no auto (or an integer) (0 to 8190) (default\: auto):(no auto)' \
  '--ff-vid=-:Choices\: no auto (or an integer) (0 to 8190) (default\: auto):(no auto)' \
  '--frames=-:Choices\: all (or an integer) (0 to 2147483647) (default\: all):(all)' \
  '--length=-:Relative time or percent position:' \
  '--mf-fps=-:Double (default\: 1.000000):' \
  '--no-sub' \
  '--ofopts=-:String list (default\: ) [global]:' \
  '--orawts' \
  '--no-osc' \
  '--screen=-:Choices\: default (or an integer) (0 to 32) (default\: default):(default)' \
  '--script=-:String list (default\: ) [global] [file]:->files' \
  '--no-sid' \
  '--sws-cs=-:Float (-100 to 100) (default\: 0.000000):' \
  '--sws-ls=-:Float (-100 to 100) (default\: 0.000000):' \
  '--tv-fps=-:Float (default\: -1.000000):' \
  '--tv-hue=-:Integer (-100 to 100) (default\: 0):' \
  '--no-vid' \
  '--volume=-:Float (-1 to 1000) (default\: -1.000000):' \
  '--alang=-:String list (default\: ):' \
  '--cache=-:Choices\: no auto yes (or an integer) (32 to 2147483647) (default\: auto):(no auto yes)' \
  '--no-fs' \
  '--gamma=-:Integer (-100 to 100) (default\: 1000):' \
  '--hwdec=-:Choices\: no auto vdpau vda vaapi vaapi-copy dxva2-copy rpi (default\: no):(no auto vdpau vda vaapi vaapi-copy dxva2-copy rpi)' \
  '--index=-:Choices\: default recreate (default\: default):(default recreate)' \
  '--ontop' \
  '--pause' \
  '--quiet' \
  '--slang=-:String list (default\: ):' \
  '--speed=-:Double (0.01 to 100) (default\: 1.000000):' \
  '--sstep=-:Double (0 to any) (default\: 0.000000):' \
  '--start=-:Relative time or percent position:' \
  '--title=-:String (default\: mpv - ${?media-title\:${media-title}}${!media-title\:No file.}):' \
  '--help' \
  '--idle=-:Choices\: no once yes (default\: no):(no once yes)' \
  '--loop=-:Choices\: no inf yes force (or an integer) (1 to 10000) (default\: no):(no inf yes force)' \
  '--mute=-:Choices\: auto no yes (default\: auto):(auto no yes)' \
  '--ofps=-:Float (0 to 1000000) (default\: 0.000000) [global]:' \
  '--ytdl' \
  '--aid=-:Choices\: no auto (or an integer) (0 to 8190) (default\: auto):(no auto)' \
  '--end=-:Relative time or percent position:' \
  '--fps=-:Double (0 to any) (default\: 0.000000):' \
  '--hue=-:Integer (-100 to 100) (default\: 1000):' \
  '--oac=-:String (default\: ) [global]:' \
  '--osc' \
  '--ovc=-:String (default\: ) [global]:' \
  '--sid=-:Choices\: no auto (or an integer) (0 to 8190) (default\: auto):(no auto)' \
  '--vid=-:Choices\: no auto (or an integer) (0 to 8190) (default\: auto):(no auto)' \
  '--wid=-:Integer64 (default\: -1):' \
  '--ad=-:String (default\: lavc\:libdcadec,-spdif\:*):' \
  '--af=-:Object settings list (default\: ):->af' \
  '--ao=-:Object settings list (default\: ):->ao' \
  '--fs' \
  '--mc=-:Float (0 to 100) (default\: -1.000000):' \
  '--of=-:String (default\: ) [global]:' \
  '--vd=-:String (default\: ):' \
  '--vf=-:Object settings list (default\: ):->vf' \
  '--vo=-:Object settings list (default\: ):->vo' \
  '--h' \
  '--o=-:String (default\: ) [global] [nocfg]:' \
  '--v' \
  '--V' \
  '--{' \
  '--}' \
  '*:files:->mfiles' && rc=0

case $state in
  ao)
    _values -s , 'audio outputs' \
      'coreaudio[CoreAudio AudioUnit]' \
      'null[Null audio output]' \
      'coreaudio_exclusive[CoreAudio Exclusive Mode]' \
      'pcm[RAW PCM/WAVE file writer audio output]' \
    && rc=0
  ;;

  vo)
    _values -s , 'video outputs' \
      'opengl[Extended OpenGL Renderer]' \
      'null[Null video output]' \
      'image[Write video frames to image files]' \
      'opengl-hq[Extended OpenGL Renderer (high quality rendering preset)]' \
    && rc=0
  ;;

  af)
    _values -s , 'audio filters' \
      'dummy[dummy]' \
      'delay[Delay audio filter]' \
      'channels[Insert or remove channels]' \
      'format[Force audio format]' \
      'volume[Volume control audio filter]' \
      'equalizer[Equalizer audio filter]' \
      'pan[Panning audio filter]' \
      'surround[Surround decoder filter]' \
      'sub[Audio filter for adding a sub-base channel]' \
      'export[Sound export filter]' \
      'drc[Dynamic range compression filter]' \
      'extrastereo[Increase difference between audio channels]' \
      'lavcac3enc[runtime encode to ac3 using libavcodec]' \
      'lavrresample[Sample frequency conversion using libavresample]' \
      'sweep[sine sweep]' \
      'hrtf[HRTF Headphone]' \
      'center[Audio filter for adding a center channel]' \
      'sinesuppress[Sine Suppress]' \
      'karaoke[Simple karaoke/voice-removal audio filter]' \
      'scaletempo[Scale audio tempo while maintaining pitch]' \
      'lavfi[libavfilter bridge]' \
    && rc=0
  ;;

  vf)
    _values -s , 'video filters' \
      'crop[cropping]' \
      'expand[expanding]' \
      'scale[software scaling]' \
      'format[force output format]' \
      'noformat[disallow one output format]' \
      'flip[flip image upside-down]' \
      'mirror[horizontal mirror]' \
      'lavfi[libavfilter bridge]' \
      'rotate[rotate]' \
      'noise[noise generator]' \
      'gradfun[gradient deband]' \
      'unsharp[unsharp mask & gaussian blur]' \
      'hqdn3d[High Quality 3D Denoiser]' \
      'pullup[pullup (from field sequence to frames)]' \
      'delogo[simple logo remover]' \
      'yadif[Yet Another DeInterlacing Filter]' \
      'eq[Software equalizer]' \
      'dsize[reset displaysize/aspect]' \
      'sub[Render subtitles]' \
      'stereo3d[stereoscopic 3d view]' \
      'buffer[buffer a number of frames]' \
      'dlopen[Dynamic library filter]' \
    && rc=0
  ;;

  profile|show-profile)
    local -a profiles
    local current
    for current in "${(@f)$($words[1] --profile=help)}"; do
      current=${current//\*/\\\*}
      current=${current//\:/\\\:}
      current=${current//\[/\\\[}
      current=${current//\]/\\\]}
      if [[ $current =~ $'\t'([^$'\t']*)$'\t'(.*) ]]; then
        if [[ -n $match[2] ]]; then
          current="$match[1][$match[2]]"
        else
          current="$match[1]"
        fi
        profiles=($profiles $current)
      fi
    done
    if [[ $state == show-profile ]]; then
      # For --show-profile, only one allowed
      if (( ${#profiles} > 0 )); then
        _values 'profile' $profiles && rc=0
      fi
    else
      # For --profile, multiple allowed
      profiles=($profiles 'help[list profiles]')
      _values -s , 'profile(s)' $profiles && rc=0
    fi
  ;;

  files)
    compset -P '*,'
    compset -S ',*'
    _files -r ',/ \t\n\-' && rc=0
  ;;

  mfiles)
    local expl
    _tags files urls
    while _tags; do
      _requested files expl 'media file' _files -g \
        "*.(#i)(asf|asx|avi|flac|flv|m1v|m2p|m2v|m4v|mjpg|mka|mkv|mov|mp3|mp4|mpe|mpeg|mpg|ogg|ogm|ogv|qt|rm|ts|vob|wav|webm|wma|wmv)(-.)" && rc=0
      if _requested urls; then
        while _next_label urls expl URL; do
          _urls "$expl[@]" && rc=0
          compadd -S '' "$expl[@]" rtmp:// rtsp:// http:// https:// mms:// mmst:// mmsh:// mmshttp:// rtp:// httpproxy:// hls:// rtmpe:// rtmps:// rtmpt:// rtmpte:// rtmpts:// srtp:// lavf:// ffmpeg:// udp:// ftp:// tcp:// tls:// unix:// sftp:// md5:// concat:// avdevice:// av:// tv:// memory:// null:// mf:// edl:// rar:// file:// && rc=0
        done
      fi
      (( rc )) || return 0
    done
  ;;
esac

return rc
qmega commented 9 years ago

Hmm.

For the release version, everywhere where mpv output is used is empty, so the best I can think of is that mpv failed to run. I'll submit a PR in a minute to check the exit status so things like this fail more loudly in the future. Not sure why exactly it would be happening in your case, though.

As for the --HEAD build, the script you pasted works perfectly fine for me. Could be some kind of newline or encoding issue. Can you upload your exact file somewhere? The *:files:->mfiles that it's trying to run is logically on line 10 and not in command position.

tetherit commented 9 years ago

@qmeta ah, after closing the terminal and opening again, it seems the --HEAD version is not throwing errors anymore, it's just the release version.

qmega commented 9 years ago

Can you try building release with the linked PR applied? Hopefully it will throw some kind of error.

tetherit commented 9 years ago

Now I'm not able to reproduce since downgrading (without the pull request) :( - not quite sure what was going on!