summaryrefslogtreecommitdiff
path: root/libavformat/rtmpproto.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-04-05 02:24:55 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-04-05 02:31:56 +0200
commit434f248723d4d3e22545c3542ef9fc7c00b2379b (patch)
tree4c399c1fa89215676e14f57c84a3244af806c39e /libavformat/rtmpproto.c
parent6114bffa91714c83a533ae7e5a597ee605d35c3d (diff)
parent2310ee4b1cca48609d06774b7c3c70a5f38f3473 (diff)
Merge remote branch 'qatar/master'
* qatar/master: (22 commits) ac3enc: move extract_exponents inner loop to ac3dsp avio: deprecate url_get_filename(). avio: deprecate url_max_packet_size(). avio: make url_get_file_handle() internal. avio: make url_filesize() internal. avio: make url_close() internal. avio: make url_seek() internal. avio: cosmetics, move AVSEEK_SIZE/FORCE declarations together avio: make url_write() internal. avio: make url_read_complete() internal. avio: make url_read() internal. avio: make url_open() internal. avio: make url_connect internal. avio: make url_alloc internal. applehttp: Merge two for loops applehttp: Restructure the demuxer to use a custom AVIOContext applehttp: Move finished and target_duration to the variant struct aacenc: reduce the number of loop index variables avio: deprecate url_open_protocol avio: deprecate url_poll and URLPollEntry ... Conflicts: libavformat/applehttp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rtmpproto.c')
-rw-r--r--libavformat/rtmpproto.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index 748aab33cc..3309038b34 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -36,6 +36,7 @@
#include "flv.h"
#include "rtmp.h"
#include "rtmppkt.h"
+#include "url.h"
/* we can't use av_log() with URLContext yet... */
#if FF_API_URL_CLASS
@@ -485,13 +486,13 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
tosend[i] = av_lfg_get(&rnd) >> 24;
client_pos = rtmp_handshake_imprint_with_digest(tosend + 1);
- url_write(rt->stream, tosend, RTMP_HANDSHAKE_PACKET_SIZE + 1);
- i = url_read_complete(rt->stream, serverdata, RTMP_HANDSHAKE_PACKET_SIZE + 1);
+ ffurl_write(rt->stream, tosend, RTMP_HANDSHAKE_PACKET_SIZE + 1);
+ i = ffurl_read_complete(rt->stream, serverdata, RTMP_HANDSHAKE_PACKET_SIZE + 1);
if (i != RTMP_HANDSHAKE_PACKET_SIZE + 1) {
av_log(LOG_CONTEXT, AV_LOG_ERROR, "Cannot read RTMP handshake response\n");
return -1;
}
- i = url_read_complete(rt->stream, clientdata, RTMP_HANDSHAKE_PACKET_SIZE);
+ i = ffurl_read_complete(rt->stream, clientdata, RTMP_HANDSHAKE_PACKET_SIZE);
if (i != RTMP_HANDSHAKE_PACKET_SIZE) {
av_log(LOG_CONTEXT, AV_LOG_ERROR, "Cannot read RTMP handshake response\n");
return -1;
@@ -531,9 +532,9 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
tosend + RTMP_HANDSHAKE_PACKET_SIZE - 32);
// write reply back to the server
- url_write(rt->stream, tosend, RTMP_HANDSHAKE_PACKET_SIZE);
+ ffurl_write(rt->stream, tosend, RTMP_HANDSHAKE_PACKET_SIZE);
} else {
- url_write(rt->stream, serverdata+1, RTMP_HANDSHAKE_PACKET_SIZE);
+ ffurl_write(rt->stream, serverdata+1, RTMP_HANDSHAKE_PACKET_SIZE);
}
return 0;
@@ -785,7 +786,7 @@ static int rtmp_close(URLContext *h)
gen_delete_stream(h, rt);
av_freep(&rt->flv_data);
- url_close(rt->stream);
+ ffurl_close(rt->stream);
av_free(rt);
return 0;
}
@@ -820,7 +821,7 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
port = RTMP_DEFAULT_PORT;
ff_url_join(buf, sizeof(buf), "tcp", NULL, hostname, port, NULL);
- if (url_open(&rt->stream, buf, URL_RDWR) < 0) {
+ if (ffurl_open(&rt->stream, buf, URL_RDWR) < 0) {
av_log(LOG_CONTEXT, AV_LOG_ERROR, "Cannot open connection %s\n", buf);
goto fail;
}
@@ -887,7 +888,7 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
rt->flv_off = 0;
}
- s->max_packet_size = url_get_max_packet_size(rt->stream);
+ s->max_packet_size = rt->stream->max_packet_size;
s->is_streamed = 1;
return 0;