		}
	}

	return GF_TRUE;
}

//depending on input formats, streams may be declared with or without DCD. For streams requiring the config, wait for it
static Bool dasher_check_period_ready(GF_DasherCtx *ctx, Bool is_session_end)
{
	u32 i=0;
	GF_DashStream *ds;
	ctx->period_not_ready = GF_FALSE;
	while ((ds = gf_list_enum(ctx->current_period->streams, &i))) {

		if (is_session_end)
			gf_filter_pid_set_discard(ds->ipid, GF_TRUE);

		if (ds->dcd_not_ready) {
			GF_FilterPacket *pck;
			u32 prev = ds->dcd_not_ready;
			ds->dcd_not_ready = 0;
			pck = gf_filter_pid_get_packet(ds->ipid);
			if (!pck) {
				u32 diff = gf_sys_clock() - prev;
				if (diff > 10000) {
					GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("[Dasher] Failed to initialize PID %s, no packets after %d ms, aborting\n", gf_filter_pid_get_name(ds->ipid), diff));
					ctx->in_error = GF_TRUE;
					return GF_FALSE;
				}
				ds->dcd_not_ready = prev;
		}
	}

	return GF_TRUE;
}

 
static Bool dasher_check_period_ready(GF_DasherCtx *ctx, Bool is_session_end)
{
	u32 i=0;
	GF_DashStream *ds;
	ctx->period_not_ready = GF_FALSE;
	while ((ds = gf_list_enum(ctx->current_period->streams, &i))) {

		if (is_session_end)
			gf_filter_pid_set_discard(ds->ipid, GF_TRUE);

		if (ds->dcd_not_ready) {
			GF_FilterPacket *pck;
			u32 prev = ds->dcd_not_ready;
			ds->dcd_not_ready = 0;
			pck = gf_filter_pid_get_packet(ds->ipid);
			if (!pck) {
				u32 diff = gf_sys_clock() - prev;
				if (diff > 10000) {
					GF_LOG(GF_LOG_ERROR, GF_LOG_DASH, ("[Dasher] Failed to initialize PID %s, no packets after %d ms, aborting\n", gf_filter_pid_get_name(ds->ipid), diff));
					ctx->in_error = GF_TRUE;
					return GF_FALSE;
				}
				ds->dcd_not_ready = prev;