[vlc-devel] commit: http: fix Content-Length and stream closure issues. (Bill C. Riemers )

Bill C. Riemers briemers at redhat.com
Mon Jun 23 21:51:09 CEST 2008


Ilkka Ollakka wrote:
> On su 22. kesäkuuta 2008 19:29:09, git version control wrote:
>   
>> vlc | branch: master | Bill C. Riemers <briemers+git at redhat.com> | Fri Jun 20 20:47:51 2008 -0400| [2c16687563b6e6096f5621db56917d9ef05424b2]
>>
>> +            int64_t i_nend = (p_access->info.i_size > 0)?(p_access->info.i_size - 1):i_tell;
>> +            int64_t i_nsize = p_access->info.i_size;
>> +            sscanf(p,"bytes %"PRId64"-%"PRId64"/%"PRId64,&i_ntell,&i_nend,&i_nsize);
>> +            if(i_nend > i_ntell ) {
>> +                p_access->info.i_pos = i_ntell;
>> +                p_sys->i_remaining = i_nend+1-i_ntell;
>> +                int64_t i_size = (i_nsize > i_nend) ? i_nsize : (i_nend + 1);
>>     
>
> is that i_nend + 1 correct there? I get invalid ranges with it when
> playing mp4-files.
>
>   
What type of invalid ranges?   Is the reported length from the
Content-Range different than the Content-Length?

The syntax of the value passed is:

Content-Range: bytes [Start Position]-[End Position]/[File Size]

Both [Start Position]  and [End Position] are numbered from zero.  So
the maximum value of [End Position] is one less than the [File Size].

It is not uncommon for servers to return '*' as File Size, which is why
i_nsize might end up to small and need to be assigned as i_nend+1.

Bill




More information about the vlc-devel mailing list