Repository navigation
Conversation
Member
|
I'm not sure if this is worth fixing. The point of the player cache is to play RTP without having to decode/encode it. Combining that with the audio player pretty much defeats its purpose. |
Member
|
I think a better solution would be to simply skip engaging the cached media player if an audio player is in use, and fall back to the regular player. |
…er cache With player-cache on, a file played to a media that has an audio player goes wrong in two ways. The packets of a cache entry are encoded by the codec handler of the first player of the file. When that player's media has an audio player, codec_handler_make_media_player() makes the handler decode into packet_decoded_audio_player(), which finds the audio player through the packet's media_out. The packets of the decoder thread have none, so the frames are dropped and the entry stays empty: this player and every later player of the file in that codec are sent nothing. An entry filled through another media is sent as it is, or played by the kernel, past the audio player, so the receiver gets it as a second stream beside the audio player's. A player whose media has an active audio player now leaves the cache alone and plays the file as it does without the cache, decoding into the audio player. call_play_media_for_ml() starts the audio player before the player looks for its cache entry. A player can now read a file itself after it has read one from the cache, so media_player_play_start() puts back the reader that media_player_cached_reader_start() replaced.
nickakt
force-pushed
the
fix/player-cache-audio-player
branch
from
November 17, 2026 14:06
041315f to
6ac063c
Compare
Author
|
Done, could you please take a look? |
rfuchs
reviewed
Nov 17, 2026
| if (media_player_cache_entry_init(mp, dst_pt, codec_set)) | ||
| return true; | ||
|
|
||
| mp->run_func = media_player_read_packet; // an earlier playback may have read from the cache |
Member
There was a problem hiding this comment.
Ok, with this here it makes sense to remove this setting from media_player_new
I'll handle it
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.
With
player-cacheon, a file played to a media that has an audio player goes wrong in two ways.The packets of a cache entry are encoded by the codec handler of the first player of the file. When that player's media has an audio player,
codec_handler_make_media_player()makes the handler decode intopacket_decoded_audio_player(), which finds the audio player through the packet'smedia_out. The packets of the decoder thread have none, so the frames are dropped and the entry stays empty: this player and every later player of the file in that codec are sent nothing.An entry filled through another media is sent as it is, or played by the kernel, past the audio player, so the receiver gets it as a second stream beside the audio player's.
A player whose media has an active audio player now leaves the cache alone and plays the file as it does without the cache, decoding into the audio player.
call_play_media_for_ml()starts the audio player before the player looks for its cache entry. A player can now read a file itself after it has read one from the cache, somedia_player_play_start()puts back the reader thatmedia_player_cached_reader_start()replaced.auto-daemon-tests-inject.plruns its playback case with the cache on, and plays the same file once more without the injection, before it and after it.