[vlc-devel] [PATCH 01/24] [mux/ogg] Enable dirac support
Laurent Aimar
fenrir at via.ecp.fr
Sat Nov 1 16:30:48 CET 2008
On Thu, Oct 30, 2008, davidf+nntp at woaf.net wrote:
> + else if( p_stream->i_fourcc == VLC_FOURCC( 'd', 'r', 'a', 'c' ) )
> + {
> + mtime_t dt = (p_data->i_dts - p_sys->i_start_dts + 1)
> + * p_input->p_fmt->video.i_frame_rate *2
> + / p_input->p_fmt->video.i_frame_rate_base
> + / INT64_C(1000000);
> + mtime_t delay = (p_data->i_pts - p_data->i_dts + 1)
> + * p_input->p_fmt->video.i_frame_rate *2
> + / p_input->p_fmt->video.i_frame_rate_base
> + / INT64_C(1000000);
> + if( p_data->i_flags & BLOCK_FLAG_TYPE_I )
> + p_stream->i_last_keyframe = dt;
> + mtime_t dist = dt - p_stream->i_last_keyframe;
> + op.granulepos = dt << 31 | (dist&0xff00) << 14
> + | (delay&0x1fff) << 9 | (dist&0xff);
> + }
You MUST check for video.i_frame_rate_base != 0 as it may not always be
be set (probably in the Add function, and refuse it if not valid).
Is it mandatory to suppose CFR ? (VLC will create a non CFR video if the
space of the input cannot be controlled in order to accomodate clock drift).
Otherwise it seems fine to me.
--
fenrir
More information about the vlc-devel
mailing list