[vlc-devel] [PATCH 1/1] [rawvideo] Fix timestamps & input options

David Flynn davidf+nntp at woaf.net
Wed Nov 5 11:13:52 CET 2008


On 2008-11-05, Laurent Aimar <fenrir at via.ecp.fr> wrote:
> On Wed, Nov 05, 2008, davidf+nntp at woaf.net wrote:
> Packetizer:
> -----------
>> +    if( !p_block->i_pts && !date_Get( &p_sys->m_pts ) )
>> +    if( p_block->i_pts )
> You MUST use dts if pts is not provided. Some demuxer will only set
> dts (like avi, or asf).

That does seem to be the opposite of mpeg2 semantics, whereby if dts
is present, pts must be present.

(infact i've got a patch for avi which sets PTS=DTS for the first
block output by the avi demux, since in a reordered codec, you can't
guess PTS from DTS; this at least allows some form of a/v sync -- and
allows a decoder to interpolate the pts at its output.  The downside
is that you can't correctly remux an avi stream to say mpeg2ts, but you
couldn't do that anyway so no real loss)

>> +    psz_tmp = var_CreateGetString( p_demux, "rawvid-chroma" );
>> +    if( psz_tmp && strlen( psz_tmp ) >= 4 )
>>      {
>  It would probably be better to check for == 4 to detect error no ?
Yes; was just a copy and paste of what was there before.

>  And you have a weird way to express test (value == variable iof
> variable == value like we do everwhere else in vlc).

doing: (literal|constant) == variable, is more typo safe, since if the
== is mistyped, the compiler will error.





More information about the vlc-devel mailing list