audio::DynamicResource chunk reusage incorrect
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 14.4k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
libopenage/audio/dynamic_resource.h
This class defines a hashmap and a queue to maintain the audio chunks.
datastructure::ConcurrentQueue<std::shared_ptr<chunk_info_t>> decay_queue;
std::unordered_map<size_t,std::shared_ptr<chunk_info_t>> chunks;
Both of them keep a pointer to the actual chunk. However, when a chunk is recycled from the queue, there is no way to invalidate the pointer in chunks. Thus the same chunk can still be found with an outdated index, but it may contain incorrect audio data.
I think the queue should keep indexes of the hashmap, not pointers to the chunks (which are values of the hashmap).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with libopenage/audio/dynamic_resource.h and inspect the DynamicResource class, especially decay_queue and chunks. Trace how chunks are added, recycled, and looked up to confirm when an outdated index can return incorrect audio data. Done means recycled chunks can no longer be found through stale hashmap entries while chunk reuse remains correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- audio-video-rtc
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100