[vlc-devel] [PATCH] Added support for VDR recordings.

Tobias Güntner fatbull at web.de
Sat Aug 21 20:55:06 CEST 2010


Am 08.05.2010 22:09, schrieb Laurent Aimar:
>> +    while( i_new_seekpoint + 1<  p_sys->p_marks->i_seekpoint&&
>> +        p_access->info.i_pos>= (uint64_t)p_sys->p_marks->
>> +        seekpoint[ i_new_seekpoint + 1 ]->i_byte_offset )
>> +    {
>> +        i_new_seekpoint++;
>> +    }
>   I am not sure, but maybe using bsearch() would be simpler.

Tried it, and it's not. At least not in an obvious way. The callback for 
bsearch() needs access to i_byte_offset of array elements n and n+1. 
Also, in most cases, the seek point does not change anyway.

>> +static void UpdateVideoFileSize( access_t *p_access )
>> +{
>> +    access_sys_t *p_sys = p_access->p_sys;
>> +    struct stat st;
>> +
>> +    if( p_access->info.i_size>= p_access->info.i_pos )
>> +        return;
>   It would be better to do as the file access does it (ie checking periodically).

I don't think this is a good idea, as this function does only half the 
work. VDR recordings are split into several files, hence a periodic 
check would need to stat() all of them, as well as check if new files 
have been created. This is a lot of work. I don't think a subroutine 
called by Read() is the right place to do it.

See revised patch in attachment.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-Added-support-for-VDR-recordings.patch
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20100821/a9c54177/attachment.ksh>

More information about the vlc-devel mailing list