[bugfix] better handle ogg container format (#3365)

This commit is contained in:
kim 2024-09-27 11:16:34 +00:00 committed by GitHub
parent 497ebd8c4e
commit 6f3583559f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -381,12 +381,20 @@ func (res *result) GetFileType() (gtsmodel.FileType, string) {
return gtsmodel.FileTypeAudio, "wma"
}
case "ogg":
switch {
case len(res.video) > 0:
if len(res.video) > 0 {
switch res.video[0].codec {
case "theora", "dirac": // daala, tarkin
return gtsmodel.FileTypeVideo, "ogv"
case len(res.audio) > 0:
}
}
if len(res.audio) > 0 {
switch res.audio[0].codec {
case "opus", "libopus":
return gtsmodel.FileTypeAudio, "opus"
default:
return gtsmodel.FileTypeAudio, "ogg"
}
}
case "matroska,webm":
switch {
case len(res.video) > 0: