Revision cbbb1081

View differences:

libavformat/mmst.c
146 146
/** Send a prepared MMST command packet. */
147 147
static int send_command_packet(MMSContext *mms)
148 148
{
149
    int exact_length= mms->write_out_ptr - mms->out_buffer;
149
    int len= mms->write_out_ptr - mms->out_buffer;
150
    int exact_length = (len + 7) & ~7;
150 151
    int first_length= exact_length - 16;
151 152
    int len8= first_length/8;
152 153
    int write_result;
......
155 156
    AV_WL32(mms->out_buffer + 8, first_length);
156 157
    AV_WL32(mms->out_buffer + 16, len8);
157 158
    AV_WL32(mms->out_buffer + 32, len8-2);
159
    memset(mms->write_out_ptr, 0, exact_length - len);
158 160

  
159 161
    // write it out.
160 162
    write_result= url_write(mms->mms_hd, mms->out_buffer, exact_length);
......
491 493
        bytestream_put_le16(&mms->write_out_ptr, mms->streams[i].id);  // stream id
492 494
        bytestream_put_le16(&mms->write_out_ptr, 0);                   // selection
493 495
    }
494

  
495
    bytestream_put_le16(&mms->write_out_ptr, 0);
496

  
497 496
    return send_command_packet(mms);
498 497
}
499 498

  

Also available in: Unified diff