diff options
| author | Mattias Andrée <m@maandree.se> | 2025-12-02 16:13:58 +0100 |
|---|---|---|
| committer | Mattias Andrée <m@maandree.se> | 2025-12-02 16:13:58 +0100 |
| commit | 28e601e5a2a647968d77db1bb0144004d1246584 (patch) | |
| tree | 3f1451aaeb48f13ad92a2ce325ff6944297f567e | |
| parent | Fix previous commit (diff) | |
| download | ffutils-28e601e5a2a647968d77db1bb0144004d1246584.tar.gz ffutils-28e601e5a2a647968d77db1bb0144004d1246584.tar.bz2 ffutils-28e601e5a2a647968d77db1bb0144004d1246584.tar.xz | |
Signed-off-by: Mattias Andrée <m@maandree.se>
| -rwxr-xr-x | ffextract-audio | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ffextract-audio b/ffextract-audio index 2611483..70ea029 100755 --- a/ffextract-audio +++ b/ffextract-audio @@ -53,7 +53,7 @@ else fi fi -getext () { +getaudioformat () { probed_file="$1" if test ! "${probed_file}" = -; then probed_file="file:${probed_file}" @@ -61,6 +61,14 @@ getext () { ffprobe -v error -select_streams a:0 -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 -- "${probed_file}" } +getext () { + ext="$(getaudioformat "$@")" + if test "${ext}" = "vorbis"; then + ext="ogg" + fi + printf '%s\n' "${ext}" +} + removeext () { printf '%s\0' "$1" | tr '\0\n' '\n\0' | sed 's/\.[^.]*$//' | tr '\0' '\n' } |
