Skip to content

Commit

Permalink
Further fixes to audio/video provider selection
Browse files Browse the repository at this point in the history
- Fix selection not aborting when the preferred provider returns null
- Fix the default video provider being "ffmpegsource" (lowercase)
  instead of "FFmpegSource", which would trip up provider selection
- More generally, make sure the preferred video provider actually exists
  and fall back to the default (FFmpegSource) if not.

Fixes arch1t3cht#23 .
Fixes arch1t3cht#61 .
Fixes arch1t3cht#83 .
  • Loading branch information
arch1t3cht authored and 0tkl committed Oct 16, 2023
1 parent d8c611d commit 4fde3a7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/audio_provider_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,12 @@ std::unique_ptr<agi::AudioProvider> SelectAudioProvider(fs::path const& filename

auto tried_providers = sorted.begin();

LOG_D("provider") << "Preferred Provider: " << preferred;
for (; tried_providers < sorted.end(); tried_providers++) {
auto factory = *tried_providers;
std::string err;
try {
LOG_D("provider") << "Trying " << factory->name;
auto provider = factory->create(filename, br);
if (!provider) {
err = "Failed to create provider."; // Some generic error message here
Expand Down

0 comments on commit 4fde3a7

Please sign in to comment.