mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 05:40:04 +00:00 
			
		
		
		
	sink: Make auto device name a constant
This commit is contained in:
		
							parent
							
								
									d269beab0d
								
							
						
					
					
						commit
						7d642b25e9
					
				
					 4 changed files with 5 additions and 3 deletions
				
			
		|  | @ -44,7 +44,7 @@ CubebSink::CubebSink(std::string target_device_name) : impl(std::make_unique<Imp | |||
|     if (cubeb_get_min_latency(impl->ctx, ¶ms, &minimum_latency) != CUBEB_OK) | ||||
|         LOG_CRITICAL(Audio_Sink, "Error getting minimum latency"); | ||||
| 
 | ||||
|     if (target_device_name != "auto" && !target_device_name.empty()) { | ||||
|     if (target_device_name != auto_device_name && !target_device_name.empty()) { | ||||
|         cubeb_device_collection collection; | ||||
|         if (cubeb_enumerate_devices(impl->ctx, CUBEB_DEVICE_TYPE_OUTPUT, &collection) != CUBEB_OK) { | ||||
|             LOG_WARNING(Audio_Sink, "Audio output device enumeration not supported"); | ||||
|  |  | |||
|  | @ -42,7 +42,7 @@ SDL2Sink::SDL2Sink(std::string device_name) : impl(std::make_unique<Impl>()) { | |||
|     SDL_zero(obtained_audiospec); | ||||
| 
 | ||||
|     const char* device = nullptr; | ||||
|     if (device_name != "auto" && !device_name.empty()) { | ||||
|     if (device_name != auto_device_name && !device_name.empty()) { | ||||
|         device = device_name.c_str(); | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
|  | @ -9,6 +9,8 @@ | |||
| 
 | ||||
| namespace AudioCore { | ||||
| 
 | ||||
| constexpr char auto_device_name[] = "auto"; | ||||
| 
 | ||||
| /**
 | ||||
|  * This class is an interface for an audio sink. An audio sink accepts samples in stereo signed | ||||
|  * PCM16 format to be output. Sinks *do not* handle resampling and expect the correct sample rate. | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue