aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/rtmpproto.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-11-04 18:00:15 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-11-04 18:00:15 +0100
commit39d76907c9fb8ac95bf0fe5ef95b50089ec564a9 (patch)
tree24706aaccc4fa39ee4dc16ebed0147de891d3369 /libavformat/rtmpproto.c
parent1825d6d096102c2a220d61bad34009f583ca4a5e (diff)
parent067713f15989dd0b8c0888a3b43fd193819a1058 (diff)
downloadffmpeg-39d76907c9fb8ac95bf0fe5ef95b50089ec564a9.tar.gz
Merge commit '067713f15989dd0b8c0888a3b43fd193819a1058' into release/0.10
* commit '067713f15989dd0b8c0888a3b43fd193819a1058': rtmp: rename data_size to size lavc: set the default rc_initial_buffer_occupancy 4xm: Reject not a multiple of 16 dimension Conflicts: avconv.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rtmpproto.c')
-rw-r--r--libavformat/rtmpproto.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index a2c7b5da88..65a54e6bd5 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -147,7 +147,7 @@ static void gen_connect(URLContext *s, RTMPContext *rt, const char *proto,
}
ff_amf_write_object_end(&p);
- pkt.data_size = p - pkt.data;
+ pkt.size = p - pkt.data;
ff_rtmp_packet_write(rt->stream, &pkt, rt->chunk_size, rt->prev_pkt[1]);
ff_rtmp_packet_destroy(&pkt);
@@ -549,7 +549,7 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt)
{
int i, t;
- const uint8_t *data_end = pkt->data + pkt->data_size;
+ const uint8_t *data_end = pkt->data + pkt->size;
#ifdef DEBUG
ff_rtmp_packet_dump(s, pkt);
@@ -557,9 +557,9 @@ static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt)
switch (pkt->type) {
case RTMP_PT_CHUNK_SIZE:
- if (pkt->data_size != 4) {
+ if (pkt->size != 4) {
av_log(s, AV_LOG_ERROR,
- "Chunk size change packet is not 4 bytes long (%d)\n", pkt->data_size);
+ "Chunk size change packet is not 4 bytes long (%d)\n", pkt->size);
return -1;
}
if (!rt->is_input)
@@ -577,10 +577,10 @@ static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt)
gen_pong(s, rt, pkt);
break;
case RTMP_PT_CLIENT_BW:
- if (pkt->data_size < 4) {
+ if (pkt->size < 4) {
av_log(s, AV_LOG_ERROR,
"Client bandwidth report packet is less than 4 bytes long (%d)\n",
- pkt->data_size);
+ pkt->size);
return -1;
}
av_log(s, AV_LOG_DEBUG, "Client bandwidth = %d\n", AV_RB32(pkt->data));
@@ -683,7 +683,7 @@ static int get_packet(URLContext *s, int for_header)
int ret;
uint8_t *p;
const uint8_t *next;
- uint32_t data_size;
+ uint32_t size;
uint32_t ts, cts, pts=0;
if (rt->state == STATE_STOPPED)
@@ -719,7 +719,7 @@ static int get_packet(URLContext *s, int for_header)
ff_rtmp_packet_destroy(&rpkt);
return 0;
}
- if (!rpkt.data_size || !rt->is_input) {
+ if (!rpkt.size || !rt->is_input) {
ff_rtmp_packet_destroy(&rpkt);
continue;
}
@@ -729,28 +729,28 @@ static int get_packet(URLContext *s, int for_header)
// generate packet header and put data into buffer for FLV demuxer
rt->flv_off = 0;
- rt->flv_size = rpkt.data_size + 15;
+ rt->flv_size = rpkt.size + 15;
rt->flv_data = p = av_realloc(rt->flv_data, rt->flv_size);
bytestream_put_byte(&p, rpkt.type);
- bytestream_put_be24(&p, rpkt.data_size);
+ bytestream_put_be24(&p, rpkt.size);
bytestream_put_be24(&p, ts);
bytestream_put_byte(&p, ts >> 24);
bytestream_put_be24(&p, 0);
- bytestream_put_buffer(&p, rpkt.data, rpkt.data_size);
+ bytestream_put_buffer(&p, rpkt.data, rpkt.size);
bytestream_put_be32(&p, 0);
ff_rtmp_packet_destroy(&rpkt);
return 0;
} else if (rpkt.type == RTMP_PT_METADATA) {
// we got raw FLV data, make it available for FLV demuxer
rt->flv_off = 0;
- rt->flv_size = rpkt.data_size;
+ rt->flv_size = rpkt.size;
rt->flv_data = av_realloc(rt->flv_data, rt->flv_size);
/* rewrite timestamps */
next = rpkt.data;
ts = rpkt.timestamp;
- while (next - rpkt.data < rpkt.data_size - 11) {
+ while (next - rpkt.data < rpkt.size - 11) {
next++;
- data_size = bytestream_get_be24(&next);
+ size = bytestream_get_be24(&next);
p=next;
cts = bytestream_get_be24(&next);
cts |= bytestream_get_byte(&next) << 24;
@@ -760,9 +760,9 @@ static int get_packet(URLContext *s, int for_header)
pts = cts;
bytestream_put_be24(&p, ts);
bytestream_put_byte(&p, ts >> 24);
- next += data_size + 3 + 4;
+ next += size + 3 + 4;
}
- memcpy(rt->flv_data, rpkt.data, rpkt.data_size);
+ memcpy(rt->flv_data, rpkt.data, rpkt.size);
ff_rtmp_packet_destroy(&rpkt);
return 0;
}
@@ -776,7 +776,7 @@ static int rtmp_close(URLContext *h)
if (!rt->is_input) {
rt->flv_data = NULL;
- if (rt->out_pkt.data_size)
+ if (rt->out_pkt.size)
ff_rtmp_packet_destroy(&rt->out_pkt);
if (rt->state > STATE_FCPUBLISH)
gen_fcunpublish_stream(h, rt);