mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-30 23:42:25 -05:00 
			
		
		
		
	[bugfix] better handle ogg container format (#3365)
This commit is contained in:
		
					parent
					
						
							
								497ebd8c4e
							
						
					
				
			
			
				commit
				
					
						6f3583559f
					
				
			
		
					 1 changed files with 13 additions and 5 deletions
				
			
		|  | @ -381,12 +381,20 @@ 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 { | ||||||
|  | 			case "theora", "dirac": // daala, tarkin | ||||||
| 				return gtsmodel.FileTypeVideo, "ogv" | 				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" | 				return gtsmodel.FileTypeAudio, "ogg" | ||||||
| 			} | 			} | ||||||
|  | 		} | ||||||
| 	case "matroska,webm": | 	case "matroska,webm": | ||||||
| 		switch { | 		switch { | ||||||
| 		case len(res.video) > 0: | 		case len(res.video) > 0: | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue