[vlc-devel] [PATCH 01/24] [mux/ogg] Enable dirac support
David Flynn
davidf+nntp at woaf.net
Tue Nov 4 19:51:45 CET 2008
On 2008-11-04, David Flynn <davidf+nntp at woaf.net> wrote:
> On 2008-11-01, Laurent Aimar <fenrir at via.ecp.fr> wrote:
>> 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).
>
> Ok.
Err, actually, at the top of that function there is:
if( !p_input->p_fmt->video.i_frame_rate ||
!p_input->p_fmt->video.i_frame_rate_base )
{
msg_Warn( p_mux, "Missing frame rate, assuming 25fps" );
p_input->p_fmt->video.i_frame_rate = 25;
p_input->p_fmt->video.i_frame_rate_base = 1;
}
So it looks as if Ogg muxing would be shafted anyway.
Is p_input->p_fmt->video.i_frame_rate_base allowed to change underneath you?
..david
More information about the vlc-devel
mailing list