Merge commit '120af23cd5fcfc539d9575d17d403247ab17109b'
* commit '120af23cd5fcfc539d9575d17d403247ab17109b': rtmp: Send video on a separate channel. Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
c71541d42a
@ -2638,6 +2638,7 @@ static int rtmp_write(URLContext *s, const uint8_t *buf, int size)
|
|||||||
if (rt->flv_header_bytes < 11) {
|
if (rt->flv_header_bytes < 11) {
|
||||||
const uint8_t *header = rt->flv_header;
|
const uint8_t *header = rt->flv_header;
|
||||||
int copy = FFMIN(11 - rt->flv_header_bytes, size_temp);
|
int copy = FFMIN(11 - rt->flv_header_bytes, size_temp);
|
||||||
|
int channel = RTMP_SOURCE_CHANNEL;
|
||||||
bytestream_get_buffer(&buf_temp, rt->flv_header + rt->flv_header_bytes, copy);
|
bytestream_get_buffer(&buf_temp, rt->flv_header + rt->flv_header_bytes, copy);
|
||||||
rt->flv_header_bytes += copy;
|
rt->flv_header_bytes += copy;
|
||||||
size_temp -= copy;
|
size_temp -= copy;
|
||||||
@ -2651,16 +2652,19 @@ static int rtmp_write(URLContext *s, const uint8_t *buf, int size)
|
|||||||
bytestream_get_be24(&header);
|
bytestream_get_be24(&header);
|
||||||
rt->flv_size = pktsize;
|
rt->flv_size = pktsize;
|
||||||
|
|
||||||
|
if (pkttype == RTMP_PT_VIDEO)
|
||||||
|
channel = RTMP_VIDEO_CHANNEL;
|
||||||
|
|
||||||
//force 12bytes header
|
//force 12bytes header
|
||||||
if (((pkttype == RTMP_PT_VIDEO || pkttype == RTMP_PT_AUDIO) && ts == 0) ||
|
if (((pkttype == RTMP_PT_VIDEO || pkttype == RTMP_PT_AUDIO) && ts == 0) ||
|
||||||
pkttype == RTMP_PT_NOTIFY) {
|
pkttype == RTMP_PT_NOTIFY) {
|
||||||
if (pkttype == RTMP_PT_NOTIFY)
|
if (pkttype == RTMP_PT_NOTIFY)
|
||||||
pktsize += 16;
|
pktsize += 16;
|
||||||
rt->prev_pkt[1][RTMP_SOURCE_CHANNEL].channel_id = 0;
|
rt->prev_pkt[1][channel].channel_id = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//this can be a big packet, it's better to send it right here
|
//this can be a big packet, it's better to send it right here
|
||||||
if ((ret = ff_rtmp_packet_create(&rt->out_pkt, RTMP_SOURCE_CHANNEL,
|
if ((ret = ff_rtmp_packet_create(&rt->out_pkt, channel,
|
||||||
pkttype, ts, pktsize)) < 0)
|
pkttype, ts, pktsize)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user