[vlc-devel] [PATCH]Improved nuv demuxer and new rtjpeg decoder

Gertjan Van Droogenbroeck gertjanvd at gmail.com
Thu Aug 7 22:05:22 CEST 2008


Hi,

On Mon, Aug 4, 2008 at 9:40 PM, Laurent Aimar <fenrir at via.ecp.fr> wrote:
>> +    if( !fh.i_keyframe && !p_sys->b_index )
>> +        demux_IndexAppend( &p_sys->idx, p_data->i_dts, stream_Tell(p_demux->s) - sizeof( frame_header_t ) );
> sizeof(frame_header_t) is not acceptable. It is compiler dependant.
> Now a simple define to hide the value 12 would probably be cleaner :)
A define with the size is now used. I also keep the original frame
header and add that to the frame data for rtjpeg video frames.

>> -            if( p_sys->idx.i_idx > 0 )
>> +            /* if we can seek in the stream and the stream isn't being recorded (size changing) */
> Why cannot we seek in stream being recorded ?
I added this to fix a problem where vlc would keep sending "could not
read file" messages when seeking during a recording, but this was not
the right solution. By checking all stream_Seek and stream_Read return
values it isn't needed anymore.

> It seems to me that SET_POSITION and SET_TIME could benefit from a common
> function to avoid a lot of code duplication.
A function ControlSetPosition has been added.

>> +        p_seek_table = (uint8_t*)malloc( fh.i_length );
> Casting malloc is useless.
>> +            p_kfa_table = (uint8_t*)malloc( fh.i_length );
> Same.
Removed.

> A lot of code inside SeekTableLoad seems duplicated (when i_kfa_elements == 0 or not)
I cleaned this up and the part with i_kfa_elements !=0 is now used for
both cases.

> Also you should test the return values of
>  - stream_Seek/stream_Read.
>  - at least all malloc that use a size comming from the stream (like fh.i_length)
All the stream_Seek/stream_Read and malloc return values are checked.

> There is also missing free() in the error paths.
This is also fixed now.

The rtjpeg decoder has also been updated, all the functions that were
not needed have been removed and it should be possible to decode
multiple rtjpeg video streams at the same time now.

Gertjan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Improved-nuv-demuxer.patch
Type: text/x-patch
Size: 20672 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20080807/dbb1b323/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Add-rtjpeg-decoder.patch.bz2
Type: application/x-bzip2
Size: 28345 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20080807/dbb1b323/attachment-0001.bin>


More information about the vlc-devel mailing list