diff file.c @ 4640:b34d9614b887 libavformat

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.
author rbultje
date Tue, 03 Mar 2009 17:04:51 +0000
parents 77a5de3c9116
children dd9383951cb9
line wrap: on
line diff
--- a/file.c	Tue Mar 03 16:53:04 2009 +0000
+++ b/file.c	Tue Mar 03 17:04:51 2009 +0000
@@ -82,6 +82,11 @@
     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 @@
     file_write,
     file_seek,
     file_close,
+    .url_get_file_handle = file_get_handle,
 };
 
 /* pipe protocol */
@@ -120,4 +126,5 @@
     pipe_open,
     file_read,
     file_write,
+    .url_get_file_handle = file_get_handle,
 };