[FFmpeg-devel] [PATCH] TCP error reporting

Ronald S. Bultje rsbultje
Fri Aug 13 22:04:01 CEST 2010


Hi,

a common problem in our networking code is error reporting. By failure
to do anything better, attached patch implements two error mesasges
if:
- a hostname could not be resolved
- a connection to a host failed
These are the two most common problems when a connection fails, and
it's good to let the user of ffplay know why it failed.

Old behaviour:
bash-3.2$ ./ffplay
"mmst://wms.absoluteradio.co.uk/absoluteradio.co.uk/vr_hi?u="FFplay
version SVN-r24794, Copyright (c) 2003-2010 the FFmpeg developers
  built on Aug 13 2010 15:43:43 with gcc 4.2.1 (Apple Inc. build 5664)
  configuration: --enable-gpl
  libavutil     50.23. 0 / 50.23. 0
  libavcore      0. 4. 0 /  0. 4. 0
  libavcodec    52.85. 1 / 52.85. 1
  libavformat   52.78. 2 / 52.78. 2
  libavdevice   52. 2. 1 / 52. 2. 1
  libavfilter    1.34. 1 /  1.34. 1
  libswscale     0.11. 0 /  0.11. 0
mmst://wms.absoluteradio.co.uk/absoluteradio.co.uk/vr_hi?u=: Input/output error

New behaviour:
bash-3.2$ ./ffplay
"mmst://wms.absoluteradio.co.uk/absoluteradio.co.uk/vr_hi?u="FFplay
version SVN-r24794, Copyright (c) 2003-2010 the FFmpeg developers
  built on Aug 13 2010 15:43:43 with gcc 4.2.1 (Apple Inc. build 5664)
  configuration: --enable-gpl
  libavutil     50.23. 0 / 50.23. 0
  libavcore      0. 4. 0 /  0. 4. 0
  libavcodec    52.85. 1 / 52.85. 1
  libavformat   52.78. 2 / 52.78. 2
  libavdevice   52. 2. 1 / 52. 2. 1
  libavfilter    1.34. 1 /  1.34. 1
  libswscale     0.11. 0 /  0.11. 0
TCP connection to wms.absoluteradio.co.uk:1755 failed: Connection refused
mmst://wms.absoluteradio.co.uk/absoluteradio.co.uk/vr_hi?u=: Input/output error

bash-3.2$ ./ffplay
"mmst://wms.absoluteradio.co.ukkk/absoluteradio.co.uk/vr_hi?u="
FFplay version SVN-r24794, Copyright (c) 2003-2010 the FFmpeg developers
  built on Aug 13 2010 15:43:43 with gcc 4.2.1 (Apple Inc. build 5664)
  configuration: --enable-gpl
  libavutil     50.23. 0 / 50.23. 0
  libavcore      0. 4. 0 /  0. 4. 0
  libavcodec    52.85. 1 / 52.85. 1
  libavformat   52.78. 2 / 52.78. 2
  libavdevice   52. 2. 1 / 52. 2. 1
  libavfilter    1.34. 1 /  1.34. 1
  libswscale     0.11. 0 /  0.11. 0
Failed to resolve hostname wms.absoluteradio.co.ukkk: nodename nor
servname provided, or not known
mmst://wms.absoluteradio.co.ukkk/absoluteradio.co.uk/vr_hi?u=:
Input/output error

Which I believe are better.

Ronald
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tcp_error_reporting.patch
Type: application/octet-stream
Size: 1070 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100813/980bed92/attachment.obj>



More information about the ffmpeg-devel mailing list