From f0a80394645ce436307d3d458878689411a44ba7 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Tue, 3 Mar 2009 17:04:51 +0000 Subject: 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 --- libavformat/file.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libavformat/file.c') diff --git a/libavformat/file.c b/libavformat/file.c index cdf0b08d5b..bec991ae44 100644 --- a/libavformat/file.c +++ b/libavformat/file.c @@ -82,6 +82,11 @@ static int file_close(URLContext *h) return close(fd); } +static int file_get_handle(URLContext *h) +{ + return (int) h->priv_data; +} + URLProtocol file_protocol = { "file", file_open, @@ -89,6 +94,7 @@ URLProtocol file_protocol = { file_write, file_seek, file_close, + .url_get_file_handle = file_get_handle, }; /* pipe protocol */ @@ -120,4 +126,5 @@ URLProtocol pipe_protocol = { pipe_open, file_read, file_write, + .url_get_file_handle = file_get_handle, }; -- cgit v1.2.3