[FFmpeg-devel] fix a bug for mmsh because the packet len is too large

zhentan feng spyfeng
Sat Dec 18 03:35:21 CET 2010


Hi

On Sat, Dec 18, 2010 at 5:18 AM, Ronald S. Bultje <rsbultje at gmail.com>wrote:

> Hi,
>
> On Tue, Aug 24, 2010 at 11:55 AM, Ronald S. Bultje <rsbultje at gmail.com>
> wrote:
> > Hi,
> >
> > On Tue, Aug 24, 2010 at 11:44 AM, zhentan feng <spyfeng at gmail.com>
> wrote:
> >> the patch fix a bug because the link below is failed (reported by Tamas
> >> Selmeci)
> >> mmsh://
> >>
> a1635.v24937.c2493.g.vm.akamaistream.net/7/1635/2493/v0001/premrad.download.akamai.com/2493/premiere_rock_report/Country_Report.wma
> >>
> >> according to the spec, the largest packet length is 65535.
> >> so we change the receive buffer size.
> > [..]
> >> --- libavformat/mmsh.c        (revision 24901)
> >> +++ libavformat/mmsh.c        (working copy)
> >> @@ -214,7 +214,7 @@
> >>  {
> >>      int i, port, err;
> >>      char httpname[256], path[256], host[128], location[1024];
> >> -    char *stream_selection;
> >> +    char *stream_selection = NULL;
> >>      char headers[1024];
> >>      MMSHContext *mmsh;
> >
> > Unrelated and unecessary (not used before being allocated just below).
> >
> >> --- libavformat/mms.h (revision 24901)
> >> +++ libavformat/mms.h (working copy)
> >> @@ -39,7 +39,7 @@
> >>
> >>      /** Buffer for incoming packets. */
> >>      /*@{*/
> >> -    uint8_t in_buffer[8192];             ///< Buffer for incoming
> packets.
> >> +    uint8_t in_buffer[65535];            ///< Buffer for incoming
> packets.
> >
> > Big... Can we keep the original size and get the packet contents in
> > multiple chunks from the TCP layer?
>
> Had another look, and this is actually much harder because it's the
> actual file header, which I didn't realize. 64k is OK then, so let's
> just do it (for now at least).
>
> Patch applied. :-).
>
> Ronald
>


Thanks very much :)

-- 
Best wishes~



More information about the ffmpeg-devel mailing list