mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-11-22 11:46:40 +00:00
[bugfix] better handle ogg container format (#3365)
This commit is contained in:
parent
497ebd8c4e
commit
6f3583559f
|
@ -381,11 +381,19 @@ func (res *result) GetFileType() (gtsmodel.FileType, string) {
|
||||||
return gtsmodel.FileTypeAudio, "wma"
|
return gtsmodel.FileTypeAudio, "wma"
|
||||||
}
|
}
|
||||||
case "ogg":
|
case "ogg":
|
||||||
switch {
|
if len(res.video) > 0 {
|
||||||
case len(res.video) > 0:
|
switch res.video[0].codec {
|
||||||
return gtsmodel.FileTypeVideo, "ogv"
|
case "theora", "dirac": // daala, tarkin
|
||||||
case len(res.audio) > 0:
|
return gtsmodel.FileTypeVideo, "ogv"
|
||||||
return gtsmodel.FileTypeAudio, "ogg"
|
}
|
||||||
|
}
|
||||||
|
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":
|
case "matroska,webm":
|
||||||
switch {
|
switch {
|
||||||
|
|
Loading…
Reference in a new issue