]> git.sesse.net Git - vlc/commitdiff
Set i_flags correctly in the video frames.
authorSteinar Gunderson <sgunderson@bigfoot.com>
Fri, 24 Sep 2010 20:17:14 +0000 (22:17 +0200)
committerSteinar Gunderson <sgunderson@bigfoot.com>
Fri, 24 Sep 2010 20:17:14 +0000 (22:17 +0200)
modules/access/sdi.cpp

index a2448d3f99be7d044e8e5e86f9e65e5e90274ea7..5d0f1e804bda9c0cc654f8cff13759ad8858d3c6 100644 (file)
@@ -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 <frame_lock>
@@ -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 );