[FFmpeg-devel] [patch]MMS protocol over TCP

zhentan feng spyfeng
Sat Mar 27 17:13:24 CET 2010


Hi Ronald,

On Sat, Mar 27, 2010 at 11:04 PM, Ronald S. Bultje <rsbultje at gmail.com>wrote:

> [...]

>> 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.
> >
> > IMHO, we can free the header once it has been parsed.
> > ie, we can free the memory after this lines:
> >   case SC_PKT_ASF_HEADER:
> >        if((mms->incoming_flags == 0X08) || (mms->incoming_flags == 0X0C))
> {
> >            ret = asf_header_parser(mms);
> >            mms->header_parsed = 1;
> >           av_freep(mms->asf_header)// add here.
> >        }
>
> That wouldn't work, since we A) parse the header, and then B) serve it
> as first data (ASF file header) to the demuxer. Only after that can we
> free it. If you implement what you suggest, the demuxer would probably
> not work anymore, or does it?
>
> yes, you are right.
here is the new version patch.

zhentan
-- 
Best wishes~
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mmst_4.patch
Type: application/octet-stream
Size: 25652 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100328/8b54b478/attachment.obj>



More information about the ffmpeg-devel mailing list