g_mutex_lock (&timecodestamper->mutex);
if (res && timecodestamper->vinfo.fps_n && timecodestamper->vinfo.fps_d) {
gst_query_parse_latency (query, &live, &min_latency, &max_latency);
- if (live) {
+ if (live && timecodestamper->ltcpad) {
/* Introduce additional 8 frames of latency for LTC processing as
* the LTC library seems to usually lag behind 1-6 frames with the
* values reported back to us. */
/* Update LTC-based timecode as needed */
#if HAVE_LTC
- {
+ if (timecodestamper->ltcpad) {
GstClockTime frame_duration;
gchar *tc_str;
LTCFrameExt ltc_frame;
return NULL;
}
+ if (GST_STATE (timecodestamper) > GST_STATE_READY ||
+ GST_STATE_TARGET (timecodestamper) > GST_STATE_READY) {
+ GST_ERROR_OBJECT (timecodestamper,
+ "LTC audio pad can only be requested in NULL or READY state");
+ GST_OBJECT_UNLOCK (timecodestamper);
+ return NULL;
+ }
+
timecodestamper->ltcpad = gst_pad_new_from_static_template
(&gst_timecodestamper_ltc_template, "ltc_sink");