diff options
Diffstat (limited to 'shared/extra-utils/ffprobe.ts')
-rw-r--r-- | shared/extra-utils/ffprobe.ts | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/shared/extra-utils/ffprobe.ts b/shared/extra-utils/ffprobe.ts index dfacd251c..b95202464 100644 --- a/shared/extra-utils/ffprobe.ts +++ b/shared/extra-utils/ffprobe.ts | |||
@@ -21,10 +21,19 @@ function ffprobePromise (path: string) { | |||
21 | // Audio | 21 | // Audio |
22 | // --------------------------------------------------------------------------- | 22 | // --------------------------------------------------------------------------- |
23 | 23 | ||
24 | const imageCodecs = new Set([ | ||
25 | 'ansi', 'apng', 'bintext', 'bmp', 'brender_pix', 'dpx', 'exr', 'fits', 'gem', 'gif', 'jpeg2000', 'jpgls', 'mjpeg', 'mjpegb', 'msp2', | ||
26 | 'pam', 'pbm', 'pcx', 'pfm', 'pgm', 'pgmyuv', 'pgx', 'photocd', 'pictor', 'png', 'ppm', 'psd', 'sgi', 'sunrast', 'svg', 'targa', 'tiff', | ||
27 | 'txd', 'webp', 'xbin', 'xbm', 'xface', 'xpm', 'xwd' | ||
28 | ]) | ||
29 | |||
24 | async function isAudioFile (path: string, existingProbe?: FfprobeData) { | 30 | async function isAudioFile (path: string, existingProbe?: FfprobeData) { |
25 | const videoStream = await getVideoStream(path, existingProbe) | 31 | const videoStream = await getVideoStream(path, existingProbe) |
32 | if (!videoStream) return true | ||
33 | |||
34 | if (imageCodecs.has(videoStream.codec_name)) return true | ||
26 | 35 | ||
27 | return !videoStream | 36 | return false |
28 | } | 37 | } |
29 | 38 | ||
30 | async function hasAudioStream (path: string, existingProbe?: FfprobeData) { | 39 | async function hasAudioStream (path: string, existingProbe?: FfprobeData) { |