diff options
| -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' } |
