mirror of https://git.ffmpeg.org/ffmpeg.git
Align outgoing messages to 8 bytes, this is required to interact with
most servers. Also remove a case where we manually aligned to 8 bytes, since this is now no longer needed. Patch by Zhentan Feng <spyfeng gmail com>. Originally committed as revision 24360 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
0c717a30e0
commit
cbbb10810c
|
@ -146,7 +146,8 @@ static void insert_command_prefixes(MMSContext *mms,
|
||||||
/** Send a prepared MMST command packet. */
|
/** Send a prepared MMST command packet. */
|
||||||
static int send_command_packet(MMSContext *mms)
|
static int send_command_packet(MMSContext *mms)
|
||||||
{
|
{
|
||||||
int exact_length= mms->write_out_ptr - mms->out_buffer;
|
int len= mms->write_out_ptr - mms->out_buffer;
|
||||||
|
int exact_length = (len + 7) & ~7;
|
||||||
int first_length= exact_length - 16;
|
int first_length= exact_length - 16;
|
||||||
int len8= first_length/8;
|
int len8= first_length/8;
|
||||||
int write_result;
|
int write_result;
|
||||||
|
@ -155,6 +156,7 @@ static int send_command_packet(MMSContext *mms)
|
||||||
AV_WL32(mms->out_buffer + 8, first_length);
|
AV_WL32(mms->out_buffer + 8, first_length);
|
||||||
AV_WL32(mms->out_buffer + 16, len8);
|
AV_WL32(mms->out_buffer + 16, len8);
|
||||||
AV_WL32(mms->out_buffer + 32, len8-2);
|
AV_WL32(mms->out_buffer + 32, len8-2);
|
||||||
|
memset(mms->write_out_ptr, 0, exact_length - len);
|
||||||
|
|
||||||
// write it out.
|
// write it out.
|
||||||
write_result= url_write(mms->mms_hd, mms->out_buffer, exact_length);
|
write_result= url_write(mms->mms_hd, mms->out_buffer, exact_length);
|
||||||
|
@ -491,9 +493,6 @@ static int send_stream_selection_request(MMSContext *mms)
|
||||||
bytestream_put_le16(&mms->write_out_ptr, mms->streams[i].id); // stream id
|
bytestream_put_le16(&mms->write_out_ptr, mms->streams[i].id); // stream id
|
||||||
bytestream_put_le16(&mms->write_out_ptr, 0); // selection
|
bytestream_put_le16(&mms->write_out_ptr, 0); // selection
|
||||||
}
|
}
|
||||||
|
|
||||||
bytestream_put_le16(&mms->write_out_ptr, 0);
|
|
||||||
|
|
||||||
return send_command_packet(mms);
|
return send_command_packet(mms);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue