[FFmpeg-devel] [patch]MMS protocol over TCP
Ronald S. Bultje
rsbultje
Fri Mar 26 18:54:07 CET 2010
Hi,
On Thu, Mar 25, 2010 at 11:49 AM, zhentan feng <spyfeng at gmail.com> wrote:
> here is the new patch according to the reviews.
Couple more small things I noticed while looking over it.
mms_read():
> + assert(mms->header_parsed);
> +
> + if(mms->header_parsed) {
Makes no sense, the if() can be removed.
in get_tcp_server_response():
> + mms->asf_header = av_realloc(mms->asf_header,
> + mms->asf_header_size
> + + mms->pkt_buf_len);
> + memcpy(mms->asf_header + mms->asf_header_size,
> + mms->pkt_read_ptr,
> + mms->pkt_buf_len);
> + mms->asf_header_size += mms->pkt_buf_len;
Weird indenting...
in read_mms_packet():
> + if(mms->asf_header_read_pos < mms->asf_header_size) {
> + /* Read from ASF header buffer */
> + size_to_copy= FFMIN(buf_size,
> + mms->asf_header_size - mms->asf_header_read_pos);
> + memcpy(buf, mms->asf_header + mms->asf_header_read_pos, size_to_copy);
> + mms->asf_header_read_pos += size_to_copy;
> + result += size_to_copy;
> + dprintf(NULL, "Copied %d bytes from stored header. left: %d\n",
> + size_to_copy, mms->asf_header_size - mms->asf_header_read_pos);
> + } else if(mms->pkt_buf_len) {
After this, you can av_freep() the asf_header already, we no longer need it.
Ronald
More information about the ffmpeg-devel
mailing list