From: Steinar Gunderson Date: Fri, 24 Sep 2010 20:17:14 +0000 (+0200) Subject: Set i_flags correctly in the video frames. X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=aa075c20fb9d7c2401c3890a59796bb9cdb90b77;p=vlc Set i_flags correctly in the video frames. --- diff --git a/modules/access/sdi.cpp b/modules/access/sdi.cpp index a2448d3f99..5d0f1e804b 100644 --- a/modules/access/sdi.cpp +++ b/modules/access/sdi.cpp @@ -54,6 +54,7 @@ struct demux_sys_t DeckLinkCaptureDelegate *p_delegate; es_out_id_t *p_video_es; es_out_id_t *p_audio_es; + bool b_first_frame; vlc_mutex_t frame_lock; block_t *p_video_frame; // protected by @@ -121,6 +122,12 @@ HRESULT DeckLinkCaptureDelegate::VideoInputFrameArrived(IDeckLinkVideoInputFrame BMDTimeValue stream_time, frame_duration; videoFrame->GetStreamTime( &stream_time, &frame_duration, CLOCK_FREQ ); + p_video_frame->i_flags = BLOCK_FLAG_TYPE_I; + if( p_sys->b_first_frame ) + { + p_video_frame->i_flags |= BLOCK_FLAG_DISCONTINUITY; + p_sys->b_first_frame = false; + } p_video_frame->i_pts = VLC_TS_0 + stream_time; } @@ -255,6 +262,8 @@ static int Open( vlc_object_t *p_this ) (char*)&audio_fmt.i_codec, audio_fmt.audio.i_rate, audio_fmt.audio.i_bitspersample, audio_fmt.audio.i_channels); p_sys->p_audio_es = es_out_Add( p_demux->out, &audio_fmt ); + p_sys->b_first_frame = true; + /* Update default_pts to a suitable value for access */ var_Create( p_demux, "sdi-caching", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );