Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] Completion/Unix/_ffmpeg: fix crash and update for modern ffmpeg



-  [[ $x == \([' *:-']##\)* ]] && continue # skip -help etc
+  [[ $opts[x] == \([' *:-']##\)* ]] && continue # skip -help etc

On Sun, Jun 21, 2026 at 7:46 AM Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>
> while LLMs aren't great at writing code, they do spot typos pretty well. There's also
> an issue with _ffmpeg_flags not handling the -t and -d options (as well as discarding
> all compadd options, they end up in $opth which is unused):
>
> % ffmpeg -disposition <tab>
> _ffmpeg_flags: bad option: -t
>
> Feel free to roll this in with your patch of course.
>
> ---
>  Completion/Unix/Command/_ffmpeg | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/Completion/Unix/Command/_ffmpeg b/Completion/Unix/Command/_ffmpeg
> index e8b59e0293..a8d64b4f4e 100644
> --- a/Completion/Unix/Command/_ffmpeg
> +++ b/Completion/Unix/Command/_ffmpeg
> @@ -352,7 +352,7 @@ _ffmpeg_filters() {
>      v|vid*) type=V ;;
>    esac
>
> -  (( ${+opt[-T]} )) || _ffmpeg_prev_ss_type type
> +  (( ${+opth[-T]} )) || _ffmpeg_prev_ss_type type
>
>    case $type in
>      A) tag=audio-$tag desc="audio $desc" ;;
> @@ -969,7 +969,7 @@ expert_opts+=(
>    '
>    '-copyts[copy timestamps]'
>    '-start_at_zero[shift input timestamps to start at 0 (with -copyts)]'
> -  '-copytdb[specify how to set encoder time base when copying stream]:mode:((
> +  '-copytb[specify how to set encoder time base when copying stream]:mode:((
>      -1\:"decide automatically"
>      0\:"use decoder time base"
>      1\:"use demuxer time base"
> @@ -1196,7 +1196,7 @@ expert_opts+=(
>    '*-rc_override[specify rate-control override]:rate control (beg,end,quant):'
>    '*-timecode[specify timecode]:timecode (hh:mm:ss[:;.]ff)'
>    '*-pass[specify pass number for two-pass video encoding]:pass:(1 2)'
> -  '*-passlog[specify two-pass log-file prefix]:log-file prefix [ffmpeg2pass]:'
> +  '*-passlogfile[specify two-pass log-file prefix]:log-file prefix [ffmpeg2pass]:'
>    '*-intra_matrix[specify intra quantisation matrix]:intra quantisation matrix:'
>    '*-inter_matrix[specify inter quantisation matrix]:inter quantisation matrix:'
>    '*-chroma_intra_matrix[specify chroma intra quantisation matrix]:intra quantisation matrix:'
> @@ -1207,8 +1207,8 @@ expert_opts+=(
>    '*-force_key_frames[force key frames at specified timestamps]: :_ffmpeg_kf_force_conds'
>    '*-hwaccel[specify hardware acceleration for decoding]: :_ffmpeg_hwaccels'
>    '*-hwaccel_device[specify hardware-acceleration device (with -hwaccel)]: :_ffmpeg_hw_devices'
> -  '*-hwaccel_output_format[specify hardware-acceleration output format (with -hwaccel)]: :_ffmpeg_pixfmts -H'
> -  '*-autorate[automatically rotate video]'
> +  '*-hwaccel_output_format[specify hardware-acceleration output format (with -hwaccel)]: :_ffmpeg_pix_fmts -H'
> +  '*-autorotate[automatically rotate video]'
>    '*-autoscale[automatically scale video]'
>    '*-apply_cropping[automatically crop video using specified method]:crop method [all]:((
>      none\:"don'\''t apply cropping"
> --
> 2.38.1
>


-- 
Mikael Magnusson




Messages sorted by: Reverse Date, Date, Thread, Author