diff options
author | Vivia Nikolaidou <vivia@ahiru.eu> | 2017-11-10 17:18:45 +0200 |
---|---|---|
committer | Vivia Nikolaidou <vivia@ahiru.eu> | 2017-11-10 17:28:05 +0200 |
commit | 38120376c6720dcc3cbf171ccc7faa3c5de19e14 (patch) | |
tree | 7151c02479a5bfaf218147418ddfbb36a6c7b3fe /gst/timecode | |
parent | 71bfbce84de9980a2c5a3c5b6d5407818a67ec2a (diff) |
avwait: Better handling of deserialised timecode framerates
Now that timecodes support proper serialisation / deserialisation, a
timecode might have an invalid fps_n / fps_d even without using the
target-time-code-string property. Detect those cases and set fps_n/fps_d
properly.
Diffstat (limited to 'gst/timecode')
-rw-r--r-- | gst/timecode/gstavwait.c | 10 | ||||
-rw-r--r-- | gst/timecode/gstavwait.h | 1 |
2 files changed, 5 insertions, 6 deletions
diff --git a/gst/timecode/gstavwait.c b/gst/timecode/gstavwait.c index 27aab853a..8067d38be 100644 --- a/gst/timecode/gstavwait.c +++ b/gst/timecode/gstavwait.c @@ -246,7 +246,6 @@ gst_avwait_init (GstAvWait * self) self->video_eos_flag = FALSE; self->audio_flush_flag = FALSE; self->shutdown_flag = FALSE; - self->from_string = FALSE; self->tc = gst_video_time_code_new_empty (); self->end_tc = NULL; self->running_time_to_end_at = GST_CLOCK_TIME_NONE; @@ -403,8 +402,6 @@ gst_avwait_set_property (GObject * object, guint prop_id, gst_video_time_code_free (self->tc); g_free (end_tc); self->tc = gst_video_time_code_new_empty (); - } else { - self->from_string = TRUE; } g_strfreev (parts); break; @@ -413,7 +410,6 @@ gst_avwait_set_property (GObject * object, guint prop_id, if (self->tc) gst_video_time_code_free (self->tc); self->tc = g_value_dup_boxed (value); - self->from_string = FALSE; if (self->end_tc && gst_video_time_code_compare (self->tc, self->end_tc) != -1) { gchar *start_tc, *end_tc; @@ -527,10 +523,14 @@ gst_avwait_vsink_event (GstPad * pad, GstObject * parent, GstEvent * event) return FALSE; } g_mutex_lock (&self->mutex); - if (self->from_string) { + if (self->tc && self->tc->config.fps_n == 0) { self->tc->config.fps_n = self->vinfo.fps_n; self->tc->config.fps_d = self->vinfo.fps_d; } + if (self->end_tc && self->end_tc->config.fps_n == 0) { + self->end_tc->config.fps_n = self->vinfo.fps_n; + self->end_tc->config.fps_d = self->vinfo.fps_d; + } g_mutex_unlock (&self->mutex); break; } diff --git a/gst/timecode/gstavwait.h b/gst/timecode/gstavwait.h index 70924b411..3e27f0b2c 100644 --- a/gst/timecode/gstavwait.h +++ b/gst/timecode/gstavwait.h @@ -48,7 +48,6 @@ struct _GstAvWait GstElement parent; GstVideoTimeCode *tc; - gboolean from_string; GstClockTime target_running_time; GstAvWaitMode mode; |