[MPlayer-dev-eng] Patch for Position indicator for MPEG over HTTP

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Fri Aug 24 17:32:56 CEST 2007


Hello,
On Fri, Aug 24, 2007 at 05:19:30PM +0200, Nico Sabbi wrote:
> Johannes Deisenhofer wrote:
> > Problem:
> > When playing MPEG2 TS or PS-files over http, the OSD File-Position
> > Indicator does not work.
> >
> > A simple proposed fix is attached.
> >
> > Jo
> >
> >
> > ------------------------------------------------------------------------
> >
> > Index: stream/http.c
> > ===================================================================
> > --- stream/http.c    (revision 24135)
> > +++ stream/http.c    (working copy)
> > @@ -812,7 +812,11 @@
> >                     char *content_length = NULL;
> >                     mp_msg(MSGT_NETWORK,MSGL_V,"Content-Type: [%s]\n", 
> > content_type );
> >                     if( (content_length = http_get_field(http_hdr, 
> > "Content-Length")) != NULL)
> > -                        mp_msg(MSGT_NETWORK,MSGL_V,"Content-Length: 
> > [%s]\n", http_get_field(http_hdr, "Content-Length"));
> > +                    {
> > +                        off_t cl=(off_t)atol(content_length);
> > +                        mp_msg(MSGT_NETWORK,MSGL_V,"Content-Length: 
> > [%ld]\n", (long)cl);
> > +                        stream->end_pos=cl;
> > +                    }
> >                     // Check in the mime type table for a demuxer type
> >                     i = 0;
> >                     while(mime_type_table[i].mime_type != NULL) {
> >  
> >
> 
> sizeof(off_t) may be != sizeof(long), but this patch is good enough for me

That would mean it might break playback of anything bigger than 2 GB
over http. I am also not sure what effect it will have on mov-playback.
And lastly, is Content-Length guaranteed to be the correct value?
This patch IMO has a huge potential for breaking things...

Greetings,
Reimar Döffinger



More information about the MPlayer-dev-eng mailing list