Opened 5 weeks ago

Closed 4 weeks ago

Last modified 4 weeks ago

#6767 closed defect (fixed)

"libavformat: not treat 0 as EOF" commit breaks seeking in mpv

Reported by: sfan5 Owned by:
Priority: important Component: avformat
Version: git-master Keywords: regression
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

test case as requested here:

ffmpeg version N-87938-g858db4b01f

How to reproduce:

  • build mpv that links with the specified ffmpeg revision
  • play any flac file and seek anywhere as soon as playback starts
  • observe how mpv freezes

this does not happen prior to that ffmpeg revision (e.g. f4090940 is fine)

attached gdb log (+stacktraces) shows that av_seek_frame() never returns control to mpv's demuxer thread

Attachments (2)

mpv_gdb.txt (6.7 KB) - added by sfan5 5 weeks ago.
GDB log
mpv_debug.txt (3.8 KB) - added by danman 5 weeks ago.

Download all attachments as: .zip

Change History (8)

Changed 5 weeks ago by sfan5

GDB log

comment:1 Changed 5 weeks ago by danman

If I seek in flac with ffmpeg, it works and ends ok, eg:

./ffmpeg_g -y -ss 80 -i ~/Downloads/BIS1536-001-flac_16.flac tst.mp4

....
frame= 0 fps=0.0 q=0.0 Lsize= 1998kB time=00:02:05.87 bitrate= 130.0kbits/s speed=29.4x
video:0kB audio:1976kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.138427%
[aac @ 0x561845c6f1a0] Qavg: 458.314

Changed 5 weeks ago by danman

comment:2 Changed 5 weeks ago by danman

ffmpeg now expects EOF on file end but mp_read is returning zero (see mpv_debug.txt) so it loops indefinitely. This needs to be fixed in mpv: https://github.com/mpv-player/mpv/blob/master/demux/demux_lavf.c#L227

Last edited 5 weeks ago by danman (previous) (diff)

comment:4 Changed 5 weeks ago by heleppkes

That sounds like an API break though, if it breaks all client apps in one swoop.

comment:5 Changed 4 weeks ago by sfan5

  • Resolution set to fixed
  • Status changed from new to closed

comment:6 Changed 4 weeks ago by cehoyos

  • Keywords regression added
  • Priority changed from normal to important
Note: See TracTickets for help on using tickets.