diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2009-03-03 17:04:51 +0000 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2009-03-03 17:04:51 +0000 |
commit | f0a80394645ce436307d3d458878689411a44ba7 (patch) | |
tree | 78da33e8ec44b8767300dcf5fca4b3e6213fbdd4 /libavformat/tcp.c | |
parent | 2fea965070a96a04a46513cc524ac4cfcf622fd8 (diff) | |
download | ffmpeg-f0a80394645ce436307d3d458878689411a44ba7.tar.gz |
Add url_get_file_handle(), which is used to get the file descriptor
associated with the I/O handle (e.g. the fd returned by open()). See
"[RFC] rtsp.c EOF support" thread.
There were previously some URI-specific implementations of the same idea,
e.g. rtp_get_file_handles() and udp_get_file_handle(). All of these are
deprecated by this patch and will be removed at the next major API bump.
Originally committed as revision 17779 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/tcp.c')
-rw-r--r-- | libavformat/tcp.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavformat/tcp.c b/libavformat/tcp.c index b81ab93cfc..b7983e7c98 100644 --- a/libavformat/tcp.c +++ b/libavformat/tcp.c @@ -181,6 +181,12 @@ static int tcp_close(URLContext *h) return 0; } +static int tcp_get_file_handle(URLContext *h) +{ + TCPContext *s = h->priv_data; + return s->fd; +} + URLProtocol tcp_protocol = { "tcp", tcp_open, @@ -188,4 +194,5 @@ URLProtocol tcp_protocol = { tcp_write, NULL, /* seek */ tcp_close, + .url_get_file_handle = tcp_get_file_handle, }; |