Commit d4aef997 authored by Josh Allmann's avatar Josh Allmann Committed by Martin Storsjö

rtmp: Follow Flash player numbering for channels.

Channel 4 is typically used by the Flash player to transmit
audio, channel 6 for video, and various stream-specific invokes
get sent over channel 8, which is designated the source channel.

This more closely matches the behavior of the Flash player,
including the transmission of play requests over channel 8.
Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent 120af23c
...@@ -36,9 +36,9 @@ ...@@ -36,9 +36,9 @@
enum RTMPChannel { enum RTMPChannel {
RTMP_NETWORK_CHANNEL = 2, ///< channel for network-related messages (bandwidth report, ping, etc) RTMP_NETWORK_CHANNEL = 2, ///< channel for network-related messages (bandwidth report, ping, etc)
RTMP_SYSTEM_CHANNEL, ///< channel for sending server control messages RTMP_SYSTEM_CHANNEL, ///< channel for sending server control messages
RTMP_SOURCE_CHANNEL, ///< channel for sending a/v to server
RTMP_VIDEO_CHANNEL = 8, ///< channel for video data
RTMP_AUDIO_CHANNEL, ///< channel for audio data RTMP_AUDIO_CHANNEL, ///< channel for audio data
RTMP_VIDEO_CHANNEL = 6, ///< channel for video data
RTMP_SOURCE_CHANNEL = 8, ///< channel for a/v invokes
}; };
/** /**
......
...@@ -693,7 +693,7 @@ static int gen_play(URLContext *s, RTMPContext *rt) ...@@ -693,7 +693,7 @@ static int gen_play(URLContext *s, RTMPContext *rt)
av_log(s, AV_LOG_DEBUG, "Sending play command for '%s'\n", rt->playpath); av_log(s, AV_LOG_DEBUG, "Sending play command for '%s'\n", rt->playpath);
if ((ret = ff_rtmp_packet_create(&pkt, RTMP_VIDEO_CHANNEL, RTMP_PT_INVOKE, if ((ret = ff_rtmp_packet_create(&pkt, RTMP_SOURCE_CHANNEL, RTMP_PT_INVOKE,
0, 29 + strlen(rt->playpath))) < 0) 0, 29 + strlen(rt->playpath))) < 0)
return ret; return ret;
...@@ -2637,7 +2637,7 @@ static int rtmp_write(URLContext *s, const uint8_t *buf, int size) ...@@ -2637,7 +2637,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; int channel = RTMP_AUDIO_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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment