videomixer: Fix synchronization if dynamically changing the FPS

https://bugzilla.gnome.org/show_bug.cgi?id=735859
This commit is contained in:
Andrei Sarakeev 2014-09-02 11:13:44 +04:00 committed by Sebastian Dröge
parent ea43ef214a
commit 558f9a2a6f

View file

@ -401,6 +401,20 @@ gst_videomixer2_update_converters (GstVideoMixer2 * mix)
best_colorimetry = gst_video_colorimetry_to_string (&(best_info.colorimetry));
best_chroma = gst_video_chroma_to_string (best_info.chroma_site);
if (GST_VIDEO_INFO_FPS_N (&mix->info) != GST_VIDEO_INFO_FPS_N (&best_info) ||
GST_VIDEO_INFO_FPS_D (&mix->info) != GST_VIDEO_INFO_FPS_D (&best_info)) {
if (mix->segment.position != -1) {
mix->ts_offset = mix->segment.position - mix->segment.start;
mix->nframes = 0;
} else {
mix->ts_offset += gst_util_uint64_scale_round (mix->nframes,
GST_SECOND * GST_VIDEO_INFO_FPS_D (&mix->info),
GST_VIDEO_INFO_FPS_N (&mix->info));
mix->nframes = 0;
}
}
mix->info = best_info;
GST_DEBUG_OBJECT (mix,