Skip to content

fix(telegram): dynamic rolling buffer video cache (Fixes #376) - #512

Open
Himanth-reddy wants to merge 1 commit into
ProdigyV21:mainfrom
Himanth-reddy:fix/issue-376-telegram-video-cache
Open

fix(telegram): dynamic rolling buffer video cache (Fixes #376)#512
Himanth-reddy wants to merge 1 commit into
ProdigyV21:mainfrom
Himanth-reddy:fix/issue-376-telegram-video-cache

Conversation

@Himanth-reddy

Copy link
Copy Markdown
Collaborator

Summary of Changes

Fixes #376 by implementing a YouTube/Stremio-style Dynamic Rolling Window Buffer for Telegram video streaming with low-storage protection.

Features & Adjustments:

  1. Dynamic Bitrate-Based Buffer Calculation:
    • Calculates average byte rate based on total file size.
    • Bounds prefetching to a 2.5 minute (150s) lookahead window (20 MB - 300 MB max) with a 30s rewind window.
  2. Low-Storage Protection:
    • Drops prefetch size down to 2 MB if usable storage falls below 500 MB.
    • Invokes TdApi.OptimizeStorage if usable storage falls below 200 MB.
  3. Immediate Cleanup:
    • Automatically deletes active stream files from disk when switching videos, stopping playback, or exiting the app.

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.

Video cache

1 participant