ab loop not working as expected
Important Information
Provide following Information:
- mpv version: mpv 0.34.1
- Platform and Version: FreeBSD 13.1-RELEASE-p2
- Source of the mpv binary: Package
Reproduction steps
Open an MP4 file. Press "l" to set the A point. Wait an indeterminte amount of time and press "l" again to set the B point.
I did have another set of files (security camera recordings made via RTSP and ffmpeg) that work as expected. Other MP4 files that I've tried downloaded from Youtube experience the ab loop failure behavior.
Expected behavior
After pressing "l" to set the B point, mpv should jump back to A and play until it reaches B and then repeat the loop.
Actual behavior
After setting the B loop point, mpv will switch back to the A point, but pauses. Pressing play/pause again doesn't start playback. If you press "l" again to clear the ab loop, mpv can start playing again.
Log file
Log when ab loop doesn't work: https://storage.googleapis.com/iqgxbry4pqfbybtp/log.txt
Just wanted to check in on this. Do I need to add anything or can I provide any other information that would be helpful? Can others test this on various MP4 files to see if they experience the same issue?
As I mentioned, it's not on all the MP4 files I've tried, but a large portion do exhibit this issue. I'm guessing it's something with the codec used, but I'm not sure yet.
Could you upload a sample where it doesn't work for you?
Attached is a random sample I grabbed from Youtube. It's poor quality just to get a small file size.
https://user-images.githubusercontent.com/5051101/196422448-c6b003e0-33ae-40f0-91b4-0d83d4600ee7.mp4
I have no problems with a-b loop on that clip. Perhaps the ao isn't handling the loop correctly? Could you try a different ao other than oss and see if you still get the same issue?
That looks like the issue. Switching to ao=null or ao=pulse and a-b loop works fine.
So presumably this:
blocked, waiting for old audio to play
blocks forever on oss.
Also noted the presence of this bug when working on fixing a similar bug in ao_sndio. Perhaps my changes for ao_sndio will be something useful for fixing ao_oss. (sorry if I'm distracting you unnecessarily)
cc: @rozhuk-im
Testers are welcome :)