mpv icon indicating copy to clipboard operation
mpv copied to clipboard

ab loop not working as expected

Open hastyeagle opened this issue 1 year ago • 6 comments

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

hastyeagle avatar Sep 13 '22 00:09 hastyeagle

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.

hastyeagle avatar Oct 09 '22 23:10 hastyeagle

Could you upload a sample where it doesn't work for you?

Dudemanguy avatar Oct 09 '22 23:10 Dudemanguy

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

hastyeagle avatar Oct 18 '22 11:10 hastyeagle

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?

Dudemanguy avatar Oct 18 '22 14:10 Dudemanguy

That looks like the issue. Switching to ao=null or ao=pulse and a-b loop works fine.

hastyeagle avatar Oct 18 '22 14:10 hastyeagle

So presumably this:

blocked, waiting for old audio to play

blocks forever on oss.

Dudemanguy avatar Oct 18 '22 15:10 Dudemanguy

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

noiseless avatar Nov 21 '22 11:11 noiseless

Testers are welcome :)

rozhuk-im avatar Feb 12 '23 17:02 rozhuk-im