mpv-player / mpv-player/mpv

[Enhancement] Behaviour of partial downloads

Open
#10,661 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

meta:feature-request
Dominant language
C
Stars
37k
Forks
3.5k
Avg merge
1d 10h
Merged PRs (30d)
22

Description

mpv allows us to play videos that are being downloaded such as via yt-dltp or what was
the name of the improved youtube-dl successor.

At like 50% of a video I wanted to look and see whether I should continue to download
it. Often you don't know what a video is about, and browser preview does not always
work either. I have this problem with chrome + NVIDIA on linux right now. Via mpv it
plays fine, always, though. So this is more a separate issue.

Now: if you play the partial download you can skip forward via right arrow keys.

This works.

You then get the following message when you are at the end:

"[file] File is apparently being appended to, will keep retrying with timeouts."

That makes sense.

HOWEVER HAD, using the left arrow key to then "jump back" does not work. The
video remains frozen aka it does not move at all anymore. Perhaps I am hitting
that mandatory timeout issue? But navigation should still be possible for the
dataset that was already downloaded before that, IMO.

My proposal here is to re-enable these partial steps and allow the left
arrow key to work.

I don't know C really well or how it is implemented internally, but I can think
of ways to solve it. Ideally one could simply jump to a prior state and have it
work from that point in the buffer, if that is possible. After all we know this
must have worked because the arrow-right key works correctly within the
already downloaded data. So arrow-left should also work, IMO; from a
logical point of view (because you can hit the right arrow keys several
times in a given video file). Oddly enough right now it does not work,
at the least not on my computer system. I suspect the code has different
support for arrow-right and arrow-left; if anyone could have a look at the
arrow-specific C code and perhaps notice how this could be changed
to allow the arrow-left key to also work fine. (This only happens when I
hit the above message by the way; the arrow-left key works fine otherwise,
so I can use arrow-right and arrow-left, UNTIL I hit that "is currently
downloaded" error message - or rather that already mentioned
"[file] File is apparently being appended to, will keep retrying with timeouts."
message.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing this with a partially downloaded video in mpv and the file-appending retry state. Trace the handling of left- and right-arrow seeking after the "File is apparently being appended to" message. Done means left-arrow seeking resumes playback within the data already downloaded, without breaking normal navigation or retry behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.