diff rtsp.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 70321467b4f9
children aa5dcae3f210
line wrap: on
line diff
--- a/rtsp.c	Tue Mar 03 16:53:04 2009 +0000
+++ b/rtsp.c	Tue Mar 03 17:04:51 2009 +0000
@@ -1305,7 +1305,7 @@
     RTSPState *rt = s->priv_data;
     RTSPStream *rtsp_st;
     fd_set rfds;
-    int fd1, fd2, fd_max, n, i, ret;
+    int fd1, fd_max, n, i, ret;
     struct timeval tv;
 
     for(;;) {
@@ -1318,7 +1318,7 @@
             if (rtsp_st->rtp_handle) {
                 /* currently, we cannot probe RTCP handle because of
                  * blocking restrictions */
-                rtp_get_file_handles(rtsp_st->rtp_handle, &fd1, &fd2);
+                fd1 = url_get_file_handle(rtsp_st->rtp_handle);
                 if (fd1 > fd_max)
                     fd_max = fd1;
                 FD_SET(fd1, &rfds);
@@ -1331,7 +1331,7 @@
             for(i = 0; i < rt->nb_rtsp_streams; i++) {
                 rtsp_st = rt->rtsp_streams[i];
                 if (rtsp_st->rtp_handle) {
-                    rtp_get_file_handles(rtsp_st->rtp_handle, &fd1, &fd2);
+                    fd1 = url_get_file_handle(rtsp_st->rtp_handle);
                     if (FD_ISSET(fd1, &rfds)) {
                         ret = url_read(rtsp_st->rtp_handle, buf, buf_size);
                         if (ret > 0) {