Opened 6 years ago

Closed 6 years ago

Last modified 6 years 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 6 years ago.
GDB log
mpv_debug.txt (3.8 KB ) - added by danman 6 years ago.

Download all attachments as: .zip

Change History (8)

by sfan5, 6 years ago

Attachment: mpv_gdb.txt added

GDB log

comment:1 by danman, 6 years ago

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

by danman, 6 years ago

Attachment: mpv_debug.txt added

comment:2 by danman, 6 years ago

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 6 years ago by danman (previous) (diff)

comment:4 by Hendrik, 6 years ago

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

comment:5 by sfan5, 6 years ago

Resolution: fixed
Status: newclosed

comment:6 by Carl Eugen Hoyos, 6 years ago

Keywords: regression added
Priority: normalimportant
Note: See TracTickets for help on using tickets.