Repository navigation
Preview: sound for video - #122
Closed
crustovsky wants to merge 2 commits into
Closed
crustovsky wants to merge 2 commits into
crustovsky wants to merge 2 commits into
Conversation
A previewed video played without sound. That was a non-goal while nothing in the app made a sound; since audio files play on Ctrl+P (#115) a silent video was the odd one out. The reasons behind the non-goal are kept: nothing is decoded in the process (rule 8) and nothing starts unasked. While a video plays, its sound plays through core::AudioPlayer, ffplay in a second child beside the ffmpeg that decodes the frames, started at the picture's position. Pause, the end, a hidden slot, a cursor move or closing the preview stop it with the picture; a seek while playing starts it again from there. The two children are only as much in step as their starts, so the sound is started 0.15 s ahead to make up for the player opening the file and the device: a preview's sync, not a player's lip sync. A file with no audio stream (the same ffprobe call an audio file gets) plays as before and nothing is said; a player that fails is one line under the details and the picture goes on. PreviewMute (Ctrl+M, the View menu, a button at the end of the transport strip shown when the video has sound) switches the sound of videos off or on. It is kept in the state file ([preview] videoSound) and is on by default, since playing is always asked for by a key. Audio files are not muted by it. Like Ctrl+P and Ctrl+0 it is a chord with no function key beside it: the Ctrl layer is full. The non-goals line is now "autoplay of video or sound". The smoke and screenshot scripts set SDL_AUDIODRIVER=dummy so a scripted session plays to nobody, and their clips carry a tone so the path is exercised. Fixes #121 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Owner
Author
|
Merged into main through #123. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #121. Stacked on #119.
core::AudioPlayer(ffplayin a second child), started at the picture's position and stopped with it; a seek restarts it there.PreviewMute, default Ctrl+M, plus a button on the transport strip for videos that have sound. Remembered in the state file, on by default. Audio files are not affected.Tests:
test_windowvideoHasSoundwith stand-inffprobe,ffmpegandffplay; smoke sessionvideowith a tone. ctest passes, also under ASan/UBSan.🤖 Generated with Claude Code