Skip to content

Try to fallback to any plugin upon failure to init output plugin - #1416

Merged
flyingmutant merged 2 commits into
cmus:masterfrom
WalrusDevil:output_plugin_fallback
Aug 20, 2025
Merged

flyingmutant merged 2 commits into
cmus:masterfrom
WalrusDevil:output_plugin_fallback

Conversation

@WalrusDevil

Copy link
Copy Markdown
Contributor

Bad values for output_plugin set in ~/.config/cmus/rc or ~/.config/cmus/autosave prevent output_plugin from being initialized.

This fixes that.

@pgaskin

pgaskin commented Mar 23, 2025

Copy link
Copy Markdown
Member

I personally think we should still error for rc to keep it consistent with the other commands. @gavtroy, any opinion?

Probably add a global flag is_loading_autosave and set it before and after the autosave load in options.c, and check for it around the output plugin stuff here.

@gavtroy

gavtroy commented Mar 24, 2025

Copy link
Copy Markdown
Collaborator

You mean allow fallback to op_select_any() only on startup but keep strict behavior for an interactive "set output_plugin" command? Sure. In that case ui_initialized probably works fine to make the distinction.

@WalrusDevil

Copy link
Copy Markdown
Contributor Author

I think this already gives most of the desired behavior, my comment might be misleading.

If there is a bad value from autosave or rc it still errors, but calls op_select_any() since op is not init'd

Afterwards, set output_plugin would only ever call op_select_any() if the startup op_select_any() failed.

But I can add a check for ui_initialized so op_select_any() only gets called at startup.

@pgaskin
pgaskin self-requested a review August 3, 2025 02:57

@pgaskin pgaskin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works fine.

Note that ui_initialized is set after the autosave/rc is loaded and the output plugin is initialized.

@flyingmutant
flyingmutant force-pushed the output_plugin_fallback branch from e9034e8 to 951337e Compare August 20, 2025 17:48
@flyingmutant
flyingmutant merged commit b3dd999 into cmus:master Aug 20, 2025
@BrewTestBot BrewTestBot mentioned this pull request Oct 28, 2026
1 task done
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Nov 2, 2026
https://build.opensuse.org/request/show/1394501
by user mia + anag_factory
- Update to 2.13.0
  * Set the minimum requested AAudio buffer capacity
    gh#cmus/cmus#1386
  * Check for libavutil pkg-config
    gh#cmus/cmus#1388
  * Add sort by duration
    gh#cmus/cmus#1440
  * Respect scroll_offset setting when resizing window
    gh#cmus/cmus#1413
  * Try to fallback to any plugin upon failure to init output
    plugin
    gh#cmus/cmus#1416
  * PulseAudio bugfixes and APPLICATION_ID
    gh#cmus/cmus#1405
  * ip/ffmpeg fixes and ffmpeg 8.0 support
    gh#cmus/cmus#1444
  * CUE handling improvements and replaygain/genre support
    gh#cmus/cmus#1406
  * Fix for missing Icecast streaming bitrate display.
    gh#cmus/cmus#1451
  * op/mixer_alsa: alsamixer's volume scale; setting mixer control
    like aplay does it
    gh#cmus/cmus#1445
  * ip/ffmpeg: fix seeking and
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants