Opened 10 months ago

Last modified 10 months ago

#11662 reopened defect

ffplay does not detect when the remote side closes the connection

Reported by: guest Owned by:
Priority: minor Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

When the remote side closes the TCP connection (sends a FIN), ffplay does not detect it properly. Although the thread handling the network input exits, the main process continues running and displaying elapsed time as if the connection were still active. This leads to a situation where ffplay does not stop even though the stream has ended on the remote side.

How to reproduce:

start ffplay and stop the server at remote end.

% ffplay http://
ffplay version 2025-07-01-git-11d1b71c31-essentials_build-www.gyan.dev Copyright (c) 2003-2025 the FFmpeg developers
  built with gcc 15.1.0 (Rev4, Built by MSYS2 project)

Change History (5)

comment:1 by Marton Balint, 10 months ago

Resolution: invalid
Status: newclosed

FFplay does not exit on the end of the stream, this is by design. You can use the -autoexit command line flag to make it exit on stream end.

comment:2 by guest, 10 months ago

Thank you very much for the response. Does it make sense to keep running even though the incoming stream has been interrupted and there’s no attempt to reconnect?

comment:3 by guest, 10 months ago

Note: I created a test script on Windows that tries to connect to a non-running service, and interestingly, in some cases, the process hangs and doesn't exit with an error.

:loop
ffplay -autoexit -i http://1.2.3.4:2222
timeout 3
goto loop

comment:4 by guest, 10 months ago

I've tested this on both Linux and Windows, and the issue only appears on Windows

comment:5 by guest, 10 months ago

Resolution: invalid
Status: closedreopened
Note: See TracTickets for help on using tickets.